Frappe docker - Bakcup & Restore

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:

  1. Back up the database, public/private files, and any other necessary data.
  2. 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.

In fact, I would like to be prepared for the restoration of my primary ERP system. I am concerned about the uncleared instructions for restoring the system.

Although I have backup virtual machines on other servers and snapshots of NFS shares for the virtual machines, I believe that this is not sufficient.

Well, the official way to back up and restore is of course “bench backup” and “bench restore”, as I mentioned earlier. There is good official documentation for those. I was just sharing my own method for backing up with docker to be helpful. Based on what you are saying, docker may not be the best depoloyment method for you. You may be more comfortable with a more traditional virtual machine installation since you would be more familiar with the process of backing up and restoring in that context. Docker is certainly not the only way to deploy erpnext, it’s not the easiest way, and it’s not the best way for everybody.

I dedicated a significant amount of time, approximately two weeks, to the installation process, which has proven to be unsuccessful.
In contrast, I believe that ERP Next on Docker appears to be a more straightforward approach.