I build a wiki using MediaWiki. Initially, I used a remote database (clearDB), as setup was faster. I now want to migrate the data, and use a db local to the server instead.
My current db settings in Localsettings.php
## Database settings
$wgDBtype = "mysql";
$wgDBserver = "us-XXXX-XXXX-XXX-XX.cleardb.net";
$wgDBname = "heroku_XXXXXXXXX";
$wgDBuser = "XXXXXXXXX";
$wgDBpassword = "XXXXXXXXXX";
Obviously, if I just "changed" the $wgDBserver
to localhost
, it won't work.
What needs to be done to migrate the old data and default MediaWiki architecture to a new db local to the server?
You would need to use mysqldump
on your old data store and save the pure SQL locally.
mysqldump -u <user> -p -h us-XXXX-XXXX-XXX-XX.cleardb.net heroku_XXXXXXXX > /tmp/wikidump.sql
Then on your local server, recreate the heroku_XXXXXXXXX DB t
CREATE DATABASE heroku_XXXXXXXX (exact same name);
use heroku_XXXXXXX;
source /tmp/wikidump.sql
This will do the trick.
I sometimes look inside the dump (/tmp/wikidump.sql
) with a text editor to make sure no references to cleardb.net
exists an change them. That's just me! Otherwise follow: