Help, repaired library to earlier commit

The long and the short of it is: I was upgrading my version of Seafile Server from 4.1.2 to 6.x, and forgot that I had been running [for some stupid reason] Seafile as root instead of the seafile user. Well, after the [easy!] upgrade, I started my server back up as the seafile user, only to find many/most of my libraries saying “Broken (please contact your administrator to fix this library)”. Eventually I found my way to the seaf-fsck.sh script, which was able to repair one of my key libraries, but only back to how it was in May of 2015.

Since then, I realized that root owned many of the files in my seafile-data dir, which was the root cause of the issues.

My question is: now that I’ve changed the owner back to seafile, how can I restore this library to the latest commit it should be on?

I’ve also seemingly found the correct HEAD commit by looking at file modification dates in the commits dir of the project in seafile-data. It’s also possible I have other libraries that I’ve repaired and have gone back too far in history. I’ve tried running seaf-fsck again, hoping it’d grab the latest commit, but alas, no go.

Thanks!!

You can move the current HEAD commit file to another place and run seaf-fsck again. seaf-fsck will search for the latest commit using the file modification time and restore the library to that commit. Then you move the old HEAD commit file back.

OK, so just so I’m 100% absolutely sure - let’s call them Commits G and Z, G being from 2015 and Z being from yesterday before my botched upgrade. Right now it thinks the head is G, but really it should be Z. So you’re saying I should move G somewhere out of the way, run fsck again and then it’ll be able to find Z, which would allow me to safely move G back into place?

Yes. This is what I mean.