S3cmd: make a full backup of Nextcloud on your Leviia object storage space (S3 compatible)
Prerequisites
Have created a bucket
Have configured and installed s3cmd
Configuration and backup
Switch nextcloud to maintenance mode
sudo -u www-data php /var/www/nextcloud/occ maintenance:mode --on
Make a database dump
mysqldump --single-transaction -h localhost -u <user_db> -p <password_db> <name_db> > nextcloud.sql
Send dump to S3
s3cmd put nextcloud.sql s3://<bucket_name>/nextcloud.sql
Send nextcloud data to S3
s3cmd sync --recursive --preserve --exclude '*/cache/*' /data/nextcloud s3://<bucket_name>/
Check contents
s3cmd ls <bucket_name>
Remove maintenance mode
sudo -u www-data php /var/www/nextcloud/occ maintenance:mode --off
Updated on: 05/01/2024
Thank you!