All files lost after NextCloudPi upgraded to v1.48.2 (and again all lost upgrading to v.1.49.1)


my NextCloudPi just upgraded to v1.48.2 - now all files are lost.

Weblogin still running, also calendar, bookmarks still available but user files are gone and synched laptop now also empty …

Before I do something silly: is this a known issue ? any suggestion before I start from scratch?



1 Like

Hi, I’m very sorry that this happened to you. Can you please give additional information about your system:

Are you running ncp via docker or on which kind of setup?
Has your data directory been moved to an external disk or does it still reside in /var/www/nextcloud/data?

For simplicity, please attach the output of the command ncp-report.

FYI: During Nextcloud updates (which was probably what cost you your files, although I don’t understand yet how it could happen), a backup is created. That should still be available and contain your data if it was actually deleted.

1 Like

Hi @theCalcaholic,

thank you very much for your response.

NCP running on a Pi4 without docker … did a ncp-report but that contains too many sensitive data.

What happened is extremely strange, I must start from beginning … there are 3 PCs syncing to NCP

PC1 last used July 13th (deprecated)
PC2 last used July 21st 12:00h (most current)
PC3 last used July 21st 15:00h (most current)

I noticed today on PC3 that sync directory was empty, used web login, all files gone but calendar, bookmarks etc. still there - notifications showed that NCP updated this morning

I checked PC2, sync directory was empty, too

I disconnected PC1 from network before starting it, sync directory was there status July13th (deprecated) - I made a (deprecated) backup of PC1

I SSH’d into NCP and found all files status July 21st (most current) were in /var/www/ncp-data.DBmfcR//files … I squeezed them into a tar file and saved it …

I then connected PC1 to the network and - strange enough - it did not purge the sync directory like PC2 and PC3, but it synced back (deprecated) version July 13th to NCP - so now I have on NCP and PC1 the deprecated version and in my tar file the most current version.

Deprecated but fully synced data on NCP are now on /var/www/nextcloud/data//files

I’ll be able to merge them with my backup, so actually my problem is solved, although the experience was pretty awkward and I learned, I have to put more effort in backing up NCP daily to be protected against such surprises purging data on all connected PCs …

Question: is /var/www/ncp-data.DBmfcR//files the backup, which was created during upgrade ?

Thanks for reading :wink:



I am also suffering from the same “all files and folders deleted” issue.
If I remember correctly, my problem started when NCP was automatically updated to 1.48.1.
When the problem started all files and folders saved with NCP (running on UnRAID as a docker app) were deleted and they were also deleted from my laptop, that was synced to the UnRAID server using the NC desktop app.
@theCalcaholic can you please explain where we can find the backup NCP creates automatically when NC is updated?

1 Like

Here is the issue I reported last week:

“creates a backup of the existing code base in /updater-INSTANCEID/backups/nextcloud-CURRENTVERSION/ inside of the data directory (this does not contain the /data directory nor the database)”

Source: Upgrade via built-in updater — Nextcloud latest Administration Manual latest documentation

I can confirm I am having the same issue. I just want to add a few more context, in case it helps the devs.

My setup is NCP install on RPi 4

NextCloudPi diagnostics

NextCloudPi version  v1.48.2
NextCloudPi image    NextCloudPi_03-02-22
OS                   Debian GNU/Linux 11. 5.15.32-v8+ (aarch64)
automount            yes
USB devices          sda sdb 
datadir              /var/www/nextcloud/data
data in SD           yes
data filesystem      ext2/ext3
data disk usage      28G/59G
rootfs usage         28G/59G
swapfile             /var/swap
dbdir                /var/lib/mysql
Nextcloud check      ok
Nextcloud version
HTTPD service        up
PHP service          up
MariaDB service      up
Redis service        up
HPB service          up
Postfix service      up
internet check       no
port check 80        open
port check 443       open
IP                   ***REMOVED SENSITIVE VALUE***
gateway              ***REMOVED SENSITIVE VALUE***
interface            wlan0
certificates         ***REMOVED SENSITIVE VALUE***
NAT loopback         yes
uptime               44days

Nextcloud configuration

    "system": {
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": {
            "0": "localhost",
            "7": "nextcloudpi",
            "5": "nextcloudpi.local",
            "8": "nextcloudpi.lan",
            "3": "***REMOVED SENSITIVE VALUE***",
            "11": "***REMOVED SENSITIVE VALUE***",
            "1": "***REMOVED SENSITIVE VALUE***",
            "14": "nextcloudpi",
            "2": "***REMOVED SENSITIVE VALUE***",
            "20": "***REMOVED SENSITIVE VALUE***",
            "22": "***REMOVED SENSITIVE VALUE***"
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "",
        "overwrite.cli.url": "https:\/\/***REMOVED SENSITIVE VALUE***\/",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "memcache.local": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 0,
            "timeout": 0,
            "password": "***REMOVED SENSITIVE VALUE***"
        "tempdirectory": "\/var\/www\/nextcloud\/data\/tmp",
        "mail_smtpmode": "sendmail",
        "mail_smtpauthtype": "LOGIN",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "preview_max_x": "2048",
        "preview_max_y": "2048",
        "jpeg_quality": "60",
        "overwriteprotocol": "https",
        "trusted_proxies": "***REMOVED SENSITIVE VALUE***",
        "maintenance": false,
        "loglevel": "2",
        "log_type": "file",
        "default_phone_region": "US",
        "twofactor_enforced": "true",
        "twofactor_enforced_groups": [],
        "twofactor_enforced_excluded_groups": [],
        "logfile": "\/var\/www\/nextcloud\/data\/nextcloud.log",
        "data-fingerprint": "***REMOVED SENSITIVE VALUE***",
        "updater.secret": "***REMOVED SENSITIVE VALUE***",
        "theme": ""

My NCP instance is set at NCP, NC, NC-app auto update setting.

On the same day, after the auto update to NCP version v.1.48.2, I noticed that all the folder and files were not visible.

Also (may not be relevant to this problem), I noticed that the port check 80 and 443 status were ‘closed’. I fixed this issue according to this post:

When I ran this command:

sudo -u www-data php /var/www/nextcloud/occ files:scan --all

All the folder/files reappeared. However, they disappeared again after a day. So running the same command bring them back. But this is temporary as mentioned, after some time it disappears again. Not sure if this is related to indexing?

I hope this info helps.

1 Like

Thank you @spiritualcrab for giving me hope to bring back my files using the occ scan command.
I’m not sure how to run occ when NextcloudPi is installed on UnRAID using a docker app.
Will running nc-scan in the NextcloudPi dashboard serve the same purpose as running the occ command you mentioned?

sudo -u www-data php /var/www/nextcloud/occ files:scan --all

Are these similar processes?


I am not sure if this is the same thing.

I SSH to my instance, and then ran the command through terminal.

On the side note, please don’t get disheartened if you mess up your insurance or fail to fix it. Learning comes from several failures. I have been running Nextcloud for 4 years now, and still mess it up.

You will eventually get the ins and out of this. Just keep exploring and asking.

All the best.

1 Like

@manankanchu @mjeshurun @spiritualcrab If something goes wrong during an automatic or manual nextcloud update using ncp’s builtin updater, a backup of your files will be created in /var/www/ncp-data.XXXXXX (XXXXXX being a random string of characters), unless your data isn’t stored in /var/www/nextcloud/data anymore, in which case it can’t be lost during the update.

So, @manankanchu, yes, that folder should contain your data as it was before the update.

Sorry for the late reply. I should check the forum more often

1 Like

You seem to have an entirely different problem. That sounds like your database crashes/get’s lost on a regular basis which might be caused by a bad disk.

Thanks for your reply, great to hear, that in such case a full file backup is available - solved my problem …

1 Like

NCP upgraded to v1.49.1 and AGAIN ALL FILES LOST.

That’s seriously unacceptable, will migrate away from NCP …

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.