I currently have two websites (siteA and siteB) each with their own separate Drupal codebase. I would like to have a setup with just one code base. Therefore one website would need to be a sub website of the other. ie make siteB a subsite of siteA.

Both siteA and siteB have their own unique domain names and databases so there is no need for one site to have any knowledge of the other. I'm merely trying to share codebases, nothing else.

The following seems like a good tutorial if your are creating a new sub site from scratch. http://drupal.org/node/278987
I, however, am trying to make an existing website a sub site.

Does anyone have any advice on how to achieve this?

Will I need to create a symlink so siteB can share siteA's codebase?
What do I need to do next? Do I need to run update.php instead of install.php?

Any help with this would be very much appreciated.

Cheers.

Comments

sp3boy’s picture

If you've already got a working database for both installations I don't think you'll need to run update.php OR install.php.

Assuming you have consolidated your code under mypath/drupal, and your "secondary" domain is example.com, I think what you'd need to do is create mypath/drupal/sites/example.com and move your secondary site's settings.php into there. That should take care of the database access (I think).

Your need for a symlink may depend on whether you're running Apache with virtual hosts. If so, I don't think you'll need one, just a virtual host for example.com pointing at the /drupal top-level directory.

If you fire up your secondary site address in the browser you'll probably want to go to admin/settings/file-system and fix the file paths for sites/example.com/files and so forth.

I have set up a multi-site system on Unix and Windows (and recently split one up again) but it's always a bit of a scramble to join all the right bits together.

jsmcgd’s picture

Thanks very much for the reply sp3boy!

I'm currently fiddling with domain name servers. Once that is sorted I'll do what you said and I'll let you know how it goes.

Thanks again.