Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore a single file or folder from backup #7072

Closed
3 tasks done
DavidePrincipi opened this issue Oct 23, 2024 · 9 comments
Closed
3 tasks done

Restore a single file or folder from backup #7072

DavidePrincipi opened this issue Oct 23, 2024 · 9 comments
Assignees
Labels
milestone goal 👑 This describes an announced milestone goal verified All test cases were verified successfully

Comments

@DavidePrincipi
Copy link
Member

DavidePrincipi commented Oct 23, 2024

File server and Mail server store user data as files and folders: a single file or folder restore tool can be useful in case of accidental data removal.

Basic restore workflow:

  1. select the backup destination
  2. select the past backup snapshot (date) to restore
  3. select mail user, or shared folder
  4. select the IMAP folder, subfolder or file to restore

Contents are restored to a separate folder, so the user can access by their side.

It was also requested the procedure to explore a NS8 Restic backup

how to run Restic in another Linux distribution to extract a NS8 application backup? -- https://community.nethserver.org/t/migrate-ns8-applications-to-other-platforms/22251/2?u=davidep

Discussion https://mattermost.nethesis.it/nethesis/pl/x1ooc8ctmiyhjxhbxq1eiz9rch

See also


Sub-tasks:

@DavidePrincipi DavidePrincipi converted this from a draft issue Oct 23, 2024
@DavidePrincipi DavidePrincipi added this to the NethServer M8.3 milestone Oct 23, 2024
@DavidePrincipi DavidePrincipi self-assigned this Oct 23, 2024
@DavidePrincipi DavidePrincipi moved this from Backlog to Ready in NethServer Oct 23, 2024
DavidePrincipi added a commit to NethServer/ns8-core that referenced this issue Oct 23, 2024
DavidePrincipi added a commit to NethServer/ns8-docs that referenced this issue Oct 23, 2024
@DavidePrincipi
Copy link
Member Author

Released restic-wrapper in https://github.com/NethServer/ns8-core/releases/tag/3.1.3

@DavidePrincipi
Copy link
Member Author

Restore user's mail folder:

restic-wrapper --backup 1 restore 'eb97369f:volumes/dovecot-data/first.user/Maildir/.Folder.Subfolder' -t '/srv/volumes/dovecot-data/davidep/Maildir/.RestoreTest'

The .RestoreTest directory is created with root:root ownership and must be fixed to vmail:vmail. Directory contents have the correct owner, because they are restored from the backup.

The client (Evolution, Webtop) takes a while before listing the restored folder. I still do not grasp what is the condition that makes it suddenly visible 🤔

@DavidePrincipi
Copy link
Member Author

DavidePrincipi commented Nov 28, 2024

From @andre8244, TODO:

  • Check if the share name is involved in the content search and produces unexpected search results. E.g. file test1 of myshare1 is matched by a search with char m, y.
  • Check the restore of IMAP folder for a disabled IMAP user

DavidePrincipi added a commit to NethServer/ns8-core that referenced this issue Dec 6, 2024
List backup repositories of a module

Refs NethServer/dev#7072
@DavidePrincipi
Copy link
Member Author

Check the restore of IMAP folder for a disabled IMAP user

It can't work because the a disabled mailbox means the user disappears from Dovecot user DB. It makes impossible to produce IMAP folder listings, necessary for the restore procedure.

@DavidePrincipi DavidePrincipi added the testing Packages are available from testing repositories label Dec 6, 2024
@nethbot nethbot moved this from In Progress to Testing in NethServer Dec 6, 2024
DavidePrincipi added a commit to NethServer/ns8-mail that referenced this issue Dec 6, 2024
Selective restoration of IMAP folders

Refs NethServer/dev#7072
DavidePrincipi added a commit to NethServer/ns8-mail that referenced this issue Dec 6, 2024
DavidePrincipi added a commit to NethServer/ns8-samba that referenced this issue Dec 6, 2024
Selective restore of Samba File Server contents

Refs NethServer/dev#7072
DavidePrincipi pushed a commit to NethServer/ns8-samba that referenced this issue Dec 6, 2024
Translate-URL: https://hosted.weblate.org/projects/ns8/samba/
Translate-URL: https://hosted.weblate.org/projects/ns8/samba/de/
Translate-URL: https://hosted.weblate.org/projects/ns8/samba/es/
Translate-URL: https://hosted.weblate.org/projects/ns8/samba/eu/
Translate-URL: https://hosted.weblate.org/projects/ns8/samba/it/
Translate-URL: https://hosted.weblate.org/projects/ns8/samba/pt/
Translate-URL: https://hosted.weblate.org/projects/ns8/samba/pt_BR/
Translation: NS8/samba

