Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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 bac?

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
add comment

1 Answer 1

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
add comment

Your Answer

 
discard

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.