Need help recovering data

Nextcloud version (eg, 20.0.5): 22.1.1
Operating system and version (eg, Ubuntu 20.04): Ubuntu 20.04
Apache or nginx version (eg, Apache 2.4.25): Apache 2.4.41
PHP version (eg, 7.4): 7.3

Hey guys. So im in a problematic situation right now. After a series of unlucky events I lost my nextcloud database and the backup of it. I still have all the data + the encryption keys however im unable to get the data working again. Another thread with the same issue said that after a clean install and re-creating the accounts with the exact same name etc. I can just add the files and keys back, runn occ:scan and it would work again but thats not the case. After doing said steps the files did appear again however they were unreadable by the User. I really need help getting the data back. I have the entire data directory so please let me know how I can fix this issue!

The output of your Nextcloud log in Admin > Logging:

[PHP] Error: imagecreatefromstring(): Empty string or invalid image at /var/www/nextcloud/lib/private/legacy/OC_Image.php#652

GET /core/preview?fileId=521&x=1360&y=768&a=true
from IP by CynthiaAI at 2021-09-29T07:25:00+00:00

[PHP] Error: file_get_contents(/var/www/nextcloud-data/CynthiaAI/files/tmp/oc_tmp_hKuD1l): failed to open stream: No such file or directory at /var/www/nextcloud/lib/private/Files/Storage/Local.php#277

GET /core/preview?fileId=521&x=1360&y=768&a=true
from IP by CynthiaAI at 2021-09-29T07:25:00+00:00

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

<?php
$CONFIG = array (
  'instanceid' => '[REDACTED]',
  'passwordsalt' => '[REDACTED]',
  'secret' => '[REDACTED]',
  'trusted_domains' => 
  array (
    0 => 'cloud.cynthiaai.de',
  ),
  'datadirectory' => '/var/www/nextcloud-data/',
  'dbtype' => 'mysql',
  'version' => '22.1.1.2',
  'overwrite.cli.url' => 'http://cloud.cynthiaai.de',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => '[REDACTED]',
  'dbpassword' => '[REDACTED]',
  'installed' => true,
  'memcache.distributed' => '\\OC\\Memcache\\Redis',
  'memcache.local' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'htaccess.RewriteBase' => '/',
  'integrity.check.disabled' => true,
  'default_phone_region' => 'DE',
  'auth.webauthn.enabled' => false,
  'enable_previews' => true,
  'enabledPreviewProviders' => 
  array (
    0 => 'OC\\Preview\\Image',
    1 => 'OC\\Preview\\Movie',
    2 => 'OC\\Preview\\TXT',
    3 => 'OC\\Preview\\MP3',
    4 => 'OC\\Preview\\MKV',
    5 => 'OC\\Preview\\MP4',
    6 => 'OC\\Preview\\AVI',
  ),
  'app_install_overwrite' => 
  array (
    0 => 'occweb',
    1 => 'dropit',
    2 => 'end_to_end_encryption',
    3 => 'drop_account',
    4 => 'emlviewer',
    5 => 'epubreader',
    6 => 'limit_login_to_ip',
    7 => 'nextbackup',
    8 => 'socialsharing_email',
    9 => 'socialsharing_facebook',
    10 => 'socialsharing_twitter',
    11 => 'socialsharing_diaspora',
    12 => 'hsts',
  ),
  'maintenance' => false,
  'path' => '',
  'ncd_yt_binary' => '/usr/local/bin/youtube-dl',
  'ncd_aria2_binary' => '/usr/bin/aria2c',
);

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

./.

Really dont know what to do so please let me know!

Encryption makes this part a bit difficult, there are a few topics around that:

And someone implemented a recovery tool:

1 Like