How to make a full backup

Hi, I want to make a complete backup of my nextcloud instance including users files.

I am running a raspi 4, dietpi and the latest nextcloud.

Is there a way to do this? I would like to be able to set it to backup every night to an external drive connected to the pi? Or if all else fails to a cloud storage provider.


Do you know this fantastic search function of this forum, which allows to find answers on questions instead of asking the same question again and again?

Never heard of it mate.

Edit: also what you’ve linked to does not answer my question. Instead or just jumping on the snarky “have tried search” schtick maybe consider that I have tried and none of my questions were answered.

1 Like

Ok, then I assume that you’ve already read the administrator documentation which contains a separate backup chapter?!

Correct again.

Have you read my question? And what I am specifically looking for?

A way to backup everything including files, that will run periodically overnight to an external drive.

I found backup to be hard until I discovered lxc. What I mean by that is trying to backup your sql database, apps, settings etc. is complicated and I never really got that to work. User files is fairly easy, but I wanted EVERYTHING backed up. And now, I do! And it’s dead easy.

All i do is run my nextcloud instance in an lxc container (under LXD 4.0). What I mean is that my entire nextcloud instance is setup in a linux container running under LXD 4.0. If you google it, you can find out how that works. It’s a fast way for mortals to have virtual machines on their ubuntu-based computers. So I just created my entire nextcloud instance inside such a container (no harder than doing it on e.g. an ubuntu server or desktop). It works with the same features as normal (so you can’t tell it’s in a container), but backing up is a BREEZE. I just run ONE COMMAND at 2am every day:

lxc copy NC-OB1 LEIA:OB1-NC-backup --refresh --target-project ob1-refreshed-backups

Pow. That command refreshes my copy of the server into another lxc container (which can be on the same machine, the same network or half way aroound the world). The first copy takes a while (mine is 300GB), but nightly refreshes effectively rsync changes only, so it normally takes less than a minute to run.

I have fully tested this: if I take down my live nextcloud instance (e.g faking a crash) and spin up the copy, it WORKS. All I do is point my router to the new container and it’s up and running instantly. 100% of data are present. Every setting, every comment, every file, every link absolutely EVERYTHING. It’s all done in a smidge of time.

There is no better way to backup nextcloud in my humble opinion.


this is not exactly a nextcloudproblem.
It’s more like a general problem.

You should be able to find several topics on the internet about it. I’m sure dietpi itself (e.g.) has an entry on how to handle backups.

like you could use snapshots, images, rsync (or different backupsolutions) or a combination of those (or more) to meet your special demands on a backup.

umm… Have YOU put thought into the fact that anyone here on the forum would know what you have done or not if you’re not telling a single word about it? you maybe wanna forgive @j-ed for not being able to read your mind… and thus assuming that you are just another lazy forumist avoiding too much.


1 Like

I know, I am just looking for a little guidance on it.

I have however, they are only focused on backing up the dietpi system and I haven’t been able to find something that met my needs, hence I came here to see if anyone else has had any luck or been in the same scenario.

I didn’t expect him to be able to read my mind, however I didn’t expect to have a snarky reply when I am just asking for help. I know how to search a forum and I know how to read a manual.

Hence my terse response. Granted this wasn’t the most mature or constructive way to respond, but I wasn’t exactly treated in a nice way initially.

In regards to the “another lazy forumist” comment, that’s a pretty bad way to think about people on here/new users. Not everyone is going to have an encyclopedic knowledge of the forums and what goes on, some people are just passing through looking for help on something.

Hi Andrew,

This is hugely helpful! Thanks for taking the time and your detailed response.

I’ve never heard of lxc bit will look into it now.

I think your setup does exactly what I want to do so this is perfect!

Hah. You’re welcome. if you running on Linux (an ubuntu flavor) then sudo apt install lxd gets you the package. It’s not difficult to configure, just a little work.

This site is a great resource for lxc/lxd:

The only bummer is having to “re-install” Nextcloud in the container. But that doesn’t really take long in the grand scheme. And of course, you need another device to upload your backups to (I use seperate servers to give me even more redundancy).

Good luck! :slight_smile:

Maybe this could help, too?

1 Like

well, having commented on hundreds if not thousands of users/sew users threads here I think I dare have a word about it. Some of them give a sh*t on forum rules even if they were told to keep to them or simply lazy (note: i’m not claiming that YOU are one of them)
Even you have agreed to those by setting up an account and signing in. A part of TOS was NC-Code of Conduct und NC-guidelines. As well as deleting the template asking for several details about your system that comes up in the original (but initially wrong) category you posted your ‘issue’.

again and again: if you are terse in your issue and replies anyone would know what you’re capable of. meaning: give out as much info and words as you can give… it costs you nothing and is absoluetly free.

awww and point with one finger towards someone makes 3 other fingers pointing back at you. just sayin… :wink:

I found this incredibly helpful and easy to follow and get a full backup run every night.