# How to make a full backup

**URL:** <https://help.nextcloud.com/t/how-to-make-a-full-backup/89743>\
**Category:** 🏷️ General\
**Tags:** not\_nc\_related\
**Created:** [August 15, 2020, 11:34am UTC](https://help.nextcloud.com/t/how-to-make-a-full-backup/89743 "2020-08-15T11:34:43Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![mdbserver](https://help.nextcloud.com/letter_avatar/mdbserver/32/6_22734026db12803ebb3e059622ac3534.png) [@mdbserver](https://help.nextcloud.com/u/mdbserver)\
**Post date:** [August 15, 2020, 11:34am UTC](https://help.nextcloud.com/t/how-to-make-a-full-backup/89743/1 "2020-08-15T11:34:43Z")

</div>

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.

Thanks

---

<div class="post-metadata">

**Author:** ![j-ed](https://help.nextcloud.com/user_avatar/help.nextcloud.com/j-ed/32/7281_2.png) [@j-ed](https://help.nextcloud.com/u/j-ed)\
**Post date:** [August 15, 2020, 11:37am UTC](https://help.nextcloud.com/t/how-to-make-a-full-backup/89743/2 "2020-08-15T11:37:07Z")

</div>

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?

[https://help.nextcloud.com/search?q=full%20backup](https://help.nextcloud.com/search?q=full%20backup)

---

<div class="post-metadata">

**Author:** ![mdbserver](https://help.nextcloud.com/letter_avatar/mdbserver/32/6_22734026db12803ebb3e059622ac3534.png) [@mdbserver](https://help.nextcloud.com/u/mdbserver)\
**Post date:** [August 15, 2020, 11:48am UTC](https://help.nextcloud.com/t/how-to-make-a-full-backup/89743/3 "2020-08-15T11:48:10Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![j-ed](https://help.nextcloud.com/user_avatar/help.nextcloud.com/j-ed/32/7281_2.png) [@j-ed](https://help.nextcloud.com/u/j-ed)\
**Post date:** [August 15, 2020, 11:57am UTC](https://help.nextcloud.com/t/how-to-make-a-full-backup/89743/4 "2020-08-15T11:57:38Z")

</div>

Ok, then I assume that you’ve already read the administrator documentation which contains a separate [backup chapter](https://docs.nextcloud.com/server/19/admin_manual/maintenance/backup.html?highlight=backup#backup)?!

---

<div class="post-metadata">

**Author:** ![mdbserver](https://help.nextcloud.com/letter_avatar/mdbserver/32/6_22734026db12803ebb3e059622ac3534.png) [@mdbserver](https://help.nextcloud.com/u/mdbserver)\
**Post date:** [August 15, 2020, 12:17pm UTC](https://help.nextcloud.com/t/how-to-make-a-full-backup/89743/5 "2020-08-15T12:17:24Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![wizlon](https://help.nextcloud.com/user_avatar/help.nextcloud.com/wizlon/32/7702_2.png) [@wizlon](https://help.nextcloud.com/u/wizlon)\
**Post date:** [August 15, 2020, 2:32pm UTC](https://help.nextcloud.com/t/how-to-make-a-full-backup/89743/6 "2020-08-15T14:32:05Z")

</div>

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.

Andrew

---

<div class="post-metadata">

**Author:** ![JimmyKater](https://help.nextcloud.com/user_avatar/help.nextcloud.com/jimmykater/32/4850_2.png) [@JimmyKater](https://help.nextcloud.com/u/JimmyKater)\
**Post date:** [August 15, 2020, 2:42pm UTC](https://help.nextcloud.com/t/how-to-make-a-full-backup/89743/7 "2020-08-15T14:42:32Z")

</div>

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.

> [@mdbserver](#):
>
> maybe consider that I have tried and none of my questions were answered.

> [@mdbserver](#):
>
> Correct again.

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.

cheerio  
jimmy

---

<div class="post-metadata">

**Author:** ![mdbserver](https://help.nextcloud.com/letter_avatar/mdbserver/32/6_22734026db12803ebb3e059622ac3534.png) [@mdbserver](https://help.nextcloud.com/u/mdbserver)\
**Post date:** [August 15, 2020, 3:50pm UTC](https://help.nextcloud.com/t/how-to-make-a-full-backup/89743/8 "2020-08-15T15:50:08Z")

</div>

> [@JimmyKater](#):
>
> this is not exactly a nextcloudproblem.  
> It’s more like a general problem.

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

> [@JimmyKater](#):
>
> 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.

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.

> [@JimmyKater](#):
>
> 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.

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.

---

<div class="post-metadata">

**Author:** ![mdbserver](https://help.nextcloud.com/letter_avatar/mdbserver/32/6_22734026db12803ebb3e059622ac3534.png) [@mdbserver](https://help.nextcloud.com/u/mdbserver)\
**Post date:** [August 15, 2020, 3:54pm UTC](https://help.nextcloud.com/t/how-to-make-a-full-backup/89743/9 "2020-08-15T15:54:46Z")

</div>

Hi Andrew,

> [@wizlon](#):
>
> I found backup to be hard

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!

---

<div class="post-metadata">

**Author:** ![Reiner\_Nippes](https://help.nextcloud.com/user_avatar/help.nextcloud.com/reiner_nippes/32/9479_2.png) [@Reiner\_Nippes](https://help.nextcloud.com/u/Reiner_Nippes)\
**Post date:** [August 15, 2020, 4:11pm UTC](https://help.nextcloud.com/t/how-to-make-a-full-backup/89743/10 "2020-08-15T16:11:00Z")

</div>

> [@Nextcloud Backup and Restore](https://help.nextcloud.com/t/nextcloud-backup-and-restore/51589/6):
>
> install restic as root sudo -i wget https://github.com/restic/restic/releases/download/v0.9.4/restic\_0.9.4\_linux\_amd64.bz2 bunzip2 restic\_0.9.4\_linux\_amd64.bz2 mv restic\_0.9.4\_linux\_amd64 /usr/local/bin/restic chmod 0755 /usr/local/bin/restic mount the backup directory to /mnt/nc-backup set two environment variables export RESTIC\_REPOSITORY="/var/nc-backup" export RESTIC\_PASSWORD="oJSesetLzRgphy9UwmWxi50oE0dkYa16" initialize restic restic init create a backup script /usr/local/bin/backup\_…

---

<div class="post-metadata">

**Author:** ![wizlon](https://help.nextcloud.com/user_avatar/help.nextcloud.com/wizlon/32/7702_2.png) [@wizlon](https://help.nextcloud.com/u/wizlon)\
**Post date:** [August 15, 2020, 5:25pm UTC](https://help.nextcloud.com/t/how-to-make-a-full-backup/89743/11 "2020-08-15T17:25:56Z")

</div>

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: [https://discuss.linuxcontainers.org/](https://discuss.linuxcontainers.org/)

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! 🙂

---

<div class="post-metadata">

**Author:** ![szaimen](https://help.nextcloud.com/user_avatar/help.nextcloud.com/szaimen/32/63019_2.png) [@szaimen](https://help.nextcloud.com/u/szaimen)\
**Post date:** [August 15, 2020, 5:33pm UTC](https://help.nextcloud.com/t/how-to-make-a-full-backup/89743/12 "2020-08-15T17:33:53Z")

</div>

Maybe this could help, too?

> **[Nextcloud-Backup-Restore](https://codeberg.org/DecaTec/Nextcloud-Backup-Restore)**
>
> Bash scripts for backup/restore of Nextcloud

---

<div class="post-metadata">

**Author:** ![JimmyKater](https://help.nextcloud.com/user_avatar/help.nextcloud.com/jimmykater/32/4850_2.png) [@JimmyKater](https://help.nextcloud.com/u/JimmyKater)\
**Post date:** [August 15, 2020, 5:35pm UTC](https://help.nextcloud.com/t/how-to-make-a-full-backup/89743/13 "2020-08-15T17:35:56Z")

</div>

> [@mdbserver](#):
>
> In regards to the “another lazy forumist” comment, that’s a pretty bad way to think about people on here/new users.

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](https://nextcloud.com/contribute/code-of-conduct/) und [NC-guidelines](https://help.nextcloud.com/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’.

> [@mdbserver](#):
>
> I know how to search a forum and I know how to read a manual

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… 😉

---

<div class="post-metadata">

**Author:** ![zauron](https://help.nextcloud.com/letter_avatar/zauron/32/6_22734026db12803ebb3e059622ac3534.png) [@zauron](https://help.nextcloud.com/u/zauron)\
**Post date:** [August 17, 2020, 9:10am UTC](https://help.nextcloud.com/t/how-to-make-a-full-backup/89743/14 "2020-08-17T09:10:54Z")

</div>

I found this [https://kevq.uk/how-to-backup-nextcloud/](https://kevq.uk/how-to-backup-nextcloud/) incredibly helpful and easy to follow and get a full backup run every night.
