Answers.Body: <p>Well, the answer appears to be 'Yes, it is (almost) that simple'.</p>
  
  <p>The one wrinkle is that you first need to trick CiviCRM into thinking it has not already been installed on another Wordpress network site by moving civicrm.settings.php to an out of the way location.</p>
  
  <p>So, do this:</p>
  
  <ol>
  <li>Move your old civicrm.settings.php file somewhere safe.</li>
  <li>Create a new empty MySQL database.</li>
  <li>Go to the Wordpress site where you intend to create the new CiviCRM instance and activate the CiviCRM plugin.</li>
  <li>CiviCRM will go through the process of installing CiviCRM to the blank database.</li>
  <li>A new civicrm.settings.php file will have been created probably in a path like: /path/to/wordpress/wp-content/uploads/sites/2/civicrm/civicrm.settings.php</li>
  <li>Restore your old civicrm.settings.php to its original location (in my case this was in /path/to/wordpress/wp-content/plugins/civicrm/ because it's an older install).</li>
  </ol>
  
  <p>The 'old' settings file was edited something like this:</p>
  
  <pre><code>&lt;?php
  
  $site = $_SERVER['SERVER_NAME'] == 'newsite.com' ? 'new' : 'default';
  
  if ($site != 'default'):
      include_once('/path/to/wordpress/wp-content/uploads/sites/2/civicrm/civicrm.settings.php');
  else:
      /*The contents of the old original settings file goes here.*/
  endif;
  
  ?&gt;
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-04-16T02:54:56.913Z
Answers.LastActivityDate: 2018-04-16T02:54:56.913Z
Answers.UserDisplayName: fred2
Body: <p>I know that it's possible to have CiviCRM shared across multisite Wordpress, and for a single database to operate in a way that keeps different site's data separately.</p>
  
  <p>I'd like to do something superficially simpler, but which I can't find any mention of anywhere.</p>
  
  <p>I'd like two sites in a multisite install to use the same CiviCRM codebase, but completely separate databases. To my mind, I just don't want to the two website's data mixed together, even if they are kept separate from a user perspective.</p>
  
  <p>Could this be as simple as a PHP switch in the config file which says (psuedocode) ...?</p>
  
  <pre><code> If Website A:
        Use Database A
   Else:
        Use Database B
  </code></pre>
  
  <p>But I realise that with logs and Smarty cache files it might be more complicated than that ...</p>
  
Tags: <wordpress><configuration><multisite>
Title: Wordpress Multisite and CiviCRM with multiple databases
ThreadText: # Wordpress Multisite and CiviCRM with multiple databases
  
  (Asked by: username_0 on 2018-04-15)
  
  I know that it's possible to have CiviCRM shared across multisite Wordpress, and for a single database to operate in a way that keeps different site's data separately.
  I'd like to do something superficially simpler, but which I can't find any mention of anywhere.
  I'd like two sites in a multisite install to use the same CiviCRM codebase, but completely separate databases. To my mind, I just don't want to the two website's data mixed together, even if they are kept separate from a user perspective.
  Could this be as simple as a PHP switch in the config file which says (psuedocode) ...?
   If Website A:
        Use Database A
   Else:
        Use Database B
  
  But I realise that with logs and Smarty cache files it might be more complicated than that ...
  
  **Tags:** wordpress, configuration, multisite
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2018-04-16. Score: 2 | Accepted answer
  
  Well, the answer appears to be 'Yes, it is (almost) that simple'.
  The one wrinkle is that you first need to trick CiviCRM into thinking it has not already been installed on another Wordpress network site by moving civicrm.settings.php to an out of the way location.
  So, do this:
  
  Move your old civicrm.settings.php file somewhere safe.
  Create a new empty MySQL database.
  Go to the Wordpress site where you intend to create the new CiviCRM instance and activate the CiviCRM plugin.
  CiviCRM will go through the process of installing CiviCRM to the blank database.
  A new civicrm.settings.php file will have been created probably in a path like: /path/to/wordpress/wp-content/uploads/sites/2/civicrm/civicrm.settings.php
  Restore your old civicrm.settings.php to its original location (in my case this was in /path/to/wordpress/wp-content/plugins/civicrm/ because it's an older install).
  
  The 'old' settings file was edited something like this:
  
  
  ---
  
  