From Virtual Machine to Docker

Hey guys, I have a server in production running in the Digital Ocean server. Wanted to move it to a docker environment instead for scalability, now anyone who has done it?

In my understanding, we have to back up the database and server first? what would be the best method to do it?

Second, how do we export it to a docker container-based environment?

Anyone who has deployed erpnext in production to a docker environment? please share your method and experience, thanks.

Steps in brief

Backup:

  • site database
  • site files
  • site_config.json

Setup containerized environment: container called “erpnext-python” has the python environment with frappe and apps

Copy backed up files: in case of docker use docker cp, in case of kubernetes use kubectl cp, basically copy the backed up files into container/volume.

Restore: use “erpnext-python” container or start new container/job to execute bench commands from framework. Use the source_sql (for more bench new-site --help) to restore a site. Use tar/gzip to restore the backed up files. Make sure the new site_config.json has encryption_key restored from the backed up site_config.json.