Migrating from normal lxd to snap version lxd without data loss


(A run) #1

Hi ,

I am running lxd in debian 9 which is self complied (3.8) , Since I am facing so many issues with this I need to migrate to snap version without any loss of data . could anyone help me on this ?


Since you use lxd 3.8, you are in luck, you should be able to use lxc export.
That’s absolutely the best way to avoid data loss for any reason.
Since migration deletes containers from source before migration is finished and all can be tested, backup is absolutely mandatory.

Once you have safely all your containers in tar.gz files (a good backup is a tested backup), you can try to install snap lxd and use lxd.migrate.

Before attempting lxd.migrate, make sure that your paths are set right so that you use the snap lxd and not your compiled version. Since you are using a custom setup; that may need some manual fixing.
At the migration end, lxc 3.0 libraries are normally cleaned. Again, this may work or not for you.

If migration crashes and burn (hopefully not), it could be the best (only) way to delete everything, install again snap lxd from scratch, and import containers from tar.gz backups.

If you have scripts used in your lxd management, be aware that these scripts may turn out to be no more usable by lxd since snap lxd obeys general snap restrictions (with apparmor, so the fact that snap lxd runs under root don’t matter). You can have to move these scripts in a place where lxd can run them.