How do I restore the images from a MediaWiki backup?

I'm having trouble restoring the images folder from a backup of my MediaWiki.

I made a backup of my MediaWiki (MediaWiki 1.15.1, PHP 5.3.2, and MySQL 5.1.41), reformatted my computer, and reinstalled MediaWiki again (MediaWiki 1.17.0, PHP 5.3.2 and MySQL 5.1.41). I was able to successfully restore the database from the backup (by calling mysql -u root -p -D my_wiki < backupfile.sql).

Everything works fine up to this point; I'm able to view the text from my articles, but I've got no images. The trouble comes when trying to restore the images. I copied the images from the backup into the /var/www/mediawiki/images/ folder, but the images don't show up in the Wiki.

When I visit one of the URLs which should point to an image (for example http://localhost/mediawiki/images/1/1e/image.jpg) I get a message saying "Forbidden. You don't have permission to access..." This would lead me to believe it's a problem with permissions, but I gave all users read access to the images folder (by calling chmod -R a+r images), and still I get the same message.

I'm a Ubuntu 10.04 user. It may be worth noting that my MediaWiki was orginally located at /var/lib/mediawiki/ and is now located at /var/www/mediawiki/. However, this shouldn't matter, as I haven't actually restored the LocalSettings.php file or anything yet.


Solution 1:

You need to use the scripts in your MediaWiki maintenance folder to export and import the images. Instructions are available here: http://linuxclues.blogspot.com/2008/04/backup-restore-mediawiki-ubuntu.html