Upgrade lxd 2.17 to 4.17

Hi ,

I am running lxd 2.17 (debian package ) on debian 9 (stretch) , As this is very old version I’m planning to upgrade to 4.17 (compiled from source ) , what are the steps to perform this operation without any dataloss ?
could any one can help me please ?

any help ? @stgraber

The general process is as follows:

sudo apt install snapd
sudo snap install lxd
sudo lxd.migrate -yes

Make sure you have recent backups before proceeding as a sensible measure though in case you need to revert.

thank you for the help . @tomp
for backup i can’t see the database folder on the path /var/lib/lxd
where should I find this database file in lxd 2.17 ?

root@system-2:~# ls /var/lib/lxd/
containers  devlxd  images  lxd.db.bkp  security    server.key  snapshots      unix.socket
devices     disks   lxd.db  networks    server.crt  shmounts    storage-pools

Moving from 2.17 to 4.17 should work just fine, LXD will update the database from sqlite3 to dqlite on update.

As you’re planning on building it from source, paths will effectively be the same (using /var/lib/lxd in both cases) so it should just work.