mjr2015
(mjr2015)
January 22, 2019, 7:21am
1
was playing around with snapshots and accidentally deleted a container instead of a snapshot.
So I was thinking I’d like to back up my containers to either an off disk or in my cloud drive.
just to be sure I have everything correct -
lxc publish CONTAINER_NAME/SNAPSHOT_NAME --alias DATE_CONTAINER_BACKUP
lxc image export DATE_CONTAINER_BACKUP /backupdir/
lxc image delete DATE_CONTAINER_BACKUP
lxc image import TARBALL-NAME --alias DATE_CONTAINER_BACKUP
lxc launch DATE_CONTAINER_BACKUP RESTORED_CONTAINER
lxc image delete DATE_CONTAINER_BACKUP
Are there any additional considerations I should make if I choose to back this up to the cloud drive like amazon or google?
1 Like
dellrusk
(Dell Rusk)
January 23, 2019, 11:42am
2
Hi,
If you are using LXD > 3.1 you can create a tarball directly from a container with the command lxc export
If you backup your containers to a cloud drive you may want to encrypt everything first.
mjr2015
(mjr2015)
January 24, 2019, 10:33am
3
can you run the export while the box is running? or do you need to shut it off
dellrusk
(Dell Rusk)
January 24, 2019, 11:20am
4
You can export while the container is running but I don’t know what kind of consistency you’ll get. I guess it depends on the underlying storage engine.
jjohn
(John)
December 24, 2019, 5:40pm
7
I don’t have enough storage space for an “export”.
I created an “image” via “publish” (presumably compressed by the parameter I used, but I don’t know how to verify).
Does the image need to be exported? Or can I copy the export file to another offsite location?
How do I directly export to somewhere in the cloud (Google Drive, Amazon S3, Blackblaze)?
Or is there a way to do the backup (export) that doesn’t consume as much storage space?
stgraber
(Stéphane Graber)
December 25, 2019, 10:23pm
8
You can configure where the backup/image files get stored using the daemon.backups_volume
and daemon.images_volume
config options, letting you use an empty custom volume on one of your storage pools rather than system space.