Restore a single file

NethServer Version: NS8
Module: samba

Is it possible to restore a single file from a samba share using the backup tool?

Sincerely

Currently not i am afraid.

But if you have access to the backup repository and restic backup utillity, you can restore manually the things you need.
You also need the password used for encryption of course. This can be found in the repository details in the backup section.

image

1 Like

May you show me the way to perform it?

Yes, certainly.

The process depends on your setup however. I have only used “Local Storage” for backup so far. (Placing mirrors of this a number of places around of course.)

Make sure you have the restic backup applications installed.
Get your backup repository encryption password.

If your followed the instructions in the manual for “Local Storage” in the backup section like i have. (Backup and restore — NS8 documentation)
Your backup repository will be located at /var/lib/containers/storage/volumes/backup00/_data .

Go to this location.
cd /var/lib/containers/storage/volumes/backup00/_data

You should see the ns8 modules you selected for backup as sub-directories.
In your case there should be at least a samba directory. Under that ther will be a direcory with some uuid, this is the restic repository that contains all snapshots of the samba module and data you have made.

To see a list of the available snapshots run:
restic -r samba/<uuid> snapshots

To restore a complete snapshot you can:
restic -r /srv/restic-repo restore <snapshot-id> --target /tmp/restore

Use the --include option to specify a specific file or directory.
But instead if me repeating the restic manual: https://restic.readthedocs.io/en/stable/050_restore.html

I hope this will get you going.

3 Likes

Thank you so much!

The restoration of a single file is available from the UI of Samba 2.3.0 and Core 3.3.0. You can find more information in File server — NS8 documentation.

4 Likes