Backing up and migrating OpenBalena

Great to see such an active forum around OpenBalena here, I really appreciate the availability of the community.

Are there any recommended protocols for backing up OpenBalena server side and migrating it to another server (i.e., new IP addresses), with the exception of course of just mirroring the whole OS?

Hey @Maggie, first of all welcome to the balena community yourself : )

In this thread there are couple of suggestions on what to backup:

Let us know of any further questions.

Cheers…

Hi,

That is helpful, gives me a head start, thanks.

Here is how I would see it then so far:

Backup:

  1. Backing up the ~/open-balena dir
  2. Backing up the Docker volumes on the server

Server move:

  1. Restore the ~/open-balena dir and docker volumes to new server
  2. './script/compose pull` to pull down the latest service images (based on How to update openBalena server)
  3. Run ‘./script/compose up -d’

Here are a few questions that spring to mind that may crop up as issues.

  1. Are the backed up volumes named volumes, that will link back to the new setup or are they allowed to be named by Docker, which could prevent issues moving servers or restoring from a backup?
  2. Is there anything that happens in the quickstart script that creates entries that aren’t portable? If so, what is the impact of running this again? One thing that springs to mind is the ACME certificate service, and the various .crt, are they portable? As it is a server move or restore, IP addresses will be different of the host.

Hey,

  1. Are the backed up volumes named volumes, that will link back to the new setup or are they allowed to be named by Docker, which could prevent issues moving servers or restoring from a backup?

They are named volumes, as defined in the docker-compose file. You could need to backup/restore the content of these volumes.

  1. Is there anything that happens in the quickstart script that creates entries that aren’t portable? If so, what is the impact of running this again? One thing that springs to mind is the ACME certificate service, and the various .crt, are they portable? As it is a server move or restore, IP addresses will be different of the host.

The certs themselves are stored in the named volume for that service, so see point 1) above. Otherwise the content of your ~/open-balena (from your prev message) and the content of the volumes should be enough. IP addresses in this context are irrelevant to the certs, they are a DNS concern.

Thanks,

Noted on the Docker volumes, I will either backup the contents of the volumes (rather than the volume files themselves) and inject the data back in, or might also try taking the whole /var/lib/docker folder and restoring Docker from that too.

At some point in the near future I will be needing to do this (with the dev env, not production fortunately), so will report back on what works/doesn’t work.

awesome, good luck and thanks for the update