Moving Subversion repositories from Dreamhost to Mediatemple, Part 1

by Guillermo A. Fisher

I recently cre­ated a Medi­atem­ple (dv) host­ing account, and am mov­ing all of my sites over to it. I’ve still got some data­bases to move, and some Word­Press instal­la­tions to relo­cate, but I have suc­cess­fully moved all of my most impor­tant Sub­ver­sion repos­i­to­ries over. I rely on heav­ily on svn, and wanted to make sure things were solid before I did any new devel­op­ment. Allow me to walk you through the process:

First, I did some Googling. OkCool had an awe­some tuto­r­ial that cov­ered a lot of the Dreamhost end of things, the Medi­atem­ple Knowl­edge­Base — nat­u­rally — had some help­ful infor­ma­tion, and Elec­tro­mute rounded things out with great infor­ma­tion for the (dv) account. There was a bit of infor­ma­tion that I had to con­tact sup­port for, and that was related to the absence of Sub­ver­sion on the server. As it turns out, installing “Devel­oper Tools” — as is men­tioned in the Knowl­edge­Base and on sev­eral other sites — does not install Sub­ver­sion. You’ve gotta yum it out. So, while logged into your Medi­atem­ple account, assum­ing you’ve got a shell account (BaSh for this tuto­r­ial) setup, root access enabled, and Devel­oper Tools installed, you wanna do this first:

yum install subversion

You’re going to be prompted with some ques­tions, and you’re gonna want to agree to every­thing with a “y” (that is, at least, if you’re on Cen­tos). Sub­ver­sion will be installed and you’ll feel as though you’ve accom­plished a great deal.

Next, you’ll want to fol­low the export instruc­tions set out in the OkCool tuto­r­ial, but log in to your Dreamhost server so that you can do what I did and skip all that FTPing busi­ness by flex­ing your com­mand line prowess:

for i in repo1 repo2 repo3; do svnadmin dump ~/svn/$i > ~/tmp/$i.dumpfile; scp ~/tmp/$i.dumpfile username@mediatempleIP:/var/www/vhosts/yoursite.com/httpdocs/dumps/; done

You can read more about BaSh at your leisure, but basi­cally the code work as follows:

for i in item1 item2 item3... itemn; do some command; and possibly another one; and this one && that one on $i; done

So, what I’m doing in the code is explic­itly list­ing out all of the sub­ver­sion repos­i­to­ries I need moved over (because, hon­estly, I didn’t need all of them) and exe­cut­ing a series com­mand for every item in that list.

Next, you’ll import the repos­i­to­ries. Stay tuned.

Your Feedback Civil & constructive, please.

Leave a Reply