Nextcloud lost config.php data

Nextcloud version: 15.0.2
Operating system and version: Ubuntu 16.04

The problem is very simple, the machine ran out of disk space and for some reason nextcloud cleared config.php. Now it’s asking me to reconfigure but I’ve got a whole bunch of documents etc, existing accounts, data configs etc already existing.

How do I configure Nextcloud to use the existing database connection with all the existing files and user accounts etc?

bumping this post

Hey guys, this is quite a serious issue because my calendar and contacts are also synched with this installation. Any help or pointers would be extremely well received and appreciated.

In config.php is instanceid and passwordsalt stored: Configuration Parameters — Nextcloud latest Administration Manual latest documentation

I am sorry, but I don’t think this is possible without the passwordsalt and instanceid.

You could extract calendars and addressbooks with my script calcardbackup. Have a look at section „Does this work with a broken Nextcloud instance“ in the README of the script. You need your database credentials for this to work though.

Thank you very much. I will definitely have a look at that.

Hmmm, is there a possible way to perhaps get nextcloud to rescan the files on the filesystem? They’re all still there. Perhaps set it up with a new DB and re-import the data again or something like that?

Would it be possible to restore the file from a backup?

I wasn’t really “aware” as such of the data within the config.php file, which I should’ve checked regardless. So it wasn’t part of any backups I’m making.

Yes, this is possible via occ. Have a look at this:
https://docs.nextcloud.com/server/stable/admin_manual/configuration_server/occ_command.html#file-operations-label

Thank you very much. I will give this a shot.

I was able to restore the config.php file from a nextcloud backup that occurred when I updated the nextcloud versions. I am so grateful for nextcloud on doing this!

Thank you guys and thank you @ChristophWurst for your suggestion.

For anybody else who runs into this issue, you could have a backup of the config.php file in your Nextcloud data location.

e.g.
/var/www/nextcloud/data/updater-sdafsdsfd/backups/nextcloud-14.0.6.0/config/

4 Likes

This topic was automatically closed after 3 days. New replies are no longer allowed.