Issue – How to backup, transfer and restore from one server to other



First Get back of site:

Bench --site site_name backup –with-files

Backup will be available here -Frappe-bench/sites/site_name/private/backup

Transfer files:

Login to new server where we want to restore.

Then do following commands to get files. 

scp root@142.93.211.177:/home/erpadmin/frappe-bench/sites/kcsystems.erpdata.in/private/backups/2022* /home/erpadmin/kcsystems

Here :/home/erpadmin/frappe-bench/sites/kcsystems.erpdata.in/private/backups/2022* is file path from old server where files are present

New file path - /home/erpadmin/kcsystems

This will prompt the root password then it will copy file/s as per given details.



Restore: Go to bench folder and execute following commands:

sudo bench --site site_name.erpdata.in --force restore /home/erpadmin/kcsystems/20220916_213705-kcsystems_erpdata_in-database.sql.gz --with-public-files /home/erpadmin/kcsystems/20220916_213705-kcsystems_erpdata_in-files.tar --with-private-files /home/erpadmin/kcsystems/20220916_213705-kcsystems_erpdata_in-private-files.tar

DATABASE: /home/erpadmin/kcsystems/20220916_213705-kcsystems_erpdata_in-database.sql.gz 

Public Files: --with-public-files /home/erpadmin/kcsystems/20220916_213705-kcsystems_erpdata_in-files.tar

Private Files: --with-private-files /home/erpadmin/kcsystems/20220916_213705-kcsystems_erpdata_in-private-files.tar



Check running jobs:

ps -ef | grep Process_Name





Database backup restore and Transfer

Database Backup for ERPNExt



mysqldump -u root -pyWNRMuZwz18u a1f5d7d0602a8b47 > /home/erpadmin/erp.roboconcnc.com/sqlfile.sql



_a1f5d7d0602a8b47



/home/erpadmin/erp.roboconcnc.com/sql_file.sql




ERP Server - 142.93.211.177 From Server



WestValley Server - 104.248.136.211 To Server



Copy from REceiver Server -

scp opengenus@10.103.45.19:/home/opengenus/iq/information.txt .

scp root@142.93.211.177:/home/erp/frappe/sites/sitename.local/priavte/backup/file-database.sql.gz 

/home-destinationserver/erp/frappe



sudo bench --force --site veerfitness.in restore /path.to.your.sql.file

--with-public-files /path.to.public.files 

--with-private-files /path.to.private files