Restored Container From Non Native Backup, How to Copy Container Config from Source?

LXD 5.8 via snap, all CTs use the dir driver

i need to exclude certain dirs during copy, otherwise the CTs are too big and take too long to transfer. So I used a non native backup solution (proxmox backup client) to copy the containers files (/var/snap/lxd/common/lxd/storage-pools/default/containers/my-ct) from the source machine and restored it into the target machine.

Where is my-ct’s config file on the source host so that I may re-create it on the target? Or maybe I should create a dummy config and overwrite the config?

LXD doesn’t use config files, everything is in its database.

My suggestion would be to attach custom volumes for the directories you don’t want included in the normal lxc export backup file. Then you can use lxc import to recreate it on the target server.

1 Like

This is unofficial way, but in this case you can use lxd recover command on backups’ target directory.

You can look at the backup.yaml file, which stores the necessary configuration data.

IMHO this is a useful (alternative) solution when you already have a backup or manage a large volume of data.