Back in August, I had tried and failed to upgrade the Flashlight Wiki’s software from MediaWiki 1.16 to 1.17. For whatever reason, I thought it would be a good time to try again. Only now they are up to version 1.18.
So I downloaded the new software and then uploaded it to my server. I put the compressed file in a new folder, but really it unzips into its own folder, so that isn’t necessary. I renamed the folder flashlightwiki instead of flashlightwiki where the original is. I also did a backup of the database and all the files in the original installation. I left the zip archive of files in place with restricted permissions in case I need to recover quickly. Last time I had to re-upload the zip file to recover.
This is where it gets tricky. I guess the way to do it is to go ahead and run the installer and generate a localsettings.php file. So I tried that out and it worked okay I guess except the wiki itself did not work exactly right when I was done. So instead I pulled up a copy of the new localsettings and the old one and did a line by line comparison to make all the same changes to the new one that I had made to the old one, while leaving any new stuff in place. Then I dragged over the images and extensions folders to the new installation.
And I got an error. I think it was something in my meta tags extension that wasn’t working. So I disabled that extension by editing localsettings. And it worked! Sort of. There were still some problems that I spent all afternoon tracking down and fixing. It would probably help to just print a copy of the old localsettings to use as a go-by. At some point I renamed the old folder and named the new folder flashlightwiki to make it the official copy. I also needed to move the .htaccess folder at this point.
There were some customizations I had done to the stylesheet of the old installation which I had made by modifying the css file in Monobook called main.css (which you aren’t supposed to do). I was able to eventually get these customizations to work using wiki pages instead, described at the end of this blog post of customizations.
I also tried to make my localsettings.php file a little more organized. Before I had my customizations all over the place. I would include a comment so I would know what I did, but really I don’t think the order matters so much and it is better to do all the new stuff at the bottom. But some stuff involves user preferences or disabling something in the top section. Moving my stuff to the bottom might also make upgrading easier. There is supposed to be some automatic upgrade tool, but I wasn’t able to figure that out.
The software was upgraded in November, so hopefully they won’t change it for a little while.
Really, I think the process should be easy:
- Unzip the software to a different folder
- Run the installer there and generate a localsettings.php file
- Make a backup of this localsettings file
- Create a hybrid localsettings that takes code from the old and the new files (this is the hardest part)
- Move the hybrid localsettings, images, extensions, and .htaccess files to the new folder.
- Rename the old folder to something else. Rename the new folder.
Tweak the CSS if there is a new skin involved.
For a simple update, where I don’t need to create a new localsettings file, the process is:
- Purge the objectcache.
- Export the database in phpAdmin to have a backup.
- In cPanel File Manager, make a zip archive of the flashlightwiki folder.
- Change permissions of the zip file so the world can’t read it (otherwise they could get the localsettings file which has your password in it).
- Download the zip archive to have a backup.
- Download the software from MediaWiki to my hard drive in my web browser.
- Using Filezilla, upload the MediaWiki zip installer to the public_html folder of my server space
- Using cPanel’s File Manager, unzip the file. It will unzip to a new folder.
- In the new installation, delete the Images folder (or rename it, but it is empty),
- Copy the Images folder from the original installation to the new one.
- Copy the Cite, Google AdSense, Google Translator, and UserMerge folders in Extensions over to the new Extensions folder along with the two Meta Extensions which are just files. The other extensions are included in the installation.
- Copy the WPTouch skin folder and file from Skins over to the new Skins folder.
- Copy Localsettings.php over to the new folder.
- In FileZilla, copy .htaccess over to the new folder (.htaccess doesn’t show up in cPanel’s file manager).
- Rename the old folder to flashlighwiki-old. The website is now offline.
- Rename the new folder to flashlightwiki. The website is now online again.
- Test the site by browsing, editing, and signing up a new user.
- If everything is working, delete the old installation, the zip archive, and the installer zip file (maybe wait a day).
In WordPress, you press a button and it upgrades the software.