Answers.Body: <p>Yes, you can run several independent Drupal sites off the same codebase.  Some instructions are here:
  <a href="https://www.drupal.org/documentation/install/multi-site" rel="nofollow">https://www.drupal.org/documentation/install/multi-site</a></p>
  
  <p>Basically, each has its own database and its own <code>sites/yoursite.org</code> folder where the settings files and site-specific files go.  All use the <code>sites/all</code> folder.  When you visit via <a href="http://yoursite.org" rel="nofollow">http://yoursite.org</a>, Drupal checks the <code>sites/yoursite.org</code> folder for a settings.php file, and if there is no <code>sites/yoursite.org</code> folter, it uses <code>sites/default</code>.  (There's a more nuanced pecking order of folders, but this is the gist.)</p>
  
  <p>For CiviCRM, it works the same: you put civicrm.settings.php in <code>sites/yoursite.org</code>, and the module lives in <code>sites/all/modules</code>.  Your database is independent of the other sites; the only thing shared is the module code.</p>
  
  <p>However, there is a reason why many people don't set up their sites this way: there's not much benefit to having a single copy of the modules (the files aren't that big), but you can do things on one site that inadvertently cause problems on one of the others.  As an example, if you upgrade one site's CiviCRM, you're replacing the files used by all of your sites, requiring you to run the upgrade script on all of them.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-04-26T12:09:02.977Z
Answers.Text: Thank's Andrew, and what about extensions and "customized" templates?
  I mean, having a single code, it's possible to have a specific template for different sites?
Answers.UserDisplayName: marcello
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-04-26T13:29:48.690Z
Answers.Text: Yes. Your extensions and template overrides will be in `sites/yoursite.org`, so they'll be site-specific.
Answers.UserDisplayName: Andie Hunt
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-06-09T06:20:24.497Z
Answers.Text: Tanks I have understand the logic, But in my developement server I don't use domains. So my base URL is  http://127.0.0.1/drupal/ and my base drupal folder C:\localhost\drupal\sites.
  Where I have to put my new default.settings.php?
Answers.UserDisplayName: marcello
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-06-09T17:03:27.243Z
Answers.Text: You'll need some way for the system to know which site you want. The most straightforward way is to edit your hosts file (often `/etc/hosts`, but something else for you on Windows) to point fake domains to 127.0.0.1. If you have one entry reading `127.0.0.1 onesite.dev` and the other reading `127.0.0.1 othersite.dev`, you'll put settings files at `sites/onesite.dev/settings.php` and `sites/othersite.dev/settings.php`. You may need to configure Apache to serve the folder from those virtual domains.
Answers.UserDisplayName: Andie Hunt
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-04-22T19:34:38.353Z
Answers.LastActivityDate: 2016-04-22T19:34:38.353Z
Answers.UserDisplayName: Andie Hunt
Body: <p>Is it possible with Drupal to have two sites, with 2 separate databases, sharing the same PHP code?</p>
  
  <p>For the future need of porting one database to another server, I don't want to use "Multi Site Installation".</p>
  
Tags: <database><multisite>
Title: 2 separate sites with the same php code
ThreadText: # 2 separate sites with the same php code
  
  (Asked by: username_0 on 2016-04-22)
  
  Is it possible with Drupal to have two sites, with 2 separate databases, sharing the same PHP code?
  
  For the future need of porting one database to another server, I don't want to use "Multi Site Installation".
  
  **Tags:** database, multisite
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2016-04-22. Score: 3
  
  Yes, you can run several independent Drupal sites off the same codebase. Some instructions are here:
  <https://www.drupal.org/documentation/install/multi-site>
  
  Basically, each has its own database and its own `sites/yoursite.org` folder where the settings files and site-specific files go. All use the `sites/all` folder. When you visit via <http://yoursite.org>, Drupal checks the `sites/yoursite.org` folder for a settings.php file, and if there is no `sites/yoursite.org` folter, it uses `sites/default`. (There's a more nuanced pecking order of folders, but this is the gist.)
  
  For CiviCRM, it works the same: you put civicrm.settings.php in `sites/yoursite.org`, and the module lives in `sites/all/modules`. Your database is independent of the other sites; the only thing shared is the module code.
  
  However, there is a reason why many people don't set up their sites this way: there's not much benefit to having a single copy of the modules (the files aren't that big), but you can do things on one site that inadvertently cause problems on one of the others. As an example, if you upgrade one site's CiviCRM, you're replacing the files used by all of your sites, requiring you to run the upgrade script on all of them.
  
  > **Comments:**
  > **username_0**: Thank's Andrew, and what about extensions and "customized" templates? I mean, having a single code, it's possible to have a specific template for different sites?  
  > **username_1**: Yes. Your extensions and template overrides will be in `sites/yoursite.org`, so they'll be site-specific.  
  > **username_0**: Tanks I have understand the logic, But in my developement server I don't use domains. So my base URL is  http://127.0.0.1/drupal/ and my base drupal folder C:\localhost\drupal\sites. Where I have to put my new default.settings.php?  
  > **username_1**: You'll need some way for the system to know which site you want. The most straightforward way is to edit your hosts file (often `/etc/hosts`, but something else for you on Windows) to point fake domains to 127.0.0.1. If you have one entry reading `127.0.0.1 onesite.dev` and the other reading `127.0.0.1 othersite.dev`, you'll put settings files at `sites/onesite.dev/settings.php` and `sites/othersite.dev/settings.php`. You may need to configure Apache to serve the folder from those virtual domains.  
  
  ---
  
  