Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

Migrating docker and backup strategy

dopogiodopogio Member

I am currently running a few docker containers in my LAN and plan to migrate them to a VPS. I am worried about docker persistent data backups and what "recovery plan" I should do.

In my LAN - I have btrfs snapshots every hour of my docker data. On VPS I have to setup my own backup strategy - the docker container is TeslaMate which uses PostgreSQL.

One of the solutions I ran into that may help me set this up on a VPS seems to be Coolify https://coolify.io/docs/databases/backups

any other recommendations or suggestions? I also need to figure out a strategy for easy migration between VPS providers. I haven't found a solution for this....

Comments

  • darkmasterdarkmaster Member
    edited June 2025

    This can be done pretty easily.

    On your LAN (I assume you use docker-compose) you just need to export your volume.'tar -cvf <volume_name>.tar -C /var/lib/docker/volumes/<volume_name>/_data .
    Copy to your VPS.

    On your VPS:

    tar -cvf <volume_name>.tar -C /var/lib/docker/volumes/<volume_name>/_data .

    Docker Compose should take care of networks etc.

    Thanked by 1ehab
  • emghemgh Veteran, Megathread Squad

    Is it only the database data that you actually have to backup?

    If so, I’d probably setup a backup container that simply runs a db dump, compresses and uploads somewhere, triggered by a cron from within this same container

  • @darkmaster said:
    This can be done pretty easily.

    On your LAN (I assume you use docker-compose) you just need to export your volume.'tar -cvf <volume_name>.tar -C /var/lib/docker/volumes/<volume_name>/_data .
    Copy to your VPS.

    On your VPS:

    tar -cvf <volume_name>.tar -C /var/lib/docker/volumes/<volume_name>/_data .

    Docker Compose should take care of networks etc.

    Doesn't he need to stop the container first?

    Thanked by 1tentor
Sign In or Register to comment.