LXD Projects - moving containers between projects

I was wondering how you move containers between projects?
Do you have change the config file of the project for this?

You can’t do that directly, at least not at this time.

The only way I can think of to do this right now would be to use the migration API which is normally used for remote migration.

Effectively, add your local server twice in your client, under two different remote names.
Then switch to the two relevant projects and move the container as if you were moving it between two different servers, that “should” work.

OK thanks will give it a go!


Just to say I can’t seem to copy within a project either, I’m trying to clone a container but its saying Error: no such file or directory


root@server01:/home/jon# lxc copy desk1 desk2
Error: no such file or directory

I think this is a known issue that @stgraber just fixed in https://github.com/lxc/lxd/pull/5276.

I’m not entirely sure if there’s anything left to be done, e.g. for other storage backends.

1 Like

Some of those fixes should now be available in the snap, more will be coming soon.

I’ve also added support for copying and moving containers between projects, this will be in LXD 3.8.