Please HELP: accidentally deleted a user account. Can we restore?

Hi,
We had the following happening:

  1. We accidentally entered the wrong email address when creating an admin.
  2. We then deleted the admin and created the correct admin account.

Problem:

The email address entered accidentally was an existing user account.
After deleting the admin account the user account was gone too.

There’s about 600Gb of data lost now.
But when looking at the server, the used disk space did not decrease.

Is there a chance we can recover the missing files?

Thanks

We are running seafile server 6.2.5

There’s only one folder (seafile/storage/blocks/a883bea8-c147-4707-9758-c6caf78ee6cb) being over 600Gb in size. So everything should be there, right?

But “seaf-fsck.sh a883bea8-c147-4707-9758-c6caf78ee6cb” tells me:

[01/16/20 22:09:01] fsck.c(586): Running fsck for repo a883bea8-c147-4707-9758-c6caf78ee6cb.

[01/16/20 22:09:01] fsck.c(595): Repo a883bea8 doesn’t exist.

[01/16/20 22:09:01] fsck.c(650): Fsck finished for repo a883bea8.

So I can’t use seaf-fsck.sh -E to export it.

Are there other options to get the data back?

Welcome Surio!
I think you can chill out. The data is still there. You just have to recover it!
The library by your former admin should be still be available in the system administration. From there, you can recover/assign it to a new user. Hence, log in as an admin user, go to system administration, click the library menu and go to deleted. You should find the library in question there.
If not, this is last resort: https://download.seafile.com/published/seafile-manual/maintain/seafile_fsck.md
Best
Ralf

There’s nothing to be found under the admin settings > Libraries or Deleted libraries :frowning:

First of all: do NOT run the garbage collector until this is solved and no data will be lost.

From your posts I see that the library id is “a883bea8-c147-4707-9758-c6caf78ee6cb”.

I don’t know (also am not sure if I correctly understood) what exactly happened but these steps should help you:
Look into your Seafile database (either SQLite or MySQL - depending on your configuration, there usually are 3 dbs, look at seafile-db):

  • Make sure there is an entry a883bea8-c147-4707-9758-c6caf78ee6cb within the table Repo (it has only one column called repo_id)
  • Make sure there is an entry in Branch. If not you’ve to find out the latest commit. One option to do so would be finding the most recent file in seafile/storage/commits/a883bea8-c147-4707-9758-c6caf78ee6cb (the name should be a sha1 hash which can be inserted in the table as commit_id table Branch consists of name, repo_id, commit_idname is always master)
  • Make sure the id is not contained in GarbageRepos (delete row if it is there)
  • Have a look at RepoOwner if not existing add entry with repo_id and owner_id where owner_id the users email (email of the account in Seafile)

Navigate to Seahub and your library should be there.

I don’t know why that is. I thought seaf-fsck is able to export without the database. Please also check permissions of the files (for seaf-fsck.sh -E read should be sufficient, but otherwise also write).

Have you managed to recover data?

Yes. I had to manipulate the database and manually insert data but in the end all data was recovered. :slight_smile:

1 Like