Help! Transfer of sub-domain to main domain


#1

Hi!
I’m a bit rusty on the process for ftp/uploading files to be hosted, but not a complete newby, so I could use a little direction here, with migrating a beta sub-domain to a main domain.

What I have:

  • I have a main personal site (example.com) that’s been up and running for years now (NOT created with Wordpress)

  • I’ve wanted to update that site, so I created a sub-domain (beta.example.com) to create a dev/beta site, with the hopes of basically transferring?/renaming? the beta site to become the main site. (I created this beta site with Wordpress)

  • There seem to be a few differences between the main domain and sub-domain that I see when I’m logged in within dreamhost. Will these cause a conflict at all?
    Main domain: ftp, hosted with php 5.5, one username
    Sub domain: sftp, hosted with php 5.6, a different username

Can someone walk me through the steps of migrating my beta site to the main site? Do I need to delete the main site files first, and also install Wordpress on that site, since it was not originally created that way? I’m afraid that I’ve complicated things by having two usernames, so is it safe for me to change the subdomain to be the same username as the main one? I’ve also had some trouble using sFTP, since I’ve always used straight FTP. It hasn’t been working through fireFTP. Any suggestions for what other platform I should be using to connect with SFTP?

Hope this all makes sense. Thanks in advance for the help!


#2

It’s pretty quick and easy, and easier if you already had the same user. Basically,

1 - set the sub-domain to the same user as the main domain. The panel will offer to Move the files between users, which actually is a COPY. (also the way dreamhost assigns Apache instances this MIGHT invisibly create a DNS change, which will take about 4 hours to be seen worldwide).
2 - make sure all kinks are eliminated are after step 1.
3 - Change the domain name in the wordpress dashboard, the Save will break your site.
4 - Use SFTP to rename directories for the domains: Example.com to TEMP, beta.example.com to example.com, TEMP to beta.example.com (we are swapping the content between beta and main). (the breakage gets fixed, site works again.)
5 - use a WP plugin or phpMyAdmin to locate and replace instances of beta.example.com with example.com in the WP database. (wordpress stores ALL links as hardlink, including links back to its own content.)

Get rid of the extra user, those files and directory structure will confuse you someday if you don’t. Likewise don’t use the method where you change the directory the webserver points via the dreamhost panel, that method will also confuse you someday after the fact (think a couple years in the future).


#3

Thank you for the reply. I was successfully able to migrate the sub-domain to the main site (with a few kinks along the way) and used the Wordpress plugin Velvet Blues to fix all the links after the fact.