Wiki Upgrade

After getting the Flashlight Wiki secured, I wanted to upgrade the MediaWiki software to the latest version. I am running v1.16 from when I installed it last year, but since then they have come out with v.1.17. I’m not sure that 1.17 offers a whole lot, but I thought I would try the upgrade. I have been doing backups of the wiki almost weekly. I export the MySQL database that the wiki is based on, compressing it to a zip file first. This is about 1.5MB. Periodically I will also create a zip archive of the entire wiki folder and all the files it contains. This archive is about 20MB. It has all the images, all the installation files, the settings, and pretty much everything that makes it work except the content which is all in the database. Actually it has the content as well since the pages are actually generated and cached in folders.


I always wondered if I lost everything would I be able to reinstall the database and the Wiki from the backups and have everything running again. It is one thing to do backups, it is another to actually be able to recover.

Anyway, the first step towards upgrading the wiki is doing a complete backup, so I did that first. Then I downloaded the latest version of the software to my hard drive, then uploaded that file to the web server (it would save a lot of time to download the file directly from MediaWiki to my web server, but I don’t know how).

Once the installation file is on the server, you can extract all the thousands of files that make up the installation. They are in all kinds of folders. Then I made a backup copy of my localsettings.php file and dragged all of the new files and folders and everything onto my old installation. For some reason I thought that’s what you were supposed to do, but in doing so, I didn’t get everything and now I had remnants of the old installation mixed in with new stuff. Essentially I had ruined both folders and now neither place would work.

So I uploaded my zipped archive of all the files I had backed up. This takes a very long time because my DSL speed isn’t that great in the first place and upload speed is a fraction of the download speed. Did all that and the site worked again. So at least the backup of files is working.

I still wanted to try the upgrade, so I read the instructions a little more. The instructions are absolutely awful. They assume you have a command-line interface for your website, which I don’t have. Then they say things like “run the upgrade script” but they don’t tell you where the upgrade script is or how to run it. Meanwhile they want to cover themselves on everything so they say to read all of the new version’s release notes first, even though the instructions are written specifically for that version. One problem is they don’t know what your server configuration is or even what version you are upgrading from.

At any rate, they say that you want to unpack all the files and do a new installation from scratch in a separate folder from your real installation. Sounds easy, but the installation asks you for table names and admin id’s that I don’t necessarily remember. Eventually I remembered them though. Once you get that new folder working you can bring over your localsettings.php file. At some point you would also need to bring over your extensions and images as well.

So I tried that. I got through the first couple of screens and it said it was ready to convert my tables to the new format needed by v1.17 (no going back from there). Go! And I got an error about an internal server error. The bad thing would be if the database were converted and the new version of the software wouldn’t run, but fortunately, the database wasn’t converted and so the installation still works. So no v.1.17 for me. Which is really fine anyway.

Curious about whether I could re-create the wiki from my backups, I logged on to another server account I have and tried to import my database. First I tried to import the zipped database but php MyAdmin said the zip archive couldn’t be extracted. So I unzipped the file on my hard drive and it went from 1.5MB to 15MB. Ouch. I tried uploading that archive which was going to take a while, so I took the dogs for a walk. When I got back, the file had uploaded but I got an error saying the database couldn’t be installed because I didn’t have permission to mess with those tables from this account (I think it wanted to overwrite my original tables since both web servers are with the same company, just different accounts). Hmmph. So I do think I could import the tables into my own account if I needed to recreate everything, just not at any server other than the one I have now. That in itself is worrying because it seems like I should be able to have a way to do that. The problem is all the databases in my igirder account start with igirder_ . So I might have igirder_mywiki as a wiki database. In that database would be all the tables for the wiki. But what if I go to some other new account and put the database into tednet_mywiki? There is probably a way to do it, but I was pretty frustrated by all of this.

Leave a Reply

Your email address will not be published. Required fields are marked *