recovery – Restore partially broken PostgreSQL Database

I have managed to break my own server, and undo months of work.

The thing is, I hosted a nextcloud instance on the server, and had it configured to use WasabiS3 as primary storage, which means the data is still intact.

However, the files are stored in a urn:oid format, which means without the database, the data is pretty much useless.

I need to recover the database that contains the filetable, but I cannot connect to pgsql.

After restoring the corrupted folder to /var/lib/postgresql/12/main, I have successfully managed to start the postgresql server.

Trying to log in using the pgsql command, however, this error is encountered.

psql: error: FATAL:  "base/16408" is not a valid data directory
DETAIL:  File "base/16408/PG_VERSION" is missing.

And, the directory /var/lib/postgresql/12/main/base/16408 is indeed empty.

However, I would at least like to restore part of the database if that is possible.
Is this a possibility?

Thanks in advance.