Docker Volume Backup Tutorial: Nextcloud Example

Published: 04 June 2023
on channel: Techdox
6,200
164

Learn how to securely backup Docker volumes using Nextcloud as an example in this step-by-step tutorial. Docker volumes are crucial for persisting data in containerized applications, and backing them up ensures the safety and recoverability of your valuable data. In this video, we walk you through the process of creating a backup of Nextcloud's Docker volumes, including the data and configuration directories. You'll gain a clear understanding of the commands and steps involved, allowing you to confidently implement volume backups in your Docker environment. Don't risk losing your data—watch this tutorial and safeguard your Docker volumes today!


🔒 BACKUP 🔒
Bookstack - https://bookstack.elzim.xyz/books/sel...

1️⃣ Backup Nextcloud Database:
Run the following command in your terminal:

docker run --rm --volumes-from nextcloud-db-1 -v $(pwd):/backup ubuntu tar cvf /backup/backup.tar -C /var/lib/mysql .


2️⃣ Backup Nextcloud Data:
Run this command next:

docker run --rm --volumes-from nextcloud-app-1 -v $(pwd):/backup ubuntu tar cvf /backup/backupdata.tar -C /var/www/html/data .


3️⃣ Backup Nextcloud Configuration:
Lastly, run the command below:

docker run --rm --volumes-from nextcloud-app-1 -v $(pwd):/backup ubuntu tar cvf /backup/backupconfig.tar -C /var/www/html/config .



🔁 RESTORE 🔁

1️⃣ Restore Nextcloud Database:
Execute the following command:

docker run --rm --volumes-from nextcloud-db-1 -v $(pwd):/backup ubuntu bash -c "cd /var/lib/mysql && tar xvf /backup/backup.tar"


2️⃣ Restore Nextcloud Data:
Use this command for data restoration:

docker run --rm --volumes-from nextcloud-app-1 -v $(pwd):/backup ubuntu bash -c "cd /var/www/html/data && tar xvf /backup/backupdata.tar"


3️⃣ Restore Nextcloud Configuration:
Finally, execute this command:

docker run --rm --volumes-from nextcloud-app-1 -v $(pwd):/backup ubuntu bash -c "cd /var/www/html/config && tar xvf /backup/backupconfig.tar"


Ensure the paths and container names match your setup. By following these instructions, you can confidently backup and restore Docker volumes, protecting your valuable Nextcloud data. Don't risk data loss—watch now and keep your Docker volumes safe! 💾✨


Timestamps:

0:00 Introduction
1:00 Setup Overview
2:11 Setup of Nextcloud
3:50 Stopping Nextcloud and Backing up
7:25 Restoring Backups
11:44 Closing Thoughts


Watch video Docker Volume Backup Tutorial: Nextcloud Example online, duration hours minute second in high quality that is uploaded to the channel Techdox 04 June 2023. Share the link to the video on social media so that your subscribers and friends will also watch this video. This video clip has been viewed 6,200 times and liked it 164 visitors.