Database backup - username and password?

Hi!

I’m relatively new to Nextcloud. I want to create a backup from the PostgreSQL database. Unfortunately, I didn’t find correct information about which role name and database name Nextcloud uses in the default AIO installation. Also, I can’t remember that Nextcloud asked for a database password during the installation process.

So, how can I find out the username and the database name Nextcloud is using in my installation? I found the documentation on how to perform a backup, but due to the fact that I couldn’t figure out the names of the roles and database, I’m unable to use the commands mentioned in the documentation files. Can you help me?

I’m running Nextcloud 32.0.6, an up-to-date Debian 13. As mentioned, I used the AIO method to install my Nextcloud instance.

Thanks and greetings,
ty.

Hi, AIO comes with its own backup solution. See GitHub - nextcloud/all-in-one: 📦 The official Nextcloud installation method. Provides easy deployment and maintenance with most features included in this one Nextcloud instance. · GitHub

Yeah, I know. But I want to try my own backup method. First, to learn, second, because I think about alternative installation methods and third, most importand, because the built in backup method ran for four hours sometime. I want to speed it up…

I have no clue about the specifics of AIO, since not using AIO, but in my Nextcloud-config.php the

  • dbname
  • dbuser and
  • dbpassword

are all stored in clear Text in /var/www/nextcloud/config/config.php. SO search your /nextcloud/config/config.php or what is similar in AIO.

1 Like

Hey @tyradux welcome to the nextcloud community :waving_hand:

the best way to do that would be to use occ commands in the host shell:

for AIO see how to run occ commands below:

OCC get database info from system config:

  • get database type
    occ config:system:get dbtype

  • get database name
    occ config:system:get dbname

  • get database password
    occ config:system:get dbpassword

1 Like

If you want to use your own backup solution, in general it is recommended to simply back up all docker volumes. And the datadir if configured. There is a small mentioning of this in GitHub - nextcloud/all-in-one: 📦 The official Nextcloud installation method. Provides easy deployment and maintenance with most features included in this one Nextcloud instance. · GitHub