Last week, I tried to upgrade the control panel software (Plesk) on work’s hosted virtual dedicated server. Its pretty straightforward, just click the button and it all works, right? Wrong! Just click the button, and Plesk misconfigures itself, killing both the control panel and all our websites…
A quick phonecall to tech support, and they say they can either (a) replace the current mess with the backup and we’ll be back up and running in 20 minutes, or (b) try to fix the current mess with the help of Plesk, which could be a while…
I went for option (a). I guess I could have gone for (b) and fiddled around with the Apache config manually, but minimizing website downtime was the priority and I reckoned (a) would be faster.
Unfortunately, option (a) meant we lost all changes made since the last backup, including a couple of small SVN commits.
Trying to commit to the restored repository resulted in “base checksum mismatch” errors for the files that had been in the lost commits. svn update also resulted in errors due to files that should have been in the repository not being there. After Googling and finding loads of stuff telling me that the repository must have got corrupted and how to fix its BDB database, it occurred to me that actually a pretty simple fix would just be to replace everything in the problem .svn folders in my working copy with what they should now have in them. So here’s what I did:
- Commit all changes that SVN will let you commit.
- Copy working copy to somewhere safe in case something goes horribly wrong.
- Checkout the directories that are causing problems as a new working copy.
- Manually copy the necessary .svn directories from the fresh working copy to the original working copy.
- svn add/delete as necessary.
- Commit changes.
Seems to have worked fine. Luckily all my changes that wouldn’t commit were in only 3 directories though, or it would have been pretty time-consuming doing all the copies!