Error migrating container from LXD to Incus

I’m trying to migrate an instance, via exporting, from LXD 5.0.2 to IncusOS.

environment:
  hostname: 0a6b8533-8f41-6f87-2ad1-48210b51cf30
  machine_id: c9423921293a40518d4a2ed2c4340fd5
  os_name: IncusOS
  os_version: '202608290126'
  os_version_alternate: '202608072311'
  os_version_next: '202608290126'
  system_is_ready: true
  uptime: 1525991

Exporting works correctly but when I try to import on the other side I’m having an error about backup.yaml, which happens if i export with or without --instance-only:

lxc export kingston-nuc:ca-multisite-test1 --instance-only
incus import ca-multisite-test1.tar.gz 
URL: https://.../dex/device?user_code=[code]
Code: [code]

Error: Create instance from backup: Error updating backup file: open /var/lib/incus/storage-pools/local/containers/ca-multisite-test1/backup.yaml: no such file or directory

I can only find this reported twice in the forum, and both related to VMs not containers. I can’t find any related results searching the chats.

Has anyone else encountered this and can suggest a work around?

Hey @kgoetz

I exported a container from incus, the backup.yaml required is a incus config show <container> yaml

In my case:

container:
  architecture: x86_64
  config:
    image.architecture: amd64
    image.description: Debian trixie amd64 (20260912_05:24)
    image.os: Debian
    image.release: trixie
    image.serial: '20260912_05:24'
    image.type: squashfs
    image.variant: default
    security.nesting: "true"
    security.privileged: "true"
    volatile.base_image: 50661fc47920a6139e48c2a85386d62a2117d6a4386f649b07937c6e299ef9b1
    volatile.cloud-init.instance-id: 52a998fa-f017-4340-a166-c71566d02045
    volatile.eth0.host_name: vethbdcc85fe
    volatile.eth0.hwaddr: 10:66:6a:c7:d7:66
    volatile.idmap.base: "0"
    volatile.idmap.current: '[]'
    volatile.idmap.next: '[]'
    volatile.last_state.idmap: '[]'
    volatile.last_state.power: RUNNING
    volatile.uuid: e9f8a640-be87-490c-bc83-42c302a8b56a
    volatile.uuid.generation: e9f8a640-be87-490c-bc83-42c302a8b56a
  devices: {}
  ephemeral: false
  profiles:
    - default
  stateful: false
  description: ""
  created_at: 2026-09-13T06:24:16.859645517Z
  expanded_config:
    image.architecture: amd64
    image.description: Debian trixie amd64 (20260912_05:24)
    image.os: Debian
    image.release: trixie
    image.serial: '20260912_05:24'
    image.type: squashfs
    image.variant: default
    security.nesting: "true"
    security.privileged: "true"
    volatile.base_image: 50661fc47920a6139e48c2a85386d62a2117d6a4386f649b07937c6e299ef9b1
    volatile.cloud-init.instance-id: 52a998fa-f017-4340-a166-c71566d02045
    volatile.eth0.host_name: vethbdcc85fe
    volatile.eth0.hwaddr: 10:66:6a:c7:d7:66
    volatile.idmap.base: "0"
    volatile.idmap.current: '[]'
    volatile.idmap.next: '[]'
    volatile.last_state.idmap: '[]'
    volatile.last_state.power: RUNNING
    volatile.uuid: e9f8a640-be87-490c-bc83-42c302a8b56a
    volatile.uuid.generation: e9f8a640-be87-490c-bc83-42c302a8b56a
  expanded_devices:
    eth0:
      name: eth0
      network: incusbr0
      type: nic
    root:
      path: /
      pool: default
      type: disk
  name: issue201
  status: Running
  status_code: 103
  last_used_at: 2026-09-14T07:04:38.946151328Z
  location: none
  type: container
  project: default
pool:
  config:
    source: /var/lib/incus/storage-pools/default
    volatile.initial_source: /var/lib/incus/storage-pools/default
  description: ""
  name: default
  driver: btrfs
  used_by: []
  status: Created
  locations:
    - none
profiles:
  - config: {}
    description: Default Incus profile
    devices:
      eth0:
        name: eth0
        network: incusbr0
        type: nic
      root:
        path: /
        pool: default
        type: disk
    name: default
    used_by: []
    project: default
volume:
  config: {}
  description: ""
  name: issue201
  type: container
  used_by: []
  location: none
  content_type: filesystem
  project: default
  created_at: 2026-09-13T06:24:16.859645517Z

The exact path in the archive is backup/container/backup.yaml you might be able to recreate that one? But before fidling around with that you can use “lxd-to-incus” ?

You’ll need --export-version=1

My LXC client doesn’t have that parameter, do you know which version it was added in? I can try and upgrade my client to that.

kgoetz@L23001:~$ lxc --version
5.0.2
kgoetz@L23001:~$ lxc export ca-multisite-test1 --instance-only --export-version=1
Error: unknown flag: --export-version

I thought lxc-to-incus was only for full system migrations but i see that isn’t necessarily the case.

Thanks for the suggestion, I will try it and let you know what I find!

Ah, so your version predates the version 2 export format, so your export should be fine.
I’m not sure why there’s an import failure but I’m looking into that now, hopefully it’s something we can sort out on the Incus side given that we can’t exactly go change the export logic in LXD.

For the record, I couldn’t get lxc-to-incus working either

root@L23001:~# time lxc-to-incus --all --debug

real	0m0.080s
user	0m0.068s
sys	0m0.013s
root@L23001:~# 

running strace didn’t show an obvious failure cause so in this case i’ll probably rebuild the affected system instead of continuing to try and migrate.

In this case simplest maybe a rsync. But hmm you’r trying “lxc-to-incus” isn’t it “lxd-to-incus” from “incus-extra” ?

lxc-to-incus is for LXC containers, not LXD containers.
That is, it moves containers that lxc-ls lists, not those that lxc list shows.

(Yes, the fact that LXD decided to use lxc as the command for the LXD client is utterly confusing and makes this whole thing a mess… Thankfully we don’t have this confusion anymore with Incus)

The zabbly incus-extra package (7.5.1 and 7.4) doesn’t include an lxd-to-incus which is why i assumed there was just the one lxc-to-incus for all occasions.

root@L23001:~# dpkg -L incus-extra |grep lxd
root@L23001:~# apt policy incus-extra 
incus-extra:
  Installed: 1:7.5.1-debian13-202609250203
  Candidate: 1:7.5.1-debian13-202609250203
  Version table:
 *** 1:7.5.1-debian13-202609250203 500
        500 https://pkgs.zabbly.com/incus/stable trixie/main amd64 Packages
        100 /var/lib/dpkg/status
     1:7.4-debian13-202609131505 500
        500 https://pkgs.zabbly.com/incus/stable trixie/main amd64 Packages
...

Now you mention it I’ve checked Debians packages and see that does include the lxd-to-incus command

Its possible the command has fallen out of the zabbly builds.

Incus 7.0 LTS (lts-7.0 Zabbly packages) is the last version to ship with lxd-to-incus.