To move/migrate an LXD virtual machine to another host, follow these steps:
- On the source host, stop the LXD container:
lxc stop <container name>
- Export the container:
lxc export <container name> <file name>.tar.gz
- Copy the exported tar archive to the target host:
scp <file name>.tar.gz <user>@<target host IP address>:~/
- On the target host, import the container:
lxc import <file name>.tar.gz --rename <new container name>
- Start the imported container:
lxc start <new container name>
- Verify that the container is running correctly on the target host.
Note: Make sure that the LXD version on the target host is the same or higher than the one on the source host.
(Ambien)