Ask Ubuntu is a question and answer site for Ubuntu users and developers. 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 have a typical local installation of mediawiki in Ubuntu 10.04. And I am going to do a fresh install of Ubuntu 11.04. How can I quickly backup the wiki content and afterwards restore it back?

All sites I found mention the sqldump command to dump the database but I am not sure how I will restore it back.

share|improve this question

Assuming you are using mysql (mediawiki works w/ pgsql too I think):

Be warned, mysqldump will lock your tables so they don't change while reading them. If you have converted them to InnoDB (not the default, but highly recommended) then you can add --single-transaction below, and they won't be write-locked:

mysqldump --user root --password root_pass your_database > file.sql

copy file.sql to new server

mysqladmin create your_database
mysql --user root --password root_pass -e "GRANT ALL PRIVILEGES ON your_database.* TO user_name@localhost IDENTIFIED BY 'pass'"
mysql --user user_name --password pass < file.sql

Don't forget to copy your uploaded files directory as well (use scp or rsync), good luck!

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.