Config File blank after no space left on device

Nextcloud version: 25.0.3
Operating system and version : Ubuntu 22.04.1 LTS
Apache or nginx version (eg, Apache 2.4.25): Apache/2.4.52 (Ubuntu)
PHP version (eg, 7.4): 8.1.2

My harddisk got full. When this happened, suddenly my config.php was empty. The problem is I don’t have any backup of my config.php. And it seems like Nextcloud is just rewriting it without making a backup of it before doing that. So probably this failed and so my config got deleted…

What I do have is my database user and password.

Can I somehow get my system working again?

How can I build a new config file?

Thank you in advance!

I found my instanceId.
This is what I did so far:

$CONFIG = array (
  'instanceid' => 'copied from appdata folder suffix',
  'trusted_domains' => 
  array (
    0 => '',
    1 => 'localip',
  'overwrite.cli.url' => 'https://domain',
  'overwriteprotocol' => 'https',
  'overwritehost' => 'domain',
  'version' => '25.0.3',
  'dbtype' => 'mysql',
  'dbhost' => 'localhost:3306',
  'dbname' => 'nextcloud',
  'dbuser' => 'user',
  'dbpassword' => 'pw',
  'installed' => true,
  'mysql.utf8mb4' => true,
  'supportedDatabases' => 
  array (
    0 => 'sqlite',
    1 => 'mysql',
    2 => 'pgsql',
    3 => 'oci',
  'secret' => 'random stuff',
  'passwordsalt' => 'random stuff',
  'loglevel' => '1',
  'maintenance' => false,
  'theme' => '',

With this I get to thefollowing screen:

But I don’t know why it is showing me that I am updating…

Your instanceid is used in the filepathes of appdata:
and updater:

and inside of the later directory are the automatic created backups from older updates. Your config.php should be inside of that backups.

Hope that helps,
much luck!

1 Like

Thank you! I found my instanceId now. But I don’t have this update folder. I guess I didn’t do any updates yet. :confused:

1 Like

Oh I just realised that I need to set version as ‘’. now it works again!