Docs cipi.yml Web panel API MCP Guides Compare GitHub Telegram channel
  1. Home
  2. Guides
  3. Move Laravel apps to a new server with cipi sync
Operations

Move Laravel apps to a new server with cipi sync

Migrate one app or a whole server between providers (AWS to Hetzner, an old VPS to a bigger one) with encrypted archives, the same deploy keys, database and storage, and a DNS switch when you're ready.

By Updated 2 min read

cipi sync copies whole apps between Cipi servers: configuration, deploy keys, workers, crontab, PHP version and, if you want, database and storage. Archives are encrypted with AES-256. The old server keeps serving until you switch DNS.

Server sync
$ cipi sync push --host=203.0.113.20 --with-db --with-storage --import

Key ideas, in plain words#

TermMeaning
SyncCopying apps (settings, keys, workers, optionally data) between Cipi servers
TrustThe new server accepts pushes from the old one's key only
Cut-overSwitching DNS to the new server

1. Prepare the new server#

Install Cipi on it (providers) and install the same PHP versions your apps use (sudo cipi php install 8.5).

2. Trust between the two servers#

bash
# old server
sudo cipi sync pubkey
# new server: paste it
sudo cipi sync trust

3. Push the apps#

bash
sudo cipi sync push --host=203.0.113.20 --with-db --with-storage --import

Or one app at a time: sudo cipi sync push shop --host=….

TravelsDetail
.env, auth.json, deploy.phpAlways
Deploy key and SSH configThe same key keeps working on GitHub
Workers, crontab, PHP version, limitsAlways
DatabaseWith --with-db; new database password on a new app
shared/storageWith --with-storage
CertificatesNever: issued on the new server after DNS moves

4. Test before switching#

Point your laptop's /etc/hosts at the new IP and browse the app. Then deploy once on the new server to check the Git path end to end:

bash
sudo cipi deploy shop

5. Switch DNS, then certificates#

Lower the TTL a day before. Change the A records, wait for propagation, then:

bash
sudo cipi ssl install shop

Run a last sync push --with-db --update just before the switch if the database changed in the meantime.

Keep a warm standby#

The same command on a schedule replicates apps to a second server. Combined with backups, it covers both "restore yesterday" and "this server is gone".

Troubleshooting#

ProblemFix
Push refused: not trustedRun cipi sync trust on the new server with the old one's key
App fails on the new serverIts PHP version isn't installed there: cipi php install
Site still served by the old serverDNS TTL: wait, check dig +short
Duplicate jobs during the moveStop workers on the old server after the final sync

Questions

Is the old server changed by a push?

No. It only reads and exports. Nothing is deleted there until you do it.

Do certificates move?

Re-issue them on the new server after DNS points there (cipi ssl install), which takes seconds.

Can I move only some apps?

Yes. Name them in cipi sync push, or move them one by one.

What if a step fails?

Read the troubleshooting table above first. Then check the matching docs page, open a GitHub issue, or ask in the community. Most commands print the fix when they refuse something.

Do I need the web panel for this?

No. Every step works from the CLI. The optional web panel shows the same things in a browser.

Can I run these commands from my laptop?

Many of them, through cipi-cli and the API, with a scoped token. Otherwise ssh cipi@your-server and use sudo cipi ….

Will this affect other apps on the server?

No, unless the step says it's server-wide (installing a PHP version, firewall, Cloudflare tunnel). Each app has its own user, PHP pool, database and Valkey.

Try it on your own server

Free and open source. One command on a fresh Ubuntu 24.04 or 26.04 VPS.

wget -O - https://cipi.sh/setup.sh | bash
Read the quickstart