User:Rogerhc/Import MediaWiki 1.6.7 database, files and configuration to Dreamhost

WARNING! Your milage may vary. I did a test run using a different domainname to make sure this would work before I edited my project's production domainname's DNS settings. And I'm an amateur. So this page may contain bad advice!

Here's how I did it (as best I can remember and made pretty, sequenced how I would do it next time, not how I really did it :-)


 * Put a "MOVING - DON'T EDIT ANYTHING RIGHT NOW" message up on the old location


 * Turn off editing of the MediaWiki on the old location by special configuration in LocalSettings.php


 * Use mysqldump to create a dump of the MediaWiki 1.6.7 database on the FreeBSD server and call it something meaningful like wikigogy-wgdb.2006-11-16.sql


 * SCP that .sql to your Dreamhost Crazy Insane home dir


 * I edit my godaddy.com registration for wikigogy.org to use Dreamhost's DNS servers. DNS takes up to 48 hours to propagate worldwide. So I edit /etc/hosts on my Linux desktop to point Wikigogy.org to go the IP address Dreamhost has in my A record for Wikigogy, like so:

208.113.148.76 wikigogy.org # Wikigogy.ORG at Dreamhost
 * 1) 64.62.161.137 wikigogy.org # Wikigogy.ORG on my FreeBSD server

(I change which line above is commented out if I want to get back into the wiki on the other server to edit it, such as to put a "MOVING - DON'T EDIT ANYTHING RIGHT NOW" message up on the old location, because I forgot to.)


 * I use DH Control Panel > Goodies > One-Click Installs > MediaWiki 1.8.2 to install MediaWiki on my wikigogy.org domain (I want it there, not somewhere like wiki.wikigogy.org, because this domain is by name a wiki purposed domain; if your domain is not clearly wiki purposed by name, for example gogy.org, you might like wiki.gogy.org). **I used identical dbusername and dbname and dbtableprefix to my MediaWiki installation on the old location; I found that helps the following step work**.


 * I overwrote my new MediaWiki 1.8.2 database with my old MediaWiki 1.6.7 database:

[brandine]$ mysql -u wguser -p -h wg.wikigogy.org wgdb < ~/wikigogy-wgdb.2006-11-16.sql


 * I updated the database to the new MediaWiki version:

[brandine]$ cd /maintenance/ [brandine]$ /usr/local/dh/cgi-system/php5.cgi update.php


 * import wikigogy.org/images dir and all its images and check PERMISSIONS (I used 'tar -xzvf images.tgz' to upack it and my permissions came out fine, updated to my Dreamhost username), then refresh links:

[brandine]$ /usr/local/dh/cgi-system/php5.cgi refreshLinks.php


 * I monkeyed with my configurations in LocalSettings.php, skins, .htaccess and robots.txt till my wiki looks the way I had it on my old server.


 * Now, three days later, DNS has propagated. So I commented out both those lines in my desktop's /etc/hosts (I left them there to remind me how cleaver I was).

Learned
Everything went smoothly after I got smart and used my old MediaWiki's dbusername, dbname, and tableprefix when creating the new MediaWiki install via Dreamhost's > Goodies > One-Click Installer. That made overwriting the new plain MediaWiki db with the old Wikigogy MediaWiki db work right.