I am trying to set up a Seafile Server in Docker, and am trying out the restore produce. Unfortunately, I cannot get it to work, despite (seemingly) following the instructions exactly (from https://manual.seafile.com/11.0/maintain/backup_recovery/)
My steps:
Initial Setup
-
Tweak the
docker-compose.ymlfile (I only fill in passwords, admin username and hostname):File contents
services: db: image: mariadb:10.11 container_name: seafile-mysql environment: - MYSQL_ROOT_PASSWORD=mypassword # Required, set the root's password of MySQL service. - MYSQL_LOG_CONSOLE=true - MARIADB_AUTO_UPGRADE=1 volumes: - /opt/seafile-mysql/db:/var/lib/mysql # Required, specifies the path to MySQL data persistent store. networks: - seafile-net memcached: image: memcached:1.6.18 container_name: seafile-memcached entrypoint: memcached -m 256 networks: - seafile-net seafile: image: seafileltd/seafile-mc:11.0-latest container_name: seafile ports: - "80:80" # - "443:443" # If https is enabled, cancel the comment. volumes: - /opt/seafile-data:/shared # Required, specifies the path to Seafile data persistent store. environment: - DB_HOST=db - DB_ROOT_PASSWD=mypassword # Required, the value should be root's password of MySQL service. - TIME_ZONE=Etc/UTC # Optional, default is UTC. Should be uncomment and set to your local time zone. - SEAFILE_ADMIN_EMAIL=myemail@example.com # Specifies Seafile admin user, default is 'me@example.com'. - SEAFILE_ADMIN_PASSWORD=mypassword2 # Specifies Seafile admin password, default is 'asecret'. - SEAFILE_SERVER_LETSENCRYPT=false # Whether to use https or not. - SEAFILE_SERVER_HOSTNAME=127.0.0.1 # Specifies your host name if https is enabled. depends_on: - db - memcached networks: - seafile-net networks: seafile-net: -
Run
docker compose up -dto start the server. -
Create a library and upload some files (via the web interface)
Backup
-
Run the following commands to create a backup:
docker exec -it seafile-mysql mysqldump -uroot -pmypassword --opt ccnet_db > /mnt/seafile-backup/databases/ccnet_db.sql docker exec -it seafile-mysql mysqldump -uroot -pmypassword --opt seafile_db > /mnt/seafile-backup/databases/seafile_db.sql docker exec -it seafile-mysql mysqldump -uroot -pmypassword --opt seahub_db > /mnt/seafile-backup/databases/seahub_db.sql rsync -az /opt/seafile-data/seafile /mnt/seafile-backup/data
Reset
- Delete all docker containers
- Delete the
/opt/seafile-dataand/opt/seafile-mysqldirectories
Restore
-
Set up the server with the steps described in “Initial setup”
-
Log into the web interface. The previous libraries are of course missing.
-
Import the backup using the following commands:
docker cp /mnt/seafile-backup/databases/ccnet_db.sql seafile-mysql:/tmp/ccnet_db.sql docker cp /mnt/seafile-backup/databases/seafile_db.sql seafile-mysql:/tmp/seafile_db.sql docker cp /mnt/seafile-backup/databases/seahub_db.sql seafile-mysql:/tmp/seahub_db.sql docker exec -it seafile-mysql /bin/sh -c "mysql -uroot -pmypassword ccnet_db < /tmp/ccnet_db.sql" docker exec -it seafile-mysql /bin/sh -c "mysql -uroot -pmypassword seafile_db < /tmp/seafile_db.sql" docker exec -it seafile-mysql /bin/sh -c "mysql -uroot -pmypassword seahub_db < /tmp/seahub_db.sql" cp -R /mnt/seafile-backup/data/* /opt/seafile-data/seafile/ -
Restart the server
-
Log into the web interface. The previously created library is visible again (i.e. was restored), but clicking on it results in “Library share permission not found.” No amount of further restarting (as suggested by some posts) fixes this
How can I successfully restore the data? Are the official instructions incomplete, or am I simply doing something wrong?