How to transfer your wiki from one host to another
From Neural Wiki
I recently transferred Neuralwiki from [www.siteground.com Siteground] who were fantastic hosts, (really some of the best in the business) to [www.inmotion.com InMotion] who are well reviewed. I went with InMotion because it was the cheaper way to host multiple accounts (up to 6...which I have). However, if you are hosting between 1-3 account, I would highly recommend going with Siteground for price, reliability and good hosting speed. With Siteground you pay per addon domain instead of being allowed up to 6 like InMotion
Contents |
[edit] Moving the wiki
This guide was a great help, but it skips a few details that may not be intuitive to someone who has never changed from one shared host to another. In this guide I am assuming you have cPanel and phpMyAdmin at the old and new host.
[edit] Move your files
This part is simple, just copy all of the files in your public_html folder from one host to the other. I used Filezilla to download all these files to my hard drive and then upload them to my new host account
[edit] Download your databases
You must do this individually for each MYSQL database. For example, I had a few databases, one for Neuralwiki, one for my phpBB database, and a few I was playing around with.
1) Open phpMyAdmin inside of cPanel
2) Click on export (green arrow, Fig1)
3) Select just one database at a time (red arrow, Fig 2), click on zip or gzip (blue arrow, Fig2) then click go and wait. Note that if you do not compress you will have to copy and paste a couple thousand lines, its just easier to compress and uncompress on your desktop. You can leave all of the other settings in the default (that is what I did), or look at mine if you are not sure.
4) Unzip your file (you can use winrar if nothing else, or cygwin), then open up this file which should end in .sql. I used gVim to open the file, but EMACS or many other programs would work.
5) Then you need to delete the two consecutive lines that start with CREATE DATABASE. See Fig 3, and delete the two lines that are highlighted, and replace them with the following: SET NAMES utf8;
6) Save the file and exit
[edit] Create new databases and users
your mediawiki installation is going to look for a specific database name. For example, mine was previously called neuralwi_mw. However, at my new host, all the databases start with neural5, not neuralwi. The host sets this up.
1) Login to your new hosts cPanel
2) Click on MySQL databases.
3) Create a new database with the same extension as before.....in my case I created a database called mw.
4) Then create a new user with a password you will remember.....you will need to put this in LocalSettings.php in a bit
5) Then add that user to your database, and give them all of the permissions
[edit] Upload the databases
1) Now click on phpMyAdmin at your new host's cPanel
2) Double click on your new database (mw or wikidb in my case)
3) Then click on the tab that says import (red arrow, Fig 4)
4) Browse your computer for the .sql file you edited and upload it (orange arrow, Fig 4)
5) Wait for everything to finish and you have now uploaded your database
[edit] Change LocalSettings.php
1) Go to your new hosts file manager
2) open LocalSettings.php for editing (in your public_html directory)
3) Fix the four $wgDB..... variables to reflect the new user name and password, and the new database name. For example, I changed $wgDBname from neuralwi_mw to neural5_mw and $wgDBuser from neuralwi_user to neural5_user.
[edit] Change your DNS
Mediawiki will not work unless the DNS are pointing to the correct address. For example, while I was uploading from one site, I was in a temporary url so as not to disrupt your viewing pleasure. However once I finished uploading everything, if I viewed this temporary url, I was unable to see Neuralwiki until I changed the DNS servers to redirect to my new host. Then it worked fine!
Good luck
