7

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.

Sandra
  • 9,973
  • 37
  • 104
  • 160

1 Answers1

7

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.

gravyface
  • 13,947
  • 16
  • 65
  • 100