No migration way from lxd to incus working

Hello,

ich want to migrate from LXD to incus. I have two machines (plsrv1/plsrv2) with lxd running. Both have had lxd 4.0.10 running on ubuntu 22.04. My desktop pc is on ubuntu 24.04 and has also lxc-client 4.0.10.

(One Server contains backups from the first one, I copy the containers from time to time from one to the other lxd instance.)

lxc copy server1:xxx server2:xxx

I setup a third machine (plsrv3) with debian 12 and incus 6.0.1 on server und incus-client 6.0.0 on my desktop machine.

First I wouldn’t migrate the whole instance, because of too many containers. My prefered way is to migrate one by one.

I tried this:

First I tried to export one container with lxc export and then incus import. The export seems to work and the input also, but if 100% was imported, i get this message.

lxc export plsrv2:caldav caldav.tar.gz --instance-only
incus import caldav.tar.gz plsrv3:

==> Error
Importing instance: 100% (117.75MB/s)Error: Post "https://192.168.20.110:8443/1.0/instances": EOF

Then I thought the lxd-versions are very old, so i upgraded one server (plsrv2) to lxd 5.20 (the client stays on 4.0.10, becaus I don’t know if it was backwards compatible. I want to access my main server (plsrv1) furthermore.

After Upgrading to 5.20 on plsrv2, I exported the container again, but then I get an error already while exporting.

lxc export plsrv2:caldav caldav.tar.gz --instance-only

==> Error
Error: Fetch instance backup file: Load backup from database: Instance backup not found

3
Then I thought i could happend cause of the 4.0.10 client and the 5.20 server. Then I exported the container directly on the server-machine, because there are client and server version the same (5.20).

This works and I transferd the export to my desktop machine. From there I tried to import to incus:

incus import caldav.tar.gz plsrv3:caldav

and get this error

Error: Failed importing backup: Failed creating instance record: Invalid instance name: Name can only contain alphanumeric and hyphen characters

Then i saw, there were two tools for migrating. lxd-to-incus and lxc-to-incus, where the second seems to could migrate one container only. I decided to test it on my plsrv2 with lxd 5.20 installed.

I installed incus on this machine and the incus-extras. Like it’s written in the docs, i don’t run an incus init first. (or do I have to run an incus init, if I want the lxc-to-incus tool? For the lxd-to-incus tool I shouldn’t like its written in the docs). Then I run

lxc-to-incus --containers caldav

I immediatly get the prompt again and nothing happends. I tried to run lxd-to-incus, then I get this message:

=> Looking for source server
==> Detected: snap package
=> Looking for target server
==> Detected: systemd
=> Connecting to source server
=> Connecting to the target server
=> Checking server versions
==> Source version: 5.20
==> Target version: 6.5
=> Validating version compatibility
=> Checking that the source server isn't empty
=> Checking that the target server is empty
=> Validating source server configuration
Error: The source path "/var/snap/lxd/common/lxd" is a symlink. Incus does not support its daemon directory being a symlink, please switch to a bind-mount.
  1. I saw, that i could access lxd with incus-client. I tought, if I could connect lxd to incus client, I could copy with incus client from lxd-instance to incus-instance. So I tried to connect the incus client on my desktop machine to my lxd server (plsrv1).

on my desktop-pc with incus client installed I executed:

incus remote add plsrv1 192.168.20.106

This command want a trust token, which I tried to create. I use my client ip as client name.

on my plsrv1 with lxd 5.20 installed i executed:

lxc config trust add

Then I use this command on my client

incus remote add plsrv1 192.168.xx.xx

Then I take the printed token from the “trust add” command und paste it at the prompt from the client as “Trust token for plsrv1”

then I get an “Error: not authorized”

I have no idea to go on:

  • Which would be the prefered way to migrate one by one?
  • Is it possible to connect incus client to a lxd server and run a incus copy lxd-instance incus-instance?
  • Could I use “incus remote add” without security on the lxd-server instance?
  • Should the way lxd:export / incus:import basically work?

Have found the error in my command, have to write:
incus import <incus-remote> caldav.tar.gt caldav

So, my solution:

1. Upgrade lxd from 4.10 to 5.20 
2. lxc export <lxd-instance>:<containername> <filename> --instance-only
3. incus import <incus-remote> <filename> <containername>
1 Like