Sanity-check: direct copy/paste of rootfs-folder from LXD?

We are migrating a server to new hardware. In this process we would like to switch from LXD (on old server/hardware) to Incus (on new server/hardware). We manage this by copy/pasting the “rootfs” folder from LXD into a new container on Incus.

How bad an idea is this method? Seemingly everything works for us? Are we just lucky?

Method:

  1. create a new instance in Incus on new machine:
    incus init images:DISTRO/version NEW-INCUS-INSTANCE
  2. copy rootfs folder from LXD-backup to rootfs in new instance on new machine:
    cp -r OLD-LXD-INSTANCE/rootfs new-server/some/incus/storage/location/NEW-INCUS-INSTANCE/

This seems to work flawless on the instances we are testing.

Our only concern is whether or not we will run into problems with config-files inside the containers pointing to LXD instead of incus? As far as we can see, things like /dev/.lxd-mounts and /dev/lxd gets automatically renamed to /dev/.incus-mounts and /dev/incus when starting the instance.

If you’re lucky enough that there’s nothing weird going on with idmaps and that you’re using a storage pool on dir or btrfs which is directly accessible, then that should be fine.

But the normal recommendation would be to use lxc export --export-version=1 on the source and then incus import on the target as that would use supported APIs on both ends.