# Need help recovering data

**URL:** <https://help.nextcloud.com/t/need-help-recovering-data/124478>\
**Category:** ℹ️ Support\
**Tags:** nc22, encryption-server\
**Created:** [September 29, 2021, 7:33am UTC](https://help.nextcloud.com/t/need-help-recovering-data/124478 "2021-09-29T07:33:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Clara\_Crazy](https://help.nextcloud.com/letter_avatar/clara_crazy/32/5_5575768a8748004e209b776fc1b2916d.png) [@Clara\_Crazy](https://help.nextcloud.com/u/Clara_Crazy)\
**Post date:** [September 29, 2021, 7:33am UTC](https://help.nextcloud.com/t/need-help-recovering-data/124478/1 "2021-09-29T07:33:42Z")

</div>

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** :

```auto
[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!):

```auto
<?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/ ____ `:

```auto
./.

```

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

---

<div class="post-metadata">

**Author:** ![tflidd](https://help.nextcloud.com/letter_avatar/tflidd/32/5_5575768a8748004e209b776fc1b2916d.png) [@tflidd](https://help.nextcloud.com/u/tflidd)\
**Post date:** [September 29, 2021, 2:45pm UTC](https://help.nextcloud.com/t/need-help-recovering-data/124478/2 "2021-09-29T14:45:32Z")

</div>

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

> [@Decrypt encrypted datas.. Need your help!.. (Without database)](https://help.nextcloud.com/t/decrypt-encrypted-datas-need-your-help-without-database/7275):
>
> Hey dear nextcloud Support and other helpers!! I’m in big trouble… I reinstall my Server and install nextcloud v11. I import my data folder, themes folder and the config folder, but now I have seen, I forgott to backup my database. Now my question… How can I decrypt my files without database? Befor reinstall I was on nextcloud v10. I try since ~2 Days and I can’t fix my problem… Can anyone help me? (occ can’t decrypt it, everytime it says: Files for following users couldn't be decrypted, mayb…

And someone implemented a recovery tool:

> **[GitHub - syseleven/nextcloud-tools: This project contains tools to operate...](https://github.com/syseleven/nextcloud-tools)**
>
> This project contains tools to operate Nextcloud. Contribute to syseleven/nextcloud-tools development by creating an account on GitHub.

---

<div class="post-metadata">

**Author:** ![wwe](https://help.nextcloud.com/user_avatar/help.nextcloud.com/wwe/32/72963_2.png) [@wwe](https://help.nextcloud.com/u/wwe)\
**Post date:** [December 14, 2024, 3:20pm UTC](https://help.nextcloud.com/t/need-help-recovering-data/124478/3 "2024-12-14T15:20:19Z")

</div>



---

<div class="post-metadata">

**Author:** ![wwe](https://help.nextcloud.com/user_avatar/help.nextcloud.com/wwe/32/72963_2.png) [@wwe](https://help.nextcloud.com/u/wwe)\
**Post date:** [December 14, 2024, 3:20pm UTC](https://help.nextcloud.com/t/need-help-recovering-data/124478/4 "2024-12-14T15:20:20Z")

</div>


