X-Git-Url: https://disinclined.org/git/?a=blobdiff_plain;f=_posts%2F2011-03-25-migrating-domains.html;fp=_posts%2F2011-03-25-migrating-domains.html;h=3abcc387db9d50bfaeb857d6160ab6f4ec5b9461;hb=4fdb6152f6035dec5d3b46b23cb7f7f15072ef4b;hp=0000000000000000000000000000000000000000;hpb=7d05bc31df7579040af812d878a8553309a94799;p=disinclined.org.git diff --git a/_posts/2011-03-25-migrating-domains.html b/_posts/2011-03-25-migrating-domains.html new file mode 100644 index 0000000..3abcc38 --- /dev/null +++ b/_posts/2011-03-25-migrating-domains.html @@ -0,0 +1,25 @@ +--- +layout: note +--- + +

I set up dylanstestserver.com as a test domain. It's a pain to type out, so I planned on switching to dylansserver.com. By the time I got around to this though, the first domain has already been indexed by Google. My deployment process was also engrained with the original domain. This is how I made the migration without losing standing in search engines.

+ +

First I added a new virtualhost to Apache's httpd.conf.

+ +

I then checked out a new copy of the live branch into a new folder in the webroot.

+ +

Next I added a new A record to my DNS, pointing from the new domain to my elastic IP.

+ +

Then I restarted Apache and checked that the new address worked. Then I replaced the .htaccess in the original DocumentRoot with a new directive.

+
+v .htaccess
+ggcG
+RewriteEngine On
+RewriteCond %{HTTP_HOST} !^www\.dylansserver\.com$
+RewriteRule (.*) http://www.dylansserver.com/$1 [R=301,L]
+
+ +

I moved the repository to it's new folder and changed it's post-recieve hook to reflect the new working directory. I also needed to edit my local gitosis-admin/gitosis.conf (and push the changes) to grant myself access to the new repository. Finally, I updated my local repository to point to the new destination.

+
+git remote set-url origin git@dylansserver.com:dylansserver
+