Mysql tables explanation

Is there anywhere having the explanation of MySQL tables using in Seafile?

No there’s no table explanation. Maybe somewhere in source code.

You have 3 databases which I mean are self explained.
ccnet-db - Holding User, groups, creadentials LDAP users etc.
seahub-db - Holding server settings, Seahub settings, file sharing, avatars, logs etc
seafile-db - Holding every file/repo informations, permissions, etc.

in shortcut. CCNET is about users, groups. Seahub is about social and personal things. Seafile is about files/folder.

Every table have I think good naming so there’s not need any comment.

I think, that maybe will be better say what you need TODO, maybe we can find solution over API instead of touching database which I cannot recommend to you casue you can drop your instance and say bye to your files.

3 Likes

Thanks for answering. What I want to do is finding a way for restoring files, in case of users delete from their Trash. Setting up a slave server is out of the question because clients will not pay double.

Currently, I have R1soft already, which is backing up all files, folders, and databases. That’s why I want to understand the database structure so that it might help in restoration in my case.

From my knowledge, theres no way restore file after clean trash, only way is maybe over library history. In DB are no information about files, only share download/upload links. All data are in seafile-data folder, there are file’s metadata and contents chunked to blocks.

If you clean trash, there is really hard way to found file information and content in seafile-data folder cause they will stay there until you run seaf-gc.sh script.

I know that this is not solution for you but it’s customer’s responsibility that they clean trash. I think that develop working solution for your problem is not profitable cause you will spend tons of hours to do it and next seafile release can change data sctructure and you will be on start again.

Another solution is disable trash clean it should be easest than restore files :smiley:

EDIT: Easest answer for your first question is, there’s no high priority tables in DB(what I know) and you should be able to restore seafile files without DB. But DB backups are good for fast Seafile instance restoring.

Disable trash clean is a good option. But I don’t see anywhere in the settings? Can you guide me where it is please?

What I know, there’s not official method to disable trash cleaning, but it’s easiest to delete button in template then write restoring script from data folder. I will look into it on Monday

1 Like

Just remove the button via css, this should be easy to maintain also.
On the other hand have your clients sign that you are not responsible to restore their data if they delete files from the trash. Or put this into the AGBs (terms of use). Of course have a lawer check the wording.

1 Like

@hungpham sorry I forgot for this thread,

as @DerDanilo said easy way is use Custome CSS for Seahub and put there small style declaration.

#online-gc {
   display: none;
}

After this just check on every server update that the button ID attribute not changed.

@DerDanilo Thanks for remind :wink: :smiley:

2 Likes