From ef035edd5dab8208b25044f98d35c5f8d67b4dbd Mon Sep 17 00:00:00 2001 From: root Date: Wed, 15 Jul 2026 17:31:58 -0400 Subject: [PATCH] =?UTF-8?q?Initial=20commit=20=E2=80=94=202026-07-15?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 42 ++++++++++++++++++++++++++++++++++++++++++ README.md | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 82 insertions(+) create mode 100644 CHANGELOG.md create mode 100644 README.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..fcbcbbd --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,42 @@ +# UniFi Controller Migration — CHANGELOG + +## 2026-07-15 + +### Phase 1 — Fresh deploy on app2 +- **Action:** Deployed jacobalberty/unifi:latest (v10.0.162) in Docker on app2 +- **Image:** Bundles MongoDB internally — single container, no external DB +- **Caddy proxy:** unifi.itpropartner.com:443 → localhost:8443 with tls_insecure_skip_verify +- **Status:** ✅ Controller running, healthy + +### Phase 2 — Admin account creation +- **Obstacle:** Fresh controller has zero admin users — can't log in +- **Fix:** Created admin via MongoDB shell (mongosh port 27117) using openssl passwd -6 +- **Credentials:** info@itpropartner.com / TempChangeMe123! (changed by user) +- **Status:** ✅ + +### Phase 3 — Old controller backup discovery +- **Obstacle:** `.unf` files on old server are encrypted BSON, not standard zip +- **Fix:** Pulled autobackups from 178.156.131.57:/var/lib/unifi/backup/autobackup/ +- **Files:** 8 backups (161KB each), base backup 9.0.114.unf (686KB) from Oct 2025 +- **S3 sync set up:** Daily cron → s3://hermes-vps-backups/unifi-backups/ +- **Status:** ✅ Backups safe in S3 + +### Phase 4 — Restore attempts +- **Obstacle:** ace.jar restore fails with Spring context errors — can't run concurrently with active controller +- **Attempts:** Stopped UniFi process, ran restore — still failed. Docker volume vs bind mount path confusion. +- **Resolution:** Emailed .unf files to user for manual upload through setup wizard +- **Status:** ⚠️ Pending manual restore by user + +### Phase 5 — Old controller decommissioning +- **Action:** Stopped UniFi service, disabled from boot on 178.156.131.57 +- **Hetzner deletion:** ID 59987821 (178.156.131.57) removed +- **Backup cron removed:** unifi-backup-sync shut down (source deleted) +- **Status:** ✅ + +## Lessons + +- jacobalberty/unifi Docker image uses TWO storage volumes: /config (bind mount) + /unifi (anonymous volume) +- ace.jar restore requires MongoDB running but NOT the UniFi Java process — yet the Spring context still collides +- UniFi 10.x API requires CSRF token + session cookie; NoSiteContext errors even with valid login +- mongosh replaces mongo on MongoDB 5+ — different binary, same port +- Always verify port ownership (Caddy on 443, UniFi on 8443) before deployment diff --git a/README.md b/README.md new file mode 100644 index 0000000..d219233 --- /dev/null +++ b/README.md @@ -0,0 +1,40 @@ +# UniFi Controller Migration + +**Started:** 2026-07-15 +**Status:** Live on app2 — pending backup restore for device data + +## Architecture + +```text +Old: 178.156.131.57 (Hetzner, Ubuntu, UniFi v9.5.21) — DELETED 2026-07-15 +Old: 143.198.185.17 (DigitalOcean) — offline, no SSH access +New: app2 (152.53.39.202, netcup RS 4000) — Docker jacobalberty/unifi:latest v10.0.162 + +Domain: unifi.itpropartner.com (SiteGround DNS → 152.53.39.202) +Proxy: Caddy on app2, port 443 → unifi-controller:8443 (TLS, self-signed) + +Docker: --name unifi-controller, restart unless-stopped +Ports: 8443 (UI), 8080 (inform), 3478/udp (STUN), 10001/udp (discovery) +Volume: /opt/unifi → container /config +``` + +## URLs + +- Controller: https://unifi.itpropartner.com +- Direct: https://152.53.39.202:8443 + +## Recovery + +1. `docker run -d --restart unless-stopped --name unifi-controller -p 8443:8443 -p 8080:8080 -p 8880:8880 -p 8843:8843 -p 3478:3478/udp -p 10001:10001/udp -v /opt/unifi:/config -e TZ=America/New_York -e RUNAS_UID0=true jacobalberty/unifi:latest` +2. Restore from .unf backup via setup wizard or API +3. Caddy auto-handles SSL on port 443 + +## Backups + +- Old server backups archived: s3://hermes-vps-backups/unifi-backups/ (8 .unf files, 1.9 MB) +- Source was 178.156.131.57:/var/lib/unifi/backup/autobackup/ +- Daily sync removed (source deleted) + +## Landing Page + +- core.itpropartner.com/unifi → links to controller