Hi everyone,
I’m using Frappe Docker from the official GitHub repository (GitHub - frappe/frappe_docker: Docker images for production and development setups of the Frappe framework and ERPNext) and I’d like to perform a full backup of my ERPNext instance (including the database and files) and then restore it on a different server, also running Frappe Docker.
Could someone please share a detailed, step-by-step guide on how to:
- Back up the database, public/private files, and any other necessary data.
- Restore this backup on a new ERPNext instance using Frappe Docker.
I’d like to follow best practices and ensure everything is compatible with the official Docker setup. If there are any differences depending on the Frappe/ERPNext version, please include that as well.
Thanks in advance for your help!
Frappe has a built-in “bench backup” and “bench restore” function.
But in a docker environment (specifically using docker compose), I have found it helpful to work with the backup files to and from the docker host. I created a post that describes that process here.
If you are wanting to move everything to a new server, there would be some additional steps beyond just a simple backup and restore.
Specifically, on the new instance before you restore, you will need to create the new site with “bench new-site” and make a note of the database name in the new instance since you will need that for the db restore.
Also, you will need to make a note of the encryption key on the old instance and manually add that to your new site_config.json or via the “bench set-config” command.
Additionally, it wouldn’t hurt to run “bench migrate” when you are done, especially if you are restoring to a newer version than the backup is from. If there are new apps in the newer instance, you will need to install those to the site with “bench install-app”.
That’s all I have had to deal with, but your specific situation may entail some other variables as well.