Move bench site to different server

On old server

bench –site [sitename] backup –with-files

Download files from ./sites/[sitename]/private/backups/

Also make copy of site_config.json of the old server site to retrieve the encryption key

On new server

Create new site and install erpnext

sudo mkdir /tmp/old_server_files
sudo chown -R ubuntu:ubuntu /tmp/old_server_files

Upload files using SFTP (Filezilla)

sudo chown -R root:root /tmp/old_server_files

sudo gunzip [/path/to/database/file.sql]
sudo bench –site [new.site.name] –force restore [/path/to/database/file.sql] –with-private-files [/path/to/private/files.tar] –with-public-files [/path/to/public/files.tar]

or

sudo bench –force –site your.site.name restore /path/to/backup.sql.gz

or

bench --site [sitename] --force restore [path to database backup file] --with-private-files [relative-path-to-private-files-backup-file] --with-public-files [relative-path-to-public-files-backup-file]

Sources –
https://discuss.erpnext.com/t/backup-restore/5675/4 (backup all sites)
https://github.com/frappe/erpnext/wiki/Restoring-From-ERPNext-Backup

Newsletter Updates

Enter your email address below to subscribe to my newsletter

Leave a Reply

Your email address will not be published. Required fields are marked *