Moving your data from Dreamhost to Mediatemple
by giginger on 15/03/2010Now that my sites are all moved over to Mediatemple I feel I should write a little guide here. I had trouble finding a useful guide that worked specifically for moving from Dreamhost to Mediatemple. There were a couple of guides but I found their examples weren’t as clear for me as they could have been. The simple way to transfer the site was to download everything using FTP and upload it again to the new site. However, that would have taken hours. Whilst I had some trouble getting the right commands for my case it was worth it as I saved myself so much time. Downloading my sites would’ve taken about 8/9 hours which is not bad. However, uploading would’ve taken a few days. Not even worth considering as an option.
Here’s how I did it.
Your first steps will obviously be to ssh in to your dreamhost account. I used PuTTY* for this as it’s free and works perfectly. If you don’t know how to ssh in then maybe this isn’t for you.
The command below doesn’t remove anything from your Dreamhost account. It just copies it straight across to your Mediatemple account.
scp -r dreamhostdomainfolder mediatemplusername@sitenumber.gridserver.com:/home/sitenumber/domains/
You will be asked for your password.
Instead of dreamhostdomainfolder you could use * which will just transfer everything you have on your dreamhost account. Every folder including those log files. Depends how you want to work it. I found it easier to do this and then delete the folders I didn’t need afterwards. I suppose it really comes down to your own way of working.
Now, to delete the folders you don’t need you’ll need to use the command rm -rf foldername. Be careful with this one though. Wrong foldername and you’ll have to transfer all over again! Some folders will say permission denied. The easiest solution I found for that was to CHMOD them to 777. After that you’ll have no trouble.
The next step I took was to dump my databases to a sql file and transfer them across.
mysqldump --opt -udreamhostusername -pdreamhostpassword -h dreamhostmysqldomain databasename > outputfilename.sql
Then I transferred them across to Mediatemple
scp outputfilename.sql mediatemplusername@sitenumber.gridserver.com:/home/sitenumber/data/
Note that your sql files are going into a folder called data and not under domains. I had no problems here myself Just be sure that you’re accurate with database names and file names. You don’t want to export the file and then overwrite it with a different one.
Then I populated my mediatemple database(s). Make sure you’ve created your mediatemple databases first however. My largest database was about 450meg and that seemed to complete in about 30 seconds. You’ll need to ssh in to your mediatemple account for this part though.
mysql -umediatempleusername -p -h internal-db.sitenumber.gridserver.com databasename < outputfilename.sql
If you run something like WordPress, you’ll need to edit the database connection settings. There’s full help for this on the WordPress site and the Mediatemple site.
- * Link to putty [↩]
No comments yet.