Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a fresh MediaWiki installation that I would like to make some mass import tests on from another wiki.

I will expect that my first tries will fail, and I end up with I have inserted 500 pages with broken images and such.

Question

So is there a way to reset/flush a MediaWiki, so I have make a test, flush, make some changes to my import script, and then try again?

I am using the latest MediaWiki, CentOS and MySQL.

share|improve this question

closed as off-topic by Magellan, Falcon Momot, Jenny D, Scott Pack, mdpc Oct 10 '13 at 17:26

This question appears to be off-topic. The users who voted to close gave these specific reasons:

  • "Questions must be relevant to professional system administration. Server Fault is a site dedicated to professionals; novice questions are off-topic. Please see the Help Center for more information on topicality. The best advice we can give you is to hire a professional to help you out." – Falcon Momot, mdpc
  • "Questions must demonstrate a minimal understanding of the problem being solved. Try including attempted solutions, why they didn't work, and the expected results. See How can I ask better questions on Server Fault? for further guidance." – Magellan, Jenny D, Scott Pack
If this question can be reworded to fit the rules in the help center, please edit the question.

add comment

1 Answer

up vote 6 down vote accepted

Probably the easiest way would be to first create a mysqldump of the database while it's pristine:

mysqldump -u <username> -p <password|credentials file> mediawiki > media-wiki-pristine.sql

...then script a MySQL database drop:

mysql -u <username> -p <password|credentials file> -e "drop database mediawiki;"

...followed by a mysql import:

mysql -u <username> -p <password|credentials file> < media-wiki-pristine.sql

...to restore the database after your test completes.

Might need to double-check syntax on my suggested commands; been a while and I'm not sure what version you're using of MySQL.

share|improve this answer
add comment

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