Should I move the data directory?

I have installed NextCloud from snap onto my Ubuntu server that has a 256GB SSD and 5 X 4TB HDs in a ZFS raidz1 array. Of course, snap setup everything on the SSD. But, I thought it would be a good idea to move the data directory to the ZFS array to take advantage of the redundancy and data-scrubbing of ZFS. This did not go well. But before I ask the community why it didn’t work, I will ask the community if it was a good idea in the first place. If I do decide it is a good idea, I will start another thread to discuss what I did wrong.

If I understand NextCloud correctly, and I’m not sure I do, it comes in three parts:
User Files - I absolutely want this on ZFS for the redundancy and it wouldn’t all fit on the SSD anyway.

App Data - I can download this from the internet again, so I don’t care about redundancy and it won’t amount to much storage. The SSD is fine for this.

database/data directory - This is what I’m not sure about. If the database is lost to data corruption or drive failure what have I lost? It sounds like there is a rescan command to reindex all the user files in the database. But do I lose history, versioning or sharing rules with other users?

I do backups from this server, but I consider ZFS an important first line of data integrity. How do the experienced administrators treat their NextCloud databases?

I am not familiar with ZFS. But even ZFS will only protect you in certain scenarios. If a user accidentally deletes files (including the Nextcloud recycle bin), then ZFS may not help you much.

Take a look at Backup and Restore. In the case of a restore, you should not be able to reinstall Nextcloud, but restore the backup of your Nextcloud installation, configuration and database as well as the files you mentioned.

What is your scenario in the event of an error? Why don’t you try it out on a test system?

Thank you devnull,
It is true ZFS is not a substitute for a backup strategy.

After reviewing the Backup & Restore links I have concluded to keep the database on the SSD, but put the backups on the ZFS array.


Sorry to spoil the party but in case snap deployment, beware, you can’t move database out of the default in case of snap.


Ah, that explains that.
I noticed the commands to control NextCloud on snap are all different. I found the github for nextcloud-snap. But is there an explanation of how to translate a normal the snap command to nextcloud for snap? In case I reading something written for non-snap nextcloud?