Repairing/Rebuildng SeaFile from seafile data directory without DB

Hi SeaFilers…

I’m in the process of migrating a SeaFile containerized instance (podman), and have mistakenly moved the db directory to a location (which I temporarily lost & found luckily)… If in such occurrence, I still have the data on the clients, and seafile directory on the server.

  1. Is it possible to rebuild the sql from the seafile data?

  2. Also, if I recover a sql backup which is 1 month old, into the db. And then run fsck repair, what will happen with the new and updated files in the seafile server (data blocks) last few days? Will they be deleted?

Hi Jon,

It is funny that you say this, I wrote a documentation on how to fix this due to me having the same issue! (Database got wiped).

Please use this guide for reference:

Long story short, it’s a case of rebuilding the database with the folder entries.

The issue you may find is getting the folders re-assigned to the correct people so in my case I just assigned them all to the admin and then re-distributed the files.

You will need to re-create the user accounts this way, but if you have a backup of the database, just use that and then remove all of the entries for the folders and re-add them using the entires from the forum.

Any questions, please let me know!

Kind regards,
Mitch

1 Like

Much appreciated Mitch. Will keep this handy for the next upgrade and hope that no one will ever have to resort to it.

All the best…
Jon