Nextcloud - DB storage, backups and restore

Migsi

Dabbler
Joined
Mar 3, 2021
Messages
40
Hello,

I just read through and tested a full nextcloud setup using the TrueChart provided "app". So far, so good, everything went fine and the instance is running.
As the installer asks for a hostPath to store the nextcloud data, I was curious if there was a way to define a hostPath for the database files too (to perform fs level backups/restores). After poking around a while I found that there is no such setting, but I managed to find the DB within the postgres pod which is spawned as part of the nextcloud instance. I hoped to be able to locate the db files somewhere within the ix-applications dataset, but had no luck. This ultimately leads to my question: How is the nextcloud db, postgres in this case, persisted across reboots? I'd expect it to be at least some sort of docker volume, which should be visible from outside the container/pod. How am I supposed to perform backups of the database? How can I restore a fs level backup from an instance that ran on TN Core within a jail?

If you miss any information, don't hesitate to ask.
 

truecharts

Guru
Joined
Aug 19, 2021
Messages
788
Hello,

By default PVC storage isn't user accessible unless mounted, so if you wish to see the contents of your nextcloud install and do manual backups you're best off chosing HostPath when you install Nextcloud. See image below (step #5), but remember reverting and using snapshots won't be supported from inside the app.

1650940580356.png


PVC is the default method when because it supports reverting and other aspects of Kubernetes, some more info is on our website. You can also reach us on Discord if you need more info
 

Migsi

Dabbler
Joined
Mar 3, 2021
Messages
40
Hello,

By default PVC storage isn't user accessible unless mounted, so if you wish to see the contents of your nextcloud install and do manual backups you're best off chosing HostPath when you install Nextcloud. See image below (step #5), but remember reverting and using snapshots won't be supported from inside the app.

View attachment 55027

PVC is the default method when because it supports reverting and other aspects of Kubernetes, some more info is on our website. You can also reach us on Discord if you need more info
Thank you for the answer. As I noted above, I already made use of this setting. But this hostPath is for the nextcloud data directory only, leaving out the database itself. I have to apply the backups I've made of my previous instance (before moving to scale) and can't figure out how to do so. I have a filesystem level backup of my database (the postgres data directory itself) and would like to use that within the scale nextcloud "app".
Even if using filesystem level backups are not recommended for this deployment (?), I'd be happy to know, how I am supposed to handle backups of the nextcloud database for this "app".

I'll joint your discord for further discussions, but I'd be happy if such information would be provided somewhere in the doc.
 

truecharts

Guru
Joined
Aug 19, 2021
Messages
788
Thank you for the answer. As I noted above, I already made use of this setting. But this hostPath is for the nextcloud data directory only, leaving out the database itself. I have to apply the backups I've made of my previous instance (before moving to scale) and can't figure out how to do so. I have a filesystem level backup of my database (the postgres data directory itself) and would like to use that within the scale nextcloud "app".
Even if using filesystem level backups are not recommended for this deployment (?), I'd be happy to know, how I am supposed to handle backups of the nextcloud database for this "app".

I'll joint your discord for further discussions, but I'd be happy if such information would be provided somewhere in the doc.

What is and isn't documented depends on what the communities does or doesn't document.

But generally speaking we do not support direct filesystem access to the databases and only support backups using special database managers and/or the backup system layed out in our quick-start guides :)
 

Migsi

Dabbler
Joined
Mar 3, 2021
Messages
40
What is and isn't documented depends on what the communities does or doesn't document.

But generally speaking we do not support direct filesystem access to the databases and only support backups using special database managers and/or the backup system layed out in our quick-start guides :)
I'd be happy to create a quick writeup, when my instance is running again! :)

I already expected this to be the case. Which (available) database managers do you recommend? The backup system mentioned in the quick-start guides does not help when trying to migrate from Core :/
 

Krautmaster

Explorer
Joined
Apr 10, 2017
Messages
81
im trying to do the same. I want to use occ migrate database command to fill/restore my Truecharts postgresql database to migrate from jail / mariadb to app/postgresql
 

indivision

Guru
Joined
Jan 4, 2013
Messages
806

ver151set

Dabbler
Joined
Jan 28, 2015
Messages
37
How does one mount the postgres database outside the app?
With the pgadmin app you can easily backup and restore databases. On the truecharts website they have a script you can save which shows you the address, username, and password of every postgres database your apps are using - and even a guide on using it
 

victort

Guru
Joined
Dec 31, 2021
Messages
973
With the pgadmin app you can easily backup and restore databases. On the truecharts website they have a script you can save which shows you the address, username, and password of every postgres database your apps are using - and even a guide on using it
I mean when installing the app, you can pretty much mount everything outside using hostpath. But the database (Nextcloud in this case) is in a separate container and seems to not be able to be mounted.

I prefer to be able to tear down an app and reinstall and pick up where I left off.

Backup and restore seems unnecessary especially if the data stays on the same pool, and could just be remounted.
 
Top