Transitioning Multisite between Hosts

billp44ruby's picture

I'm working on setting up a new multisite with a new hosting provider, moving from a shared hosting environment to a Cloud VPS environment. From some of my posts below, you'll see that I've been having difficulty setting up the new multisite, but finally determined the source of my problems. Within my new target environment, I've setup my domain name (example.com) and was attempting to setup a subdirectory site (example.com/site1).

Because my new site is not yet live, I can only access it via the IP address (111.111.111.111). The issue I was having was that IP address does not resolve to the domain name when Drupal is looking for which site to go to. I had set my subdirectory site up under the sites folder as example.com.site1, which didn't work. I have changed the subdirectory site name to 111.111.111.111.site1 and 'bingo', I was able to install Drupal on that site.

Now my question is this. It seems like I'll be able to do all of my site prep work before I make DNS changes that will point my domain to my new site. When I do that, will simply renaming the subdirectory site name from 111.111.111.111.site1 to example.com.site1 leave all of the work I've done in place?

I'm thinking it should, but I'm interested in hearing from those who have gone through similar transitions whether that is the correct way to address this. The alternative approach I thought about was putting a line of code in .htaccess what would somehow resolve the IP address to the domain name, but since I have no expertise to do that, the approach I took seemed simpler.

Comments

Using web server config rules

Garrett Albright's picture

Using web server config rules really is the most elegant way, but yeah, I'm not very good at configuring Apache either, so I'll give you another idea. Assuming you're on a Unixish box, you can use symbolic links to make your site directory findable no matter what server you're on. For example, create the site in example.com.site1 and then create a symlink for your IP address using 111.111.111.111.site1 by doing ln -s example.com.site1 111.111.111.111.site1.

Multisite

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

Hot content this week