Install with existing database and config.php (recover without config folder)

Hi,
I’ve deleted my nextcloud config folder… But I have a backup of config.php! Is it possible to make a new installation with an existing database and config.php files only (the database and the data folder are safe)?

Yes, as long you have the Database and the config.php you can rebuild your instance.

Can you send more information about your Setup ?
Have you shell Access ? Private Server or Hosting Provider ? Raspberry Image, Docker, VM ?

1 Like

Hi, thank you for the response!
My nextcloud istance is hosted on an Ubuntu 20 dedicated server (I have full root access) and I’m using the linuxserver/nextcloud docker image.

Great, i use that too and i too have deleted my config folder accidentally once :grinning:.

I fixed it by manually downloading the nextcloud server zip file from here and extracting it into the /config/www/nextcloud/ folder (if it is not empty remove the contents, but don’t delete your backup of the config.php). Then copy the config file backup into /config/www/nextcloud/config/

This should restore your instance.

Make sure to download the same version of the server as you had before !!!

1 Like

Hi! I have followed your instructions but when I try to access the web interface I get this error:

Internal Server Error
The server encountered an internal error and was unable to complete your request.
Please contact the server administrator if this error reappears multiple times, please include the technical details below in your report.
More details can be found in the server log.

In /config/log/nginx/error.log the error message is: Could not get appdata folder for js

/config/log/nginx/error.log:

2020/08/30 15:19:24 [error] 370#370: *25 FastCGI sent in stderr: "PHP message: {"reqId":"dYi1gF3Eupza9TgxW1Wg","level":3,"time":"2020-08-30T13:19:24+00:00","remoteAddr":"172.xx.xxx.xxx","user":"paolobasso","app":"index","method":"GET","url":"/apps/files/","message":{"Exception":"RuntimeException","Message":"Could not get appdata folder for js","Code":0,"Trace":[{"file":"/config/www/nextcloud/lib/private/Files/AppData/AppData.php","line":157,"function":"getAppDataFolder","class":"OC\\Files\\AppData\\AppData","type":"->","args":[]},{"file":"/config/www/nextcloud/lib/private/Template/JSCombiner.php","line":100,"function":"newFolder","class":"OC\\Files\\AppData\\AppData","type":"->","args":["core"]},{"file":"/config/www/nextcloud/lib/private/Template/JSResourceLocator.php","line":116,"function":"process","class":"OC\\Template\\JSCombiner","type":"->","args":["/config/www/nextcloud","core/js/merged-template-prepend.json","core"]},{"file":"/config/www/nextcloud/lib/private/Template/JSResourceLocator.php","line":72,"function":"cacheAndAppendCombineJsonIfExist","class":...PHP message: {"reqId":"dYi1gF3Eupza9TgxW1Wg","level":3,"time":"2020-08-30T13:19:24+00:00","remoteAddr":"172.xx.xxx.xxx","user":"paolobasso","app":"core","method":"GET","url":"/apps/files/","message":{"Exception":"RuntimeException","Message":"Could not get appdata folder for js","Code":0,"Trace":[{"file":"/config/www/nextcloud/lib/private/Files/AppData/AppData.php","line":157,"function":"getAppDataFolder","class":"OC\\Files\\AppData\\AppData","type":"->","args":[]},{"file":"/config/www/nextcloud/lib/private/Template/JSCombiner.php","line":100,"function":"newFolder","class":"OC\\Files\\AppData\\AppData","type":"->","args":["core"]},{"file":"/config/www/nextcloud/lib/private/Template/JSResourceLocator.php","line":116,"function":"process","class":"OC\\Template\\JSCombiner","type":"->","args":["/config/www/nextcloud","core/js/merged-template-prepend.json","core"]},{"file":"/config/www/nextcloud/lib/private/Template/JSResourceLocator.php","line":72,"function

EDIT: I should say that I have full daily backups of the data folder if needed.

EDIT: I think this is an unrelated problem, the installation appears to be working because I can sync the calendar just fine; I think nextcloud is unable to access the data folder (maybe due to wrong permissions) so I will dig this error further. In the meantime thank you for the much appreciated help!

1 Like