Skip to content

Move to a new server

Move AFTAB by backing up the old server and installing on the new one with that backup. Clients, keys, plans, resellers and settings come along, including the secrets key and the panel’s signing key.

  1. Tell bridges and servers the new address if it will change. Add the new https address under Other addresses of this panel (node_addresses) on the old panel and wait for every node to sync once. Same domain: pointing DNS at the new server is enough once HTTPS is up there. See also Iran bridges.
  2. Decide what clients will connect to. A domain in their configs is worth more than a bare IP. If configs name the old IP, plan to set AFTAB_PUBLIC_HOST on install and have them import the link again.
  3. Make a backup on the old server: sudo aftab backup /root/aftab.db, or Backup → Download backup on Overview. Prefer an encrypted .enc if it leaves the server. See Backups and restore.
  4. New host: same requirements as a fresh install (KVM/Xen, supported distro). You do not need to pre-install Tor, AmneziaWG or Psiphon: when the backup needs them, the panel installs them after restore (below). A different local SOCKS program on loopback is still yours to run on the new host.

Copy the backup to the new server, then:

Terminal window
sudo AFTAB_RESTORE=/root/aftab.db \
bash -c "$(curl -fsSL https://raw.githubusercontent.com/aftabIR/aftabWG/main/install.sh)"
  • Encrypted .enc: also AFTAB_RESTORE_PASSWORD (the old admin password).
  • Remote https URL: AFTAB_RESTORE_URL=https://… instead of a file.
  • New address in client configs: AFTAB_PUBLIC_HOST.
  • Unattended: AFTAB_ACCEPT_EULA=1.

AFTAB_RESTORE works only on a fresh install (no database yet). On a server that already runs AFTAB: sudo aftab stop then sudo aftab restore FILE.

After restore, the installer clears certificate paths that are not on this host and asks about HTTPS again.

  1. Sign in with the backup’s admin username and password.
  2. Set HTTPS again (HTTPS).
  3. Open the panel TCP port and VPN UDP ports in the cloud firewall.
  4. AmneziaWG and Tor: if the backup had an AmneziaWG inbound or a Tor exit, restore names them and they install themselves; those links stay down a few minutes. A SOCKS5 exit to 127.0.0.1 is not installed for you — start that program or the restore names the quiet port.
  5. Point the domain, test a client, confirm bridges and exits reconnect.
  6. Switch the old server off (or sudo aftab uninstall) so two panels do not share clients.
  • Missing file / wrong password / plain http URL — same errors as Moving to a new server in Upkeep.
  • A node joined after the backup is named before replace; it must join again with a new install command.
  • Secrets that open with neither key: restore a real panel backup, or --lose-secrets / AFTAB_RESTORE_LOSE_SECRETS=1 (tokens and node joins again). See Backups.
  • Clients still on the old IP: domain or AFTAB_PUBLIC_HOST, then re-import.

Certificate files stay on the old disk. Local SOCKS/Psiphon binaries are not copied. Cloud firewall rules are not copied. The old server keeps running until you stop it.