Back up NC + Docker / Data in USB

Hi :slightly_smiling_face:

Hi,

I would like to make a back up of my nextcloud on the raspberry-pi. Nc is running on the docker, the data is stored on an external USB device. I was thinking to do an image back up with commit from the docker, and separately a backup from the usb stick where the nc data is stored. Or is there a better method?

No idea ? :grinning:

There are tons of discussions about backup on this forum - use the search.

Official docs: Backup — Nextcloud latest Administration Manual latest documentation

Hi, I think I can help!!

I don’t have much knowledge of Docker but I’ve heard comments that both the commands and the file structure are similar.

In this case I recommend that you take a look at these scripts

If you don’t want to download the entire repository, all you need is the setup.sh script, then you can download it and change the commands to match Docker or, if you’re interested, you can run this script within the nextcloud container itself.

As I said, my nextcloud installation is based on Nginx + php8.2-fpm + Mariadb and I’m not an expert in docker

Just one more observation when running the setup.sh script it will already download the backup.sh and restore.sh scripts and schedule it in cron and if you want to run it manually the files will be in /root/Scripts

Hey

Thanks for the tip. I have now found a solution. I am in the process of writing a back up script.

Since you are using docker anyway, you could switch to https://github.com/nextcloud/all-in-one which does already include a backup functionality.

2 Likes