So I've been toying with the idea of using drupal as a real application framework using the Multisite feature - one (shared) code base, many databases for content from each site. This accomplishes one of the most serious tasks of app management: fewer applications to maintain. In this case, one set of modules to keep up to date, one instance of drupal to keep up to date - a real enterprise configuration.
The whole thing sounds great for distinct web properties, in that I can have ONE SET of files to maintain from the repository perspective and makes production migrations that much simpler. But what about sharing content and applying database patches that stem from a module update? That's still hokey, and kind of worse in that I'd have to run updates several times before promote the whole wad to production. Yek.
So I dug a little and found the Domain Access project. Using this, one can have a single database AND codebase, syndicating content between multiple domains and even choosing which content to publish to which domain. Really nice.
Further, there are some extensions to this to accommodate various business rules, including separate themes per domain and passing arguments to views and even blocks. A bit more config to get each going, but once you have the business rules documented, not too bad. Justifiable, even.
I am really jonesing to implement this on a particular project. Really. Jonesing. I said it.
Comments
creating problems by deleting domains?
No, this doesn't pose a problem. Look at it this way:
- Content is stored as a node
- "where it's published" is an attribute of the node
- removing something from the list of domains deserves the same level of cleanup and other such updates have. if the API can't handle removing references on removal of the domain from that list (need to check on that - good call!), then you need to do your diligence and clean up the node attribute referencing that domain.
Now, administration of nodes is another issue. Say you [DELETE] a node... you've deleted it from existence... in every front-end environment. That's where the real operational risk lies, not in domain administration.
My question is whether or not
My question is whether or not you can delete all the content easily. If you start a 2nd site, and choose to remove it later, will all the content applied to that subdomain be removed? or do you have to go through and delete the nodes separately...
removing content exclusive to a domain before deleting the domai
Okay, I see where you're coming from now. So there a bunch (let's say 2,000) nodes associated with your Domain Access domains and - for whatever reason - you need to discontinue use of myotherdomain-with-some-exclusive-content.com and would like to get rid of, say, 200 nodes associated just with said domain. My recommendation there is to (a) delete all 200 of the nodes exclusive to that domain and then (b) get rid of the domain.
To do so, I'd probably first try to use one of the Views that ships with the DA module, modifying it to accomplish the goal (dev environment first!) and then using an output like Views Bulk Operations to run the node_delete($nid) through the UI.
If we were talking straight code to remove nodes that exist only in this soon-to-be-canned domain, I might think of executing something like this:
<?php
$result = db_query("SELECT n.nid FROM {node} n INNER JOIN {domain_access} a ON n.nid=a.nid WHERE a.realm = 'myotherdomain-with-some-exclusive-content.com'");
while ($row = db_fetch_object($result))
{
node_delete($row->nid);
}
?>Of course, you'd need to test that pretty exhaustively. I know I didn't even validate column contents before hitting Save, but it's a pointer.
About Domain Acces
Thanks for your reply,
I would like to make video sites for different regions, one site for each region, so the front page of each domain would have different videos according to the region they belong. But the rest of the content in other nodes would be the same for all sites. Do you suggest Domain acces? in this case?










Wont it create problem when u
Wont it create problem when u try to get rid of one domain and content is in same db then do u think it can be a problem?