gb/prompts/c1.md

1.6 KiB

Migrate 10 LXC containers from source (root@82.29.59.188 - LXD/ZFS) to destination (administrator@63.141.255.9 - Incus/Btrfs) using streaming method. Instructions

  • Use Btrfs storage on destination (loop1 mounted at /mnt/btrfs)
  • Use streaming method: tar | zstd | ssh (no local storage)
  • Migrate one by one: stop → copy → create → start → delete
  • DO NOT delete containers before copying data Discoveries
  • Source: LXD with ZFS backend (default/containers/*), containers at /var/snap/lxd/common/lxd/storage-pools/default/containers/
  • Destination: Incus 6.23, Btrfs pool PROD-GBO on loop1, project PROD-GBO1
  • SSH: Works from source root → destination administrator
  • MISTAKE MADE: Deleted all Incus containers with cleanup command before data was properly inside them Accomplished
  • Created Btrfs storage pool PROD-GBO on destination
  • SSH access configured from source to destination
  • Containers were deleted during cleanup - they need to be recreated
  • Data is outside containers, needs to be copied INTO containers properly

Next steps

  1. Create empty Incus containers: incus create --empty --project PROD-GBO1 -s PROD-GBO
  2. Migrate from source: tar -C rootfs -cf - . | zstd | ssh dest 'sudo tar -I zstd -xf - -C /mnt/btrfs/containers/PROD-GBO1_/rootfs'
  3. Start containers: incus start
  4. Delete from source: lxc delete --force

Accomplished

  • Recreated Btrfs storage pool PROD-GBO on /mnt/btrfs
  • Created 10 empty Incus containers
  • Migrated all containers using tar | zstd | ssh
  • All 10 containers running on Btrfs
  • Used ~24GB of Btrfs storage