New user; Unraid; Nextcloud-ffmpeg; Postgres; Corrupt DB; No backups

Nextcloud version (eg, 20.0.5):
Operating system and version (eg, Ubuntu 20.04): Unraid 6.12.4
Apache or nginx version (eg, Apache 2.4.25): nginx/1.23.3
PHP version (eg, 7.4): PHP 8.2.7

The issue you are facing:

I have installed nextcloud-ffmpeg from community applications, it is just packaged with ffmpeg, released by kirah. I’ve installed PosgresSQL 15 from community applications. No issues with configuring or running nextlcoud.

Yesterday I wanted to install firefly, and so I tried to install another instance of PostgresSQL 15, unfortunately I made a massive mistake of installing the instance in the same directory and tried to run it with firefly. This caused the original Postgres container to disappear and nextcloud no longer can function.

I have stopped nextcloud and postgres, copied postgres directory to another location and took ownership of files inside. I have not touched nextcloud directory.

I have attempted to create a new postgres container fresh, however, the tables are not created by nextcloud when connected, so I am unable to access nextcloud. I’ve tried to create a few tables manually, based on errors it threw, but I do not know what their structure is like as far as data type for columns and relationships that should exist.

Since I’m new to this, I have learned now my lesson to create frequent backups of Nextcloud and Database in the future, but I do not have any official backups, just directories after the corruption.

I would like to find out if it is possible to create or re-create a database, so that I am able to access stored media in the Nextcloud data, and how can I try to accomplish that?

Is this the first time you’ve seen this error? (Y/N): Y

Thank you all for any insight you are able to provide.

Unless you were using Object Storage (e.g. S3), your files are located on the filesystem of your old Nextcloud Server and not within the database (fortunately). Those files can easily be imported into a new installation of Nextcloud.

You won’t be able to recreate the database.

Based on what you’ve shared is your situation I’d suggest:

  • Leaving your existing Nextcloud installation as-is
  • A new Nextcloud Server installation (and DB)
  • Recreate your user(s)

Once the new installation is on-line:

  • Copy over the contents of the <installation_path>/data/files folder to your new Nextcloud Server’s <installation_path>/data/files folder
  • Trigger a files scan[1]

I’m also assuming you were not using:

  • groupfolders
  • encryption
  • end_to_end_encryption

Keep in mind that anything not stored in regular user files is lost:

  • contacts
  • calendar
  • various bits of data used by whatever apps you have/had installed

Technically some of the app related data may still be in the data/appdata_* but that will be a headache to deal with for the most part. Hopefully you don’t have a need to do so.

Oh, and archive everything from the old Server just in case you need it later on.

[1] Using the occ command — Nextcloud latest Administration Manual latest documentation

1 Like

Thank you very much for your help, that really helped me out. I didn’t realize that all the files still were available once directory is taken ownership of.

I copied the user data, but even after scanning nothing is showing up. Though it does look like nextcloud is finding PROPFIND, so maybe they’ll show up after a more thorough scan, otherwise I guess I can just do it manually.

^ messed up with my new setup, created a separate directory for data and looked in the wrong place.

I indeed do not have anything encrypted, so I guess that helps make this simple.

Thank you for your help.

1 Like

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