Whether you’re upgrading your hardware or moving to a different provider, migrating ERPNext to a new server is something every admin needs to know. This guide covers the complete process — backup, transfer, restore, and verification.

STEP 1 Backup on Old Server

cd frappe-bench
bench --site mysite.local backup --with-files

Note the backup file paths:

ls -la sites/mysite.local/private/backups/

STEP 2 Transfer Backups to New Server

scp sites/mysite.local/private/backups/*latest* user@new-server:/tmp/erpnext-backup/

STEP 3 Set Up New Server

Install all dependencies on the new server following the standard ERPNext installation guide. Install the same version of ERPNext that your old server was running.

# Check version on old server
bench version

# On new server, init bench with same version
bench init --frappe-branch version-15 frappe-bench
cd frappe-bench
bench get-app erpnext --branch version-15
bench new-site mysite.local

STEP 4 Restore Backup

bench --site mysite.local restore 
  /tmp/erpnext-backup/database.sql.gz 
  --with-public-files /tmp/erpnext-backup/files.tar 
  --with-private-files /tmp/erpnext-backup/private-files.tar

STEP 5 Run Migrations

bench --site mysite.local migrate
bench --site mysite.local clear-cache
bench --site mysite.local clear-website-cache

STEP 6 Set Up Production

sudo bench setup production erpnext
bench --site mysite.local enable-scheduler

STEP 7 Update DNS

Point your domain to the new server’s IP address. If using Cloudflare or similar DNS, update the A record.

STEP 8 Verify

# Check if site loads
curl -I https://yourdomain.com

# Check scheduler
bench --site mysite.local doctor

# Check error logs
bench --site mysite.local show-pending-jobs

Keep the old server running for at least a week after migration. If anything goes wrong, you can quickly point DNS back to the old server while you troubleshoot.

Share this article

Comments

Join the discussion. Got a question, found an issue, or want to share your experience?

Leave a Comment

Your email stays private. We just use it for replies.

Nothing to preview yet.

Use **bold**, *italic*, `code`, ```code blocks```, [link](url), > quote, - list