Downgrading from self-compiled to Debian Sid package

Hi, yesterday I had problems “downgrading” to official Debian lxd package and I solved with @tomp help (MANY Thanks!).
Now Debian package is installed correctly and daemon starts without errors.
I need to lxd init though (as stated by Debian installation).

I tried reusing my old setup by giving:

cat old_config.yaml | lxd init --preseed

but it rises error:

Error: Failed to create storage pool "default": Provided ZFS pool (or dataset) isn't empty, run "sudo zfs list homez/lxd" to see existing entries

using said command shows an empty filesystem occupying a lot of space, OTOH plain sudo zfs list shows sub-filesystems containing a lot of stuff, including all my containers:

mcon@cinderella:~$ sudo zfs list
NAME                                                                                        USED  AVAIL     REFER  MOUNTPOINT
homez                                                                                      2.55T  2.61T      406G  /homez
homez/etherpad                                                                              248M  2.61T      248M  /homez/etherpad
homez/lxd                                                                                  47.3G  2.61T      140K  none
homez/lxd/containers                                                                       41.5G  2.61T      140K  none
homez/lxd/containers/Spoke                                                                 6.93G  2.61T     7.31G  legacy
homez/lxd/containers/lucid                                                                 1.64G  2.61T     2.18G  legacy
homez/lxd/containers/lxdMosaic                                                             1.71G  2.61T     2.09G  legacy
homez/lxd/containers/nrf-builder                                                           4.31G  2.61T     4.71G  legacy
homez/lxd/containers/nrf-devel                                                             8.88G  2.61T     9.42G  legacy
homez/lxd/containers/redmine                                                                818M  2.61T     1.18G  legacy
homez/lxd/containers/seeme-builder                                                         4.41G  2.61T     4.92G  legacy
homez/lxd/containers/synology-builder                                                      11.3G  2.61T     11.7G  legacy
homez/lxd/containers/yocto-builder                                                         1.59G  2.61T     2.12G  legacy
homez/lxd/custom                                                                            140K  2.61T      140K  none
homez/lxd/deleted                                                                          4.40G  2.61T      140K  none
homez/lxd/deleted/containers                                                                140K  2.61T      140K  none
homez/lxd/deleted/custom                                                                    140K  2.61T      140K  none
homez/lxd/deleted/images                                                                   4.40G  2.61T      140K  none
homez/lxd/deleted/images/013beea918448a9fc4ae5419b132c718cac3ac58f86a024ac7506d9cdbd2e0fd   394M  2.61T      394M  legacy
homez/lxd/deleted/images/0db04e4645814398aca82cf3d99098dc3d317c60c9d4258c9808bd91fd67454a   570M  2.61T      570M  none
homez/lxd/deleted/images/4de6a2df17edbd2cd8a9b1dc619b4a5ac71f97755a747ca401b1c19c1870b04e   556M  2.61T      556M  none
homez/lxd/deleted/images/59b17fef4047dad12df4a71ed00e348816eec8260701fd78b90b57bede348267   562M  2.61T      562M  none
homez/lxd/deleted/images/78669956eba4767c3bd4ef99538d8eac6d179b14b0232d7c58abc4e7dbe48dc9   396M  2.61T      396M  legacy
homez/lxd/deleted/images/7dbe2f94667748fb2355e5e46b75f20a510277ef96aad33be743e9b75ec1d301   594M  2.61T      594M  legacy
homez/lxd/deleted/images/b89dd4e241ca07a7f8cdef6109aaa2a02458a19ec80baaa2e3e1974d74eb7852   396M  2.61T      396M  legacy
homez/lxd/deleted/images/d3402556d2856568217a4f6536f9005567d02957982022a6e917d9f6da77359f   470M  2.61T      470M  legacy
homez/lxd/deleted/images/f71fea6a1e44034abae9c63a0e625de321e144c54bf478d8aefa3035465205e5   566M  2.61T      566M  none
homez/lxd/deleted/virtual-machines                                                          140K  2.61T      140K  none
homez/lxd/images                                                                           1.41G  2.61T      140K  none
homez/lxd/images/9d10e8b9e175cdc5d8a331a439963f002c6855d35ce52b27d3cdb9c68d76c4c4           396M  2.61T      396M  legacy
homez/lxd/images/d75e77c8452487d390c8ee86629f147fee110d83fb79b053bc9ad107fce7aa1c           574M  2.61T      574M  none
homez/lxd/images/f4451070c9990ee862b9fe6bac4c06f62c7cdc387783ce8724dc6309989d0b42           469M  2.61T      469M  legacy
homez/lxd/virtual-machines                                                                  140K  2.61T      140K  none
homez/mauro                                                                                 140K  2.61T      140K  /home/mauro
homez/mcon                                                                                 2.10T  2.61T     2.10T  /home/mcon
mcon@cinderella:~$ sudo mount -o zfsutil -t zfs homez/lxd /mnt
mcon@cinderella:~$ ls -la /mnt
total 5
drwxr-xr-x  2 root root    2 Dec 25  2021 .
drwxr-xr-x 20 root root 4096 May 13 23:40 ..
mcon@cinderella:~$ sudo umount /mnt

I could easily change the pool name and restart from scratch, but is there a way to recover my old containers?
This isn’t really vital because they are mostly used for trials and compilations in specific environments (just in one case I’m unsure if I saved all configs, but I can redo), but I would like to understand and learn, if possible.

I understand I should have done a lxc export before killing my old installation, but I didn’t (my bad, of course); is there another way to recover?

Thanks in advance
Mauro

I created https://github.com/lxc/lxd/pull/11782 to fix the suggested zfs list command.

The lxd recover command should be able to help you with that.

But be aware of this issue:

Sorry being dense, but I’m still on the steep part of the learning curve:

If I understand correctly I should:

  • run lxd init reinitializing everything fresh (should I create a new zfs pool or leave default in /var/…? the latter would be too small for actual use)
  • run lxd recover giving my old homez/lxd pool
    it is unclear if:
    • I have to use plain homez/lxd
    • give all roots of my containers (homez/lxd/containers/Spoke, homez/lxd/containers/lucid, …)
    • if they are copied in the “main” storage (in this case they wouldn’t fit in /var)
      or if a link is done somehow.
    • in case they are copied if and how I should delete the old containers.
  • there is a hint I should issue another lxd init after recovery, but I understand neither why nor how.

Note: my current installation reports version 5.0.2

Thanks for your patience.