Let's face it - sometimes you need a copy of a site running Domain Access on your local machine. It does require some tweaking to get it up and running since you need at minimum to change your hostnames. I keep a query around for each local site db to do this for me (automation is your best friend after all). It's plain and simple if you are using subdomains but it can easily be adjusted to full domain names:

UPDATE domain set subdomain = replace(subdomain,'thebeehive.org', 'beehive.trunk');

This query will replace all thebeehive.org occurrances in domain table with beehive.trunk.

And for the heck of it make sure sessions and watchdog tables are empty before you start:
TRUNCATE sessions;
TRUNCATE watchdog;

 

stony83 (not verified) on Wed, 09/15/2010 - 03:14

You can also add the local subdomains instead of replace it, so you don't have to make this update-sql all the time...

katrin on Wed, 10/06/2010 - 13:04

True - but your solution only works if you don't have any content on the site or it is published to all affiliates. Once you have content node access is tied to domain ID. You could run an update on domain_access table after adding your local domains but it's more of a hassle.

Reijo (not verified) on Thu, 09/30/2010 - 05:05

Wouldn't this be easier achieved by just editing your local PC's hosts file so that when attempting to browse to http://www.site.com your browser will in fact contact 127.0.0.1? :)

katrin on Wed, 10/06/2010 - 13:06

Yes, but that would mean you'd have to keep on modifying the hosts file if you do want to access the live site.

Jeff Ong (not verified) on Wed, 01/05/2011 - 00:11

Thanks, this is an excellent tip; I manage a multi-site with 17 different domains, and it's a royal pain every time I need to resync my local version with the live site.

Type the characters you see in this picture. (verify using audio)
Type the characters you see in the picture above; if you can't read them, submit the form and a new image will be generated. Not case sensitive.