Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I just installed and configured MediaWiki on Ubuntu Server 10.04. I've now copied the instance in /usr/share/mediawiki/ to a different directory to run as a separate instance, and would like to reset it to a clean state so that it takes me through initial configuration again.

How can I do this without uninstalling and starting again?

share|improve this question

This should be as simple as just adding a second database to your MySQL (or chosen SQL system) and then resetting your config file to allow you to start the installation from scratch.

cd /var/www/mediawiki
cp LocalSettings.php LocalSettings.php.old
nano LocalSettings.php 

Place in the new details and then kickstart your install.

share|improve this answer
I hope you don't mind me answering myself after going away and playing around. I just thought it best to share my results. Thanks for the help! – Captain Blammo Nov 24 '10 at 1:27
up vote 2 down vote accepted

We're going to delete some files, so back them up first if you want a copy for later reference.

Short version:

sudo rm -f LocalSettings.php
sudo rm -f config/LocalSettings.php

Now open your wiki in a browser. It will walk you through initial setup again.

Long Version:

The default installation directory in Ubuntu server is /usr/local/mediawiki, softlinked from /var/www/mediawiki. If you have copied the directory elsewhere, just use that path instead in the following example. Depending on your user privileges, you may want to log in as root or sudo all of the following commands.

cd /usr/local/mediawiki
ls -l
  1. You should see a LocalSettings.php file. This is a real file or a symlink to /etc/mediawiki/LocalSettings.php, which you can delete instead if you prefer. If you are using multiple wikis, though, it is helpful to replace all of these symlinks with local copies.

    rm -f LocalSettings.php

  2. you should also see a config directory. If you don't you can create one thus:

    ln -s /var/lib/mediawiki/config ./config

    Now you can remove the generated config file (which doesn't actually get used, just copied to the proper location)

    rm -f config/LocalSettings.php

Now if you hop over to your wiki in a browser, you will be prompted to go through initial setup again. This will generate the config/LocalSettings.php file again, allowing you to copy it to your install dir.

cp config/LocalSettings.php ./

Under Ubuntu, I changed the permissions and the user to my web server user for security:

chmod 700 LocalSettings.php
chown www-data LocalSettings.php
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.