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.
Before you start
Section titled “Before you start”- 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. - 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_HOSTon install and have them import the link again. - Make a backup on the old server:
sudo aftab backup /root/aftab.db, or Backup → Download backup on Overview. Prefer an encrypted.encif it leaves the server. See Backups and restore. - 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:
sudo AFTAB_RESTORE=/root/aftab.db \ bash -c "$(curl -fsSL https://raw.githubusercontent.com/aftabIR/aftabWG/main/install.sh)"- Encrypted
.enc: alsoAFTAB_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.
How to check it worked
Section titled “How to check it worked”- Sign in with the backup’s admin username and password.
- Set HTTPS again (HTTPS).
- Open the panel TCP port and VPN UDP ports in the cloud firewall.
- 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.1is not installed for you — start that program or the restore names the quiet port. - Point the domain, test a client, confirm bridges and exits reconnect.
- Switch the old server off (or
sudo aftab uninstall) so two panels do not share clients.
If it does not
Section titled “If it does not”- 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.
What is not changed
Section titled “What is not changed”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.