From 2b930315b975bb9443187a751fe3a0a343bffbd7 Mon Sep 17 00:00:00 2001 From: Jizhou Deng Date: Mon, 20 Oct 2025 16:08:21 +0800 Subject: [PATCH] Fix: Data Backup and Restore --- manual/administration/backup_recovery.md | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/manual/administration/backup_recovery.md b/manual/administration/backup_recovery.md index c63e8985..08e471c2 100644 --- a/manual/administration/backup_recovery.md +++ b/manual/administration/backup_recovery.md @@ -195,5 +195,20 @@ docker exec -it seafile-mysql /bin/sh -c "mariadb -u[username] -p[password] seah ### Restore the seafile data ```bash -cp -R /backup/data/* /opt/seafile-data/seafile/ +# Recommended: use rsync to restore, preserving ownership/permissions/ACL/xattrs. +# Run a dry-run first to review the changes. +# Dry-run (no changes made) +sudo rsync -aHAX --dry-run --itemize-changes /backup/data/seafile/ /opt/seafile-data/seafile/ + +# Restore (apply changes) +sudo rsync -aHAX /backup/data/seafile/ /opt/seafile-data/seafile/ + +# Optional: make the target an exact mirror of the backup +# (will delete files present in the target but not in the backup; +# add only after reviewing the dry-run output) +# sudo rsync -aHAX --delete /backup/data/seafile/ /opt/seafile-data/seafile/ ``` +!!! note + Trailing “/” on the source means “copy the directory CONTENTS”. + + Run with sudo to preserve owners, groups, ACLs (-A) and xattrs (-X).