1. 2

  2. 1

    I wouldn’t trust this procedure to take consistent backups. Just to point to one specific thing, the export procedure clearly states that it’s still an experimental features (and hope is not an option).

    Also, there is a backup procedure… But no restore procedure in this tutorial.

    I do this differently and so far I managed to recover from two tragic (shut myself out and a failed disk) situations without much problems. I run both nextcloud and its mysql in docker containers, via docker compose. The docker-compose file along with mysql and nextcloud data reside on a dedicated zfs dataset. I take snapshots hourly, and keep two weeks worth of snapshots (~360 snapshots iirc). I have scripts to manage retention. Every four hours I send all the snapshots to a replica of the zfs dataset onto another machine in a remote location.

    Zfs snapshots are atomic.

    This article is bad in my opinion because there are so many moving parts. Stuff break, and when it breaks you want to have as little things to fix as possible.


    1. 1

      I came to say the same thing. I back up Nextcloud by doing a ZFS snapshot then ZFS send to a remote machine. I’ve had the VM running it fail entirely and I was able to completely restore everything.

      1. 1

        But no restore procedure in this tutorial.

        There’s a red banner saying “TEST YOUR BACKUPS” followed by instructions on how to restore.

        1. 1

          Zfs snapshots are atomic.

          What does that actually give you, given how in Unix file systems have no concept of a transaction? What benefits do ZFS snapshots have then regarding consistency?

          Let’s say that I run a program which adds a user to the system. This program will have to update /etc/passwd, /etc/shadow, /etc/group and create a directory in /home. Do ZFS snapshots protect you from taking a snapshot of your file system when you’re in the middle of those operations (as in let’s say you modified /etc/passwd and /etc/group, but didn’t modify /etc/shadow and didn’t create a directory in /home yet)?

          1. 1

            zfs snapshots are not automatic, you must do them either by hand or by script. so just make sure to create a snapshot after you know your data is consistent.

            for the most part it will not be a problems (databases are pretty good at this, postgresql also has a “checkpoint” feature that should help with this iirc).

            just to be sure, my backup script stops the databases every night, takes a snapshot, and then restarts the database.

        Stories with similar links:

        1. How To Backup Nextcloud authored by kev 2 years ago | 14 points | 1 comment