ERPNext: Download and restore backup

Downloading Backups

  • Download backup files
cd /tmp
wget [FILES BACKUP FILE URL] (this URL is to be made based on what is shown on the DATABASE BACKUP FILE URL)
  • Unzip files
gunzip [DATABASE BACKUP FILE.sql.gz]
tar xvf [FILES BACKUP.tar]

Restoring Backups

  • Go to the frappe-bench folder
  • Run the following bench commands (to restore db and run latest)
  • Note: You can also restore using mysql
  • Note: If restoring from another machine, the sitename has to exist before you can restore the sql and files
bench --site [sitename] --force restore /path/to/SQLFILE
bench --site [sitename] migrate
  • Restore Files
cp /tmp/[FILES BACKUP EXTRACTED FOLDER/---/public/files/*] [BENCH]/sites/[SITENAME]/public/files/