Backup and restore multitenant bench

Hi Erpnext community,

My configuration :

  1. OS : ubuntu-18.04
  2. Infrastructure : VM on Google Cloud
  3. Installation type : easy install script
  4. Environment : production
  5. Multitenant : Yes (domain based).
  6. Version : 12.8

My questions :

  1. How to backup both database and file uploads of all the my sites ?
  2. How to restore both database and file uploads of all my sites ? (if possible with few commands).

My attempts :

  1. For backup ==> bench backup-all-sites
    I tried the option --with-files as specified in the wiki but it doesn’t work.
    At the end, all the sites databases have in their private folder a folder called backups. I created manually a zip of the entire sites folder that I have stored on Google Cloud Storage.
  2. For restore, I have created an empty bench installation. I downloaded the zip file that I have previously uploaded in Google Cloud Storage and extract it to the sites folder.
    I run : bench --site site1.mydomain.com --force restore site1.mydomain.com/private/backups/20200516_071305-site1_mydomain_com-database.sql --mariadb-root-password myDBPassword
    The command seems to work, but I am getting an Internat Server Error while trying to access to the website.
    By the way, I would like to do the restore for all the site and not only one.

Is there a way for backuping and restoring easily a multitenant bench installation ?

Thank you for your help.

1 Like

Check with your VPS Service Provider. They may have image or snapshot options - like AWS and Digital Ocean enable this.

This option may not work well for regular backup and restore, but if you are, say trying to upgrade a server and want to keep an image or snapshot for restoration purposes should something go wrong with the updates, this works like a charm.

Other wise, for regular daily Backups (not sure why you’d need daily restoring which is why added the first two paragraphs) try pushing the backups to Dropbox or AWS S3.

Restoring is a fairly manual process and has to be done at each site. You first have to establish the same Frappe & ERPNext branch and versions as the backup, and then restore.

Hope this helps.

Thanks

Jay

1 Like