Docs cipi.yml Web panel API MCP Guides Compare GitHub Telegram channel
  1. Docs
  2. Backups & monitoring
  3. Server sync & migration

Server sync & migration

Move or replicate apps between Cipi servers with encrypted archives.

Backups & monitoring

Move, copy or replicate whole apps between Cipi servers: configuration, deploy keys, workers, crontab, and optionally database and storage. Archives are encrypted with AES-256 and a passphrase, so credentials are safe at rest and in transit. Migrating providers becomes one command.

Server sync
$ cipi sync push --host=203.0.113.20 --with-db --with-storage --import
Step 1 of 4Export

On the old server, the apps (settings, keys, workers, optionally database and storage) are packed into an archive encrypted with your passphrase.

Commands#

CommandDoes
cipi sync export [apps] [--with-db] [--with-storage]Write an encrypted archive
cipi sync import <archive> [apps] [--update] [--deploy]Create (or update) apps from it
cipi sync push [apps] --host=IP [--with-db] [--with-storage] [--import]Export + transfer + import in one go
cipi sync list <archive>Inspect an archive without importing
cipi sync pubkey / cipi sync trustKey-based trust between two servers

Add --passphrase="$(cat /etc/cipi/.sync_passphrase)" for scripts (store it with chmod 400).

What travels#

ItemIncluded
.env, auth.json, deploy.phpAlways
Deploy key, SSH config, known hostsAlways: the same key keeps working on GitHub
Workers, crontab, PHP version, limits, cipi.yml auto-applyAlways
Database dump--with-db
shared/storage--with-storage
CertificatesNever: run cipi ssl install after the DNS switch

Import: new vs existing apps#

New appExisting app (--update)
User, directories, vhost, pool, workersCreatedRegenerated
Database credentialsNew random password, written to .envTarget keeps its own
Rest of .env (APP_KEY, mail…)From the archiveFrom the archive
Database dataImportedTables replaced
PHP versionAs source (must be installed)Migrated if it changed

Pre-flight checks block an import that would clash with an existing app or domain. New passwords are printed once at the end.

Recipes#

Migrate a whole server (e.g. AWS → Hetzner):

bash
# on the new server: cipi sync trust (paste the key from: cipi sync pubkey on the old one)
cipi sync push --host=NEW_IP --with-db --with-storage --import
# on the new server, after pointing DNS:
cipi ssl install shop && cipi ssl install blog

Warm standby every 6 hours (data-loss window = interval):

bash
0 */6 * * * /usr/local/bin/cipi sync push --host=STANDBY_IP --with-db --with-storage --import --passphrase="$(cat /etc/cipi/.sync_passphrase)" >> /var/log/cipi/sync.log 2>&1

If the primary fails: point DNS at the standby, cipi ssl install each app, done.

Portable nightly archive:

bash
0 3 * * * /usr/local/bin/cipi sync export --with-db --with-storage --output=/root/backups/cipi-$(date +\%F).tar.gz.enc --passphrase="$(cat /etc/cipi/.sync_passphrase)"

Database sync is a full replace and storage a full extract (files deleted on the source remain on the target). Node apps are not synced yet. For point-in-time history use Backups.