# Moving to a new server

> Move a FeatherPanel install or a FeatherWings node to another machine with the installer's Export for Migration and Import Migration tools.

Source: https://featherpanel.com/docs/migrating/between-hosts/

The installer can package a whole Docker install of the panel, or a whole FeatherWings node, into one archive and
restore it on another machine. This page covers both. To move from Pterodactyl instead, read
[Migrating from Pterodactyl](https://featherpanel.com/docs/migrating/pterodactyl).

> [!WARNING]
> Both tools copy live files. For a consistent database copy, stop users from making changes during the export, and
> keep a separate [database dump](https://featherpanel.com/docs/panel/backups) as a fallback.

## Move the panel

### 1. Export on the old server

Run the installer and open **Panel → Backup Manager → Export for Migration**:

```bash
curl -sSL https://get.featherpanel.com/installer.sh | bash
```

The containers must be running. The installer:

- exports every Docker volume used by the `mysql`, `backend` and `redis` containers (database files, config with the
  encryption key, attachments, snapshots, Redis data) as `.tar.gz` files,
- copies `docker-compose.yml` and `.env`,
- writes `migration_info.txt` (it looks up the server's public IP with `ifconfig.me`) and `README_MIGRATION.txt`,
- packs everything into `/var/www/featherpanel/migrations/featherpanel_migration_YYYYMMDD_HHMMSS.tar.gz` with mode 600.

### 2. Copy the archive

From the new server:

```bash
mkdir -p /var/www/featherpanel/migrations
scp root@OLD_SERVER:/var/www/featherpanel/migrations/featherpanel_migration_*.tar.gz /var/www/featherpanel/migrations/
```

`rsync -avz` works the same way.

### 3. Import on the new server

Run the installer and open **Panel → Backup Manager → Import Migration**. It lists archives in
`/var/www/featherpanel/migrations` and up to two levels below `/root` and `/home`, or asks for a path. Type `yes` to
confirm.

- If the panel is not installed yet, the installer installs Docker, restores `docker-compose.yml` and `.env` from the
  package, restores the volumes and starts the stack.
- If a panel is installed, it runs `docker compose down`, replaces every volume with the imported data and starts the
  containers again. Everything that was on the new server is lost.

### 4. Finish the move

The import does not configure a web server or certificates. On the new server:

1. Point your DNS record at the new IP.
2. Set up the [web server](https://featherpanel.com/docs/panel/web-server) and [SSL](https://featherpanel.com/docs/panel/ssl), or a
   [Cloudflare Tunnel](https://featherpanel.com/docs/panel/web-server/cloudflare-tunnel).
3. Sign in and check that servers, nodes and settings look right.

Nodes keep working without changes as long as the panel URL stays the same. If the URL changes, change it in the
panel settings and re-run `featherwings configure` on each node so the node talks to the new address.

## Move a FeatherWings node

### Export

In the installer open **Wings → Backup Manager → Export for Migration**, or run:

```bash
featherwings node-backup export --out /var/lib/featherpanel/wings_migrations
```

The installer stops the `featherwings` service during the export and starts it again afterwards. If the CLI export is
not available it falls back to a tar archive with the server volumes, local backups and `config.yml`, named
`featherwings_migration_YYYYMMDD_HHMMSS.tar.gz`.

### Import

1. [Install FeatherWings](https://featherpanel.com/docs/wings/installation) on the new machine.
2. Copy the archive to `/var/lib/featherpanel/wings_migrations/`.
3. Run the installer's **Wings → Backup Manager → Import Migration**, or:

   ```bash
   featherwings node-backup import --file /var/lib/featherpanel/wings_migrations/featherwings_migration_XXXX.tar.gz
   ```

4. Start FeatherWings and, if the IP or hostname changed, update the node's FQDN in **Admin → Nodes**.

Game ports are bound to the node's IP addresses. If the new machine has different IPs, update the allocations too.

## Related

- [Backups](https://featherpanel.com/docs/panel/backups)
- [Updating the panel](https://featherpanel.com/docs/panel/updating)
- [Uninstall](https://featherpanel.com/docs/panel/uninstall)

## Frequently asked questions

### Does the migration package include the encryption key?

Yes. The panel package contains every FeatherPanel Docker volume, including featherpanel_config with DATABASE_ENCRYPTION_KEY, plus docker-compose.yml and .env. Treat the archive as a secret.

### Do I need to install FeatherPanel on the new server first?

No. Import Migration installs Docker and the panel with the imported data when it finds no existing install. If a panel is already there, its data is replaced.
