Skip to content

Backup and Restore

scubamuc edited this page May 7, 2024 · 29 revisions

Snap snapshot backup & restore

Snap snapshot is a snap utility to create and manage snap snapshots. It may be used for random snapshots or automated as scripted cronjob and has the added convenience of easy snap migration.

Snap snapshot documentation
Example rotating backup script

Backup Nextcloud snap with snap snapshot

Snap snapshot will backup the entire Nextcloud snap including configuration, apps, certificates, database and data into a compressed file (*.zip) located in /var/lib/snapd/snapshots. See what's inside a snapshot.

See documentation in man snap and snap snapshot documentation

Procedure

  • stop Nextcloud snap sudo snap stop nextcloud
  • save Nextcloud snap sudo snap save nextcloud
  • start Nextcloud snap sudo snap start nextcloud
  • copy/move snapshot (*.zip) in /var/lib/snapd/snapshots to wherever

Note: stop and start is optional, but recommended

Restore or migrate Nextcloud snap with snap restore

  • When migrating be sure that Nextcloud snap is installed on the target device.
  • Snap restore restores the entire Nextcloud snap including configuration, apps, certificates, database and data.
  • Note: snap restore is not incremental and will completely replace existing installation.

See documentation in man snap and snap snapshot documentation

Procedure

  • copy/move snapshot (*.zip) to /var/lib/snapd/snapshots
  • discover snapshot-id using snap saved
  • restore snapshot sudo snap restore <snapshot-id>

Deleting snap snapshots

See documentation in man snap and snap snapshot documentation

Procedure

  • discover snapshot-id using snap saved
  • delete snapshot sudo snap forget <snapshot-id>
Clone this wiki locally