Under typical (non DA) multisite circumstances, I understand setting up a multisite and migrating content out from a dev environment into staging and eventually production (if the project requires it). However, a project I am working on will likely use the domain access module and I was a little in the dark about the migration workflow.
1) Have a development/staging site with the domain access module installed (and all the necessary subdomains set up)
2) Client works on setting up the staging site will all content that will go live.
Now we introduce the production servers (staging would consist of stage.domain.com, subsite1.stage.domain.com...subsiteN.stage.domain.com while production would be domain.com, subsite1.domain.com...subsiteN.domain.com)
So the content was created on the stage site (and pointed towards its appropriate subsites) and the time has come to make the site go live (thus out of the staging domain and into the production domain).
What are general practices to then move that structure (and possible content) over from the stage domain over to production? Would you set up domain aliases or is there something else that must be done during the db migration process?
Comments
Comment #1
agentrickardWe usually set up domain aliases. If possible, we use the production site as the domain records even on dev, and then alias the dev hosts.
Then we use a little trick in hook_domainload() to alter the domain 'path' element IFF you are on a dev box.
Comment #2
BTMash CreditAttribution: BTMash commentedThank you very much for your response on this, agentrickard. I have something mostly up and running at this point though I ran into an issue - when I implemented hook_domainload and altered $domain['path'], it did not seem to do anything to the links. However, if I change $domain['subdomain'], the links on the subdomains with different sources do change appropriately (though I'm guessing that may be a somewhat harsher option to implement?).
Comment #3
agentrickardThat would work, since path is derived from subdomain. But if your module fires before Domain Access does, DA would overwrite the path after you set it.
Comment #4
BTMash CreditAttribution: BTMash commentedAh, that makes perfect sense :) Thank you very much!
I wrote out what you described and it looks to work perfectly. I'm posting the code here if it might be useful to others (the name of the module could use work but I tried to make it flexible enough for others to get potential use out of it):
domain_access_alias_redirect.info:
domain_access_alias_redirect.install:
domain_access_alias_redirect.module:
domain_access_alias_redirect.admin.inc:
Comment #5
agentrickardHow is this different from the provided Domain Alias module?
Comment #6
BTMash CreditAttribution: BTMash commentedUnless I missed something in the domain alias module, this one allows you to switch to using one of the aliases (changes the path for a domain) you create for the site (so if I have a site domain.com with the alias dev.domain.com and stage.domain.com, you can configure the module to use the dev.domain.com aliss the links on the other subdomains will come up as dev.domain.com). Its just building on top of what domain alias provides.
Comment #7
agentrickardCool. Thanks.