Options to restore config.php

Nextcloud version (eg, 20.0.5): 24.0.4
Operating system and version (eg, Ubuntu 20.04): Freebsd jail 12.3-RELEASE
Apache or nginx version (eg, Apache 2.4.25): Apache/2.4.54 (FreeBSD)
PHP version (eg, 7.4): PHP 7.4.30 (cli) (built: Aug 11 2022 01:29:38) ( NTS )

The issue you are facing:

Is this the first time you’ve seen this error? (Y/N): Y

Steps to replicate it:

  1. Visit my domain “cloud.xxxx.xxx”
  2. Notice webpage gives error ‘It looks like you are trying to reinstall your Nextcloud. However the file CAN_INSTALL is missing from your config directory. Please create the file CAN_INSTALL in your config folder to continue.’
  3. Did some digging and found out my config.php content only has instancesId

The output of your config.php file in /usr/local/www/nextcloud/config/config.php

<?php
$CONFIG = array (
  'instanceid' => 'an id value not sure how to verify',
);

Output errors in nextcloud.log in /var/www/ or as admin user in top right menu, filtering for errors. Use a pastebin service if necessary.
cat /var/log/nextcloud/nextcloud.log
Gives empty result.

My config.php got blown away after I restart my server and my jail(container) instances, I don’t have a backup because I stupidly rm -r /usr/local/www/nextcloud-old/ directory which has the config/config.php folder. :person_facepalming:

What are my choices to get my service back running? Am I gonna loose all my data?

Next cloud when using online updater provides back up for config.php by default. Thanks Nextcloud for doing this and it saved my butt. haha. Location is here:

cat /mnt/data/updater-snadfnes/backups/nextcloud-23.0.8.1-1662165509/config/config.php

Modify the content to match your current install version and updater.secret change to 'updater.release.channel' => 'stable',

After making the change visit the website will prompt you to update. Click on the update button will fix the system.