Co-authored-by: Davide Principi <davide.principi@nethesis.it>
Co-authored-by: LibreTranslate <noreply-mt-libretranslate@weblate.org>
Co-authored-by: Prefill add-on <noreply-addon-prefill@weblate.org>
Co-authored-by: Weblate Translation Memory <noreply-mt-weblate-translation-memory@weblate.org>
Co-authored-by: albanobattistella <albano_battistella@hotmail.com>

Refs NethServer/dev#7072
@DavidePrincipi
Copy link
Member Author

DavidePrincipi commented Dec 6, 2024

Test case

Components:

  • core 3.3.0-dev.1
  • mail 1.5.0-dev.2
  • samba 2.3.0-dev.1

New scenarios:

  • With Mail, the Sysadmin can select a past backup snapshot for an enabled user and restore an IMAP folder in their mailbox.
  • With Samba, the Sysadmin can select a past backup snapshot of an existing share and restore a file or folder (with all its contents) under the share root.

Additional checks

  • Samba DC upgrades from 4.18 to 4.19: check if the upgrade of existing installations succeeds

DavidePrincipi pushed a commit to NethServer/ns8-mail that referenced this issue Dec 6, 2024
Translate-URL: https://hosted.weblate.org/projects/ns8/mail/de/
Translate-URL: https://hosted.weblate.org/projects/ns8/mail/es/
Translate-URL: https://hosted.weblate.org/projects/ns8/mail/eu/
Translate-URL: https://hosted.weblate.org/projects/ns8/mail/it/
Translate-URL: https://hosted.weblate.org/projects/ns8/mail/pt/
Translate-URL: https://hosted.weblate.org/projects/ns8/mail/pt_BR/
Translation: NS8/mail

Co-authored-by: Davide Principi <davide.principi@nethesis.it>
Co-authored-by: LibreTranslate <noreply-mt-libretranslate@weblate.org>
Co-authored-by: Prefill add-on <noreply-addon-prefill@weblate.org>
Co-authored-by: Weblate Translation Memory <noreply-mt-weblate-translation-memory@weblate.org>


Refs NethServer/dev#7072
@DavidePrincipi
Copy link
Member Author

In testing Mail 1.5.0-dev.3

See commit NethServer/ns8-mail@4be69b7

@DavidePrincipi
Copy link
Member Author

  • Check if the share name is involved in the content search and produces unexpected search results. E.g. file test1 of myshare1 is matched by a search with char m, y.

@andre8244 I confirm that this is the behavior. However I don't have a solution to exclude these false positive matches. The issue should not be noticeable as they are appended at the bottom of the list.

DavidePrincipi pushed a commit to NethServer/ns8-samba that referenced this issue Dec 9, 2024
Translate-URL: https://hosted.weblate.org/projects/ns8/samba/it/
Translation: NS8/samba

Co-authored-by: Davide Principi <davide.principi@nethesis.it>

Refs NethServer/dev#7072
DavidePrincipi pushed a commit to NethServer/ns8-mail that referenced this issue Dec 9, 2024
Translate-URL: https://hosted.weblate.org/projects/ns8/mail/it/
Translation: NS8/mail

Co-authored-by: Luca Gasparini <luca.gasparini@nethesis.it>


Refs NethServer/dev#7072
@lucagasparini
Copy link

Test cases passed successfully:

  • restore mail folders and subfolders (including INBOX)
  • restore entire IMAP public folder
  • restore entire samba shares and individual files

VERIFIED

@lucagasparini lucagasparini added verified All test cases were verified successfully and removed testing Packages are available from testing repositories labels Dec 9, 2024
@nethbot nethbot moved this from In Progress to Verified in NethServer Dec 9, 2024
@nethbot nethbot moved this from Testing to In Progress in NethServer Dec 9, 2024
DavidePrincipi added a commit to NethServer/ns8-docs that referenced this issue Dec 9, 2024
@github-project-automation github-project-automation bot moved this from Verified to Done in NethServer Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
milestone goal 👑 This describes an announced milestone goal verified All test cases were verified successfully
Projects
Archived in project
Development

No branches or pull requests

3 participants