2

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.

alfC
  • 3,584

1 Answers1

3

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!

SpamapS
  • 20,110