How to backup (or move) an LXD container entirely to move to another machine

I have an LXD container locally for more than one month with a lot of configs, two disks (one for docker and one for root from 2 different storage pools /dev/sdb and /dev/sdc) and one proxy, and also 3 different profiles. I am looking for the simplest approach that helps me to backup (or move) this container entirely to another machine (with all disks, proxy, volumes, and …).
I found 3 approaches so far:

  • move command
  • export command
  • create an image and create a new container from it on the new machine

I personally like the move command more but my question is does this command move a container with all disks, proxy, volumes, and … ? if not how can I configure it, or what is the solution?

No, the move command only moves the instance itself and its config, but not any attached disks/volumes, nor any profiles, as these can be shared between multiple instances.

You would need to first copy the volumes to the target machine and ensure the profiles are also recreated on it.

1 Like

How about the export command?

The export command creates a backup file containing the instance’s disk, config and profiles. But not the custom volumes.

1 Like