Repeated database errors after recovering from backup

Nextcloud version (eg, 29.0.5): 28.0.6.1
Operating system and version (eg, Ubuntu 29.04): Ubuntu 22.04.4 LTS x86_64

My Nextcloud instance broke for some reason so I decided to recover from a recent backup. I am unable to recover the backup. I’m confronted with database error messages since my nextcloud instance broke.

I’ve been running the snap version of Nextcloud. I hope someone can give me a clue, I’ve been trying to recover my Nextcloud instance for the last three days an I’ve run out of ideas.

Steps to replicate it:

  1. Uninstall and purge Nextcloud from snap
  2. Reinstall Nextcloud
  3. Run the nextcloud.import command

The output of your Nextcloud log in Admin > Logging:

cat: /var/snap/nextcloud/common/nextcloud/data/nextcloud.log: No such file or directory

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

<?php
$CONFIG = array (
  'apps_paths' => 
  array (
    0 => 
    array (
      'path' => '/snap/nextcloud/current/htdocs/apps',
      'url' => '/apps',
      'writable' => false,
    ),
    1 => 
    array (
      'path' => '/var/snap/nextcloud/current/nextcloud/extra-apps',
      'url' => '/extra-apps',
      'writable' => true,
    ),
  ),
  'supportedDatabases' => 
  array (
    0 => 'mysql',
  ),
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'memcache.local' => '\\OC\\Memcache\\Redis',
  'redis' => 
  array (
    'host' => '/tmp/sockets/redis.sock',
    'port' => 0,
  ),
  'log_type' => 'file',
  'logfile' => '/var/snap/nextcloud/current/logs/nextcloud.log',
  'logfilemode' => 416,
  'maintenance_window_start' => 1,
  'instanceid' => 'oc214y690tfs',
  'passwordsalt' => 'uLgeMtsMQciopXnIsspT2Bqo4ywf2x',
  'secret' => 'Ge2xK7U2MUVCvYB6z+a20ZWur+EQFlXi9DfNQCsuHvI5GdDi',
  'trusted_domains' => 
  array (
    0 => '192.168.178.49',
  ),
  'datadirectory' => '/var/snap/nextcloud/common/nextcloud/data',
  'dbtype' => 'mysql',
  'version' => '28.0.6.1',
  'overwrite.cli.url' => 'http://192.168.178.49',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost:/tmp/sockets/mysql.sock',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'nextcloud',
  'dbpassword' => 'tRFqTCXcohveKNu1zBR5NR7OYJHgWynBl64xIqDYMPcWiskk6k0UqyJzEWOGqaIO',
  'installed' => true,
  'maintenance' => true,
);

The output of your Apache/nginx/system log in /var/log/____:

ls: cannot access '/var/snap/nextcloud/current/apache/logs': No such file or directory

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.