HELP! Nextcloud nuked my files

Really?..

I just reinstalled my Nextcloud server, installed apps, and connected my clients. When I went to sync however to my surprise, the Nextcloud client F*CKING DELETED ALL THE FILES ON MY LOCAL MACHINE. Years worth of files from family photos, to WORK DOCUMENTS, all my receipts, shit from my past life, and EVERYTHING else I had in that folder.

Is there any way to get this files back? This shouldn’t have happened WTF?

The client decided it wanted to take the files from the server-side and delete everything on my laptop. BULLSHIT.

Beyond pissed,
orphadon

Usually it sends it to the thrashbin.

And you should be able to find it in the backup you naturally did before “wiping” your old server.

Could you clarify what you mean by this? Clean install? Backup restore?

2 Likes

Thank you for you comment. I’m using the macOS client and I don’t see any of my files on the garbage can.

Backups, here’s my situation — I got some of my files back from the last sync the server did (one week ago) but since then, I’ve added to that folder while the server wasn’t syncing. So, any file that was written to after that week is now gone.

What happened is when I had connected my Nextcloud client to my server, the client had taken the server’s version and deleted everything on the client ~/Nextcloud folder. The only items in that now are the files that come pre-shipped with Bextcloud. Like, “Welcome to Nextcloud.md”

I use docker compose with a physical SSD mounted to the data folder. When I want a fresh install, I delete the database and non-/data volumes and startup Nextcloud again.

What it looks like:

  1. docker compose down
  2. docker volume rm nextcloud_core (oci volume) nextcloud_db (database volume)
  3. docker compose up -d
  4. Complete installation.

I have to preform this process ever-so-often because Nextcloud is a very fragile piece of software. Throughout this process, I’m think more and more about moving to TrueNAS as it’s way more stable.

I’d still like to get my files back, however.

That is very far away from a supported way of doing updates… Did you always do it like this?
Deleting the database is a very bad idea, it contains all reference to files, shares, users, etc. If it is removed, you start up fresh, no known files, users or clients.

  • So just to be sure, your files are still on the /data-volume or is it now empty?

  • Also, how did you connect your client again to Nextcloud, if the database was cleared?

How do you come to this conclusion? Nextcloud is neither fragile, nor does it need re-installations. Even my private instance exists since Nextcloud 13 and I never had to re-install or delete the database…

2 Likes

Please take responsibility. You nuked your files by deleting your volumes. This is entirely your own fault.

Volumes are not removed by any action performed on an image or container, because they are real & persistent. What you deleted was the location on the filesystem holding all of your data.

Apologies for being so blunt, and I hope you can learn from this experience to:

  • Backup your volumes always
  • Know how to recover your volumes
  • Learn how to use docker compose in manner that does not require rm.
  • Good luck!

Can a mod please re-write the name of this to: Help! I rm'ed my data directory and hope to recover it!

No, this is not how I do updates, I had to reinitialize my instance because my NVMe drive ran out of disk space and Nextcloud no longer wanted to work afterwards, stating “Internal server error” every time I refresh the page.

Updates are managed with docker compose pull with no volumes being deleted.

No, if you read the message, I said all my data is on a physical drive, not in nextcloud_db. That volume is a persistent storage container for my postgres server and nextcloud_core is for /var/www.

I see, it sounded like that is your usual way of doing updates.

But still: How exactly did you connect your client to the freshly installed instance?

Sorry for the misunderstanding.

I reconnected my client by logging out from old install and reconnecting it via oauth with the new server (link account screen).

We just checked some scenarios internally here:

  • Removing and adding an account shows a dialog that lets you choose what happens with your local files (keep or start clean)
  • Removing the account, then removing files from the server and connecting the account again will upload the files (although that was done with the same server, so the results may vary here. Also see Restoring backup — Nextcloud latest Administration Manual latest documentation)
  • Removing the account, putting other files on the server, connecting the account again results in merged data.

So I am really not sure what happened in your case… I would say let’s go one step back and try to collect the missing informations:

  • Which Nextcloud version are you using?
  • You said you used the MacOS client, did you use the normal client or the virtual files client? Also which version of the client are you using?
  • After you finished the installation, were you able to access your files on the web? (I assume no, because you said something about the default files?)
  • Are there files still on your external drive?
  • Can you please save the logfiles from the Desktop client (see desktop/doc/troubleshooting.rst at master · nextcloud/desktop · GitHub)
3 Likes

Sorry, late response. I just got hit with a wave of busyness.

My response to the first three bullets:

  • I didn’t get a popup dialog that gave me a choice to chose between the server or client version.
  • (2&3) Correct, I removed the account client-side and reconnected it once I setup Nextcloud again. When it went to sync however, it didn’t upload files from the client, instead it deleted all the files on the client and downloaded files from the server. The files that were downloaded includes the files that come with Nextcloud.

Next five bullets:

  • Nextcloud Docker 29.0.4 via nextcloud:fpm-docker
  • I used the normal Nextcloud client version 3.31.3 Apple Silicon
  • I wasn’t able to access my files anywhere client or server. The default files I’ve been mentioning are the ones that come packaged with Nextcloud like “Welcome to Nextcloud.md”, “README.md”, …
  • Other than the backups I took, no.
  • I will come back and post the logs once I have more time — if only we didn’t need sleep…

Thanks!

So the server was rebuilt w/o any data? And the aim was to upload from the client rather than restore the server from a backup, correct?

Sounds like the data-fingerprint step was maybe overlooked: Restoring backup — Nextcloud latest Administration Manual latest documentation

2 Likes

Ahh, that might’ve been it. Well thanks! I’m glad I had backups.