I messed up the db

Hey guys and gals!

I kinda messed up a fair bit. :man_facepalming:t3:

I had the problem, that files would no longer update due to the known “file locked” issue. This has happened a few times before, so I knew to delete the oc_file_locks part of the db. I am on shared hosting, so I did that with phpMyAdmin. This has never caused an issue in the past, so I didn’t bother making a backup before I did this. The fact that the whole backup process takes quite a while helped my questionable decision along. :see_no_evil: Where I really messed up was the actual delete. I didn’t empty the table, I dropped it, meaning the whole table (or sub-table) is now missing.

Please don’t lecture me on being an idiot. I figured that part out myself. :stuck_out_tongue_closed_eyes:

While all the files are still on the server (and synced across multiple machines), within the web interface no files are displayed. The error message says the directory is not available and the log tells me, the said table (oc_file_locks) is missing.

Since all the files are still there and I am guessing that oc_file_locks is not the centre of the whole db, I have hopes, that it can be rebuilt - somehow. And I hope that you guys know a way. :innocent:

As I already mentioned, I am on shared hosting. I have shell access, but no root access. This means, I would prefer a fix/rebuild that works without root access. If that is not possible, I could contact tech support. We are on friendly terms and I am pretty sure they would run a command for me if I asked nicely. I however have to be reasonably sure that the command will work, because that probably won’t run 5 or 6 commands for me. :crazy_face:

Does anyone have an idea how I could remedy my screwup?

Thanks so far for reading! :pray:t3:

Cheers!
Chris

I actually found the solution myself. :nerd_face:
The process was slightly lengthy and therefore ball-busting, but it worked. :slightly_smiling_face:

What I did:
I set up a new (and separate) instance of NC, with new db and everything. I logged in to make sure that all tables in the db were created.

My production-instance of NC is rather old now. It has been updated on a regular basis, so it was on v26 when I broke it, so the tables are still called oc_somehting_or_other, as written in the original post. The tables are also still in the (older) utf8bin format.

Now I just exported the table in question from the new db, imported it into the old one, renamed it and converted it to utf8bin. Not sure if both of the last two steps were strictly necessary, but they seemed “prudent” at least. After leaving maintenance mode, everything worked again.

I hope, this info helps someone in the future who is just as dumb as I was. :nerd_face: :smiling_imp:

Best regards!
Chris