Jimbo
June 8, 2020, 5:24pm
1
I have exported a container using the LXC API endpoint /instances/name/backups/export, however when i try to import using lxc image import a1-1591635854.tar.gz --alias a1-import
I get the following error
Error: Metadata tarball is missing metadata.yaml
What am I missing?
tomp
(Thomas Parrott)
June 8, 2020, 6:03pm
2
Do you get the same issue if you use the lxc export CLI?
tomp
(Thomas Parrott)
June 8, 2020, 6:04pm
3
Also what versions of lxd are available?
Jimbo
June 8, 2020, 6:13pm
4
No I don’t get the same issue with the CLI, I am able to import fine.
Jimbo
June 8, 2020, 6:14pm
6
I guess I am using the API to export a backup and the CLI to export a container as an image, which are two different things.
Jimbo
June 8, 2020, 6:16pm
7
Is there a specific command for importing backups generated using the API backup export endpoint?
tomp
(Thomas Parrott)
June 9, 2020, 7:55am
8
The commands to use are:
lxc export <container> backupfile.tar.gz
lxc import backupfile.tar.gz
Jimbo
June 9, 2020, 9:05am
9
Thanks, it worked perfectly - I totally missed the obvious, i was following an old discussion on backing up and restoring, when there was no need too. doh!
hafijaa
(hafijaa)
February 28, 2021, 8:20am
10
Is there any script to create it automatically backup backupfile.tar.gz file for the listed container in every night? Thnx
Jimbo
February 28, 2021, 9:54am
11
@hafijaa This article has some bash goodness
1 Like