Installing a new OS, but copying containers to another server first?

Hi,

I have two machines running Ubuntu. Each of these machines has a zpool and I can “incus move” a container between the two machines easily.

I want to remove Ubuntu and use Debian Testing instead.

If I move the containters from server B to server A, install Debian Testing and setup incus on server B, establish the trust relationships between B and A, would I then able to “incus move” back the containers I previously moved back to B, thus restoring the functionality of server B (then I would do the reverse, move containers from A to B, install Debian and Incus on A…etc…etc…).

Or, do I need to do a full backup of /var/lib/incus on server B and restore as-if it was the first time using Incus on server B (once Debian Testing had been installed).

Thank you.

-=david=-

Yes, that is a fair expectation.

Backups: sounds good
Being able to do a succesfull restore: way more better!

And actual advice:

No matter how good the question was, do not wait too long for an answer.

Going by the Incus docs (“How to move existing Incus instances between servers”): incus move <source_remote>:<instance> <target_remote>: moves an instance from one server to another, and a container has to be stopped first (live migration is covered on a separate page). The same page says incus copy makes a duplicate instead of moving it, and that you can adapt the configuration for the target server with flags like --config, --device, --storage or --profile. So your plan of moving the containers away, reinstalling, setting up trust again and moving them back looks like the normal use of incus move, and the docs don’t suggest you would need to restore /var/lib/incus for that.

The backup page describes backing up /var/lib/incus as a tarball and restoring it by deleting the directory and putting the backup back. It also says restoring a single instance can be easier and safer.

What I could not find in the docs is anything about moving between different Incus versions, and Ubuntu and Debian Testing may ship different ones. It would be worth checking incus version on both servers before you start, and trying it with one non-critical container first, using incus copy so the original stays where it is.

Hi,

Thanks everyone for the replies. I plan to use zabbly packages (which I do currently), so the versions should be okay.

I’ll let you all know how it goes :slight_smile: Fortune favours the brave!

-=david=-

I also recommend the https://github.com/zabbly/linux kernel for Debian and Ubuntu.

Hi All!

An update - TL;DR - it worked very well :slight_smile:

Server B - stopped all incus containers

Server B - moved container instances to Server A

Server A - started containers and confirmed all was honkydory

Server B - backed up the /var/lib/incus directory (zstd tarball) and moved off server B

Server B - zpool export raid

Server B - wiped OS and installed Debian Trixie and brought up-to-date with apt update

Server B - added zabby-incus-stable sources

Server B - added zfs-dkms, zfsutils-linux, incus and netplan.io packages

Server B - setup zfs and network configuration again (via netplan)

Server B - stopped incus.socket and incus.service

Server B - restored /var/lib/incus from the backed up tarball

Server B - re-started incus.socket and incus.service

Server B - incus config trust add serverA

Server A - incus config trust add serverB

Server A - moved containers back to Server B

Server B - started containers and confirmed all was working

Profit!

I hope that helps people in the future. I may have missed a step or two, but nothing that a nice read of the excellent documentation wouldn’t help :slight_smile:

Enjoy!

-=david=-