3.9 KiB
operator-migration
English
Zero-downtime migration from the legacy WireGuard + Go API stack to operator-docker. Existing VPN clients reconnect automatically — no new configuration required on their end.
How it works
The server's WireGuard identity (private key → public key) is preserved. All peers are migrated to the new API. Clients reconnect without any config change.
Before After
wireguard (linuxserver) wireguard (same identity)
wireguard-api (Go) operator-api (FastAPI)
nginx-certbot marzban + hysteria2 + mysql
Prerequisites
- Legacy stack running (
docker psshowswireguard) - Domain with DNS pointing to this server
- SSH key authorized by Simplified Privacy
- Port 80/TCP open externally (required by Let's Encrypt)
Migration
Run as your Linux user (not root):
bash migration.sh
What it does:
- Requests sudo once — no further prompts
- Verifies SSH access and clones operator-docker
- Creates a full backup — WireGuard keys, peers, Nginx, SSL certs
- Shuts down the legacy stack
- Runs the operator-docker installer
- Injects the legacy WireGuard identity into the new stack
- Migrates all peers via the new API
- Destroys the private key from disk
Rollback
If something goes wrong — or you want to revert — run:
bash rollback.sh
What it does:
- Stops operator-docker completely
- Removes SSL certificates issued for the new subdomains
- Restores the Nginx configuration from backup
- Restores SSL certificates from backup
- Starts the legacy Go stack
- Deletes the migration backup
Notes
- The private key is destroyed from disk after successful migration.
- If port 80 is blocked, SSL issuance will fail. Contact your VPS provider or use DNS challenge manually.
- IPv6 is detected and enabled automatically.
Español
Migración sin tiempo de inactividad desde el stack legacy WireGuard + Go API hacia operator-docker. Los clientes VPN existentes se reconectan automáticamente — no requieren ningún cambio de configuración.
Cómo funciona
La identidad WireGuard del servidor (clave privada → clave pública) se preserva. Todos los peers se migran a la nueva API. Los clientes se reconectan sin cambios.
Antes Después
wireguard (linuxserver) wireguard (misma identidad)
wireguard-api (Go) operator-api (FastAPI)
nginx-certbot marzban + hysteria2 + mysql
Requisitos
- Stack legacy corriendo (
docker psmuestrawireguard) - Dominio con DNS apuntando a este servidor
- SSH key autorizada por Simplified Privacy
- Puerto 80/TCP abierto externamente (requerido por Let's Encrypt)
Migración
Ejecutar como usuario Linux (no root):
bash migration.sh
Pasos:
- Solicita sudo una vez — sin interrupciones posteriores
- Verifica acceso SSH y clona operator-docker
- Crea un backup completo — claves WireGuard, peers, Nginx, certificados SSL
- Apaga el stack legacy
- Ejecuta el instalador de operator-docker
- Inyecta la identidad WireGuard legacy en el nuevo stack
- Migra todos los peers vía la nueva API
- Destruye la clave privada del disco
Rollback
Si algo falla — o si se quiere revertir — ejecutar:
bash rollback.sh
Pasos:
- Detiene operator-docker completamente
- Elimina los certificados SSL emitidos para los nuevos subdominios
- Restaura la configuración de Nginx desde el backup
- Restaura los certificados SSL desde el backup
- Inicia el stack Go legacy
- Elimina el backup de migración
Notas
- La clave privada se destruye del disco tras la migración exitosa.
- Si el puerto 80 está bloqueado, la emisión de certificados fallará. Contacta a tu proveedor VPS o usa DNS challenge manualmente.
- IPv6 se detecta y habilita automáticamente.