Restoring a backup without exporting tarball

I am creating a backup by sending a post request /instances/c1/backups, then to restore the backup i am exporting the tarball, downloading it , then uploading again. Is there a way to do this on the server by just passing the backup name?

Thanks.

There isn’t, for that, snapshots are usually a better candidate.
Backups are meant for cases where the server isn’t functional anymore or where you need to restore on a different server, so can’t rely on the much cheaper snapshots.

Have you noticed any reliability issues with snapshots vs backups, and does the instance need to be stopped to ensure better reliability etc? Thanks.

Snapshots for me have been very reliable, are cheap to create and LXD even supports automatically generating them on a schedule (as well as deleting old ones).

The only case where they should be avoided is with a dir storage backend as taking a snapshot on that backend requires the container be completely frozen while its entire filesystem is duplicated…

Backups actually rely on snapshots already. The instance itself is snapshotted to avoid changes while the backup tarball is generated. So backups are in essence a tarball of one or more snapshots. They’re convenient when you need an exportable and sharable artifact but if keeping things on one server, snapshots are much much lighter weight (both in disk space and in resources used to create them), are automatable and can be restored or used to create new instances in seconds rather than minutes.

1 Like