Answers.Body: <p>It's actually quite simple to combine your databases.</p>
  
  <ol>
  <li><p>Do a database export of your WP database:</p>
  
  <pre><code>mysqldump -u [username] -p [wp database name] &gt; wp-original.sql
  </code></pre>
  
  <p>It'll ask for your password and then output your WordPress database to the <code>wp-original.sql</code> file.</p></li>
  <li><p>Do a database export of your CiviCRM database:</p>
  
  <pre><code>mysqldump -u [username] -p [civi database name] &gt; civi-original.sql
  </code></pre>
  
  <p>It'll ask for your password and then output your CiviCRM database to the <code>civi-original.sql</code> file.</p></li>
  <li><p>Create a new database that'll be your combined database.  This way, you will still have your two original ones in case of emergency.  Grant permissions on the new database to the user that has permissions for your WordPress database.</p></li>
  <li><p>Load the two exports into the new database:</p>
  
  <pre><code>mysql -u [username] -p [new database name] &lt; wp-original.sql
  mysql -u [username] -p [new database name] &lt; civi-original.sql
  </code></pre></li>
  <li><p>Edit your wp-config.php to have the new database name:</p>
  
  <pre><code>define('DB_NAME', '[new database name]');
  </code></pre></li>
  <li><p>Edit your civicrm.settings.php to have the new database name (and appropriate username/password, if you had different ones for CiviCRM).  This will need to be done in both places--once for the CMS database and once for the CiviCRM database.</p>
  
  <pre><code>define( 'CIVICRM_UF_DSN', 'mysql://[username]:[password]@[hostname (probably just "localhost")]/[new database name]?new_link=true' );
  
  define( 'CIVICRM_DSN', 'mysql://[username]:[password]@[hostname (probably just "localhost")]/[new database name]?new_link=true' );
  </code></pre>
  
  <p>You can probably just copy the <code>CIVICRM_UF_DSN</code> value once you've fixed the database name and paste it in place of the <code>CIVICRM_DSN</code> value.</p></li>
  <li><p>Log in and make sure everything works on your existing server.</p></li>
  </ol>
  
  <p>For Drupal and Joomla users, the principle is the same, just with settings.php and configuration.php, respectively, instead of wp-config.php.  The only difference is that on Joomla, you need to fix both civicrm.settings.php files (in <code>administrator/components/com_civicrm</code> and <code>components/com_civicrm</code>).</p>
  
  <p>Now, I used to say that you should never put your site on WPEngine because they used to only run a version of PHP that was too old for CiviCRM.  That's been fixed.  However, they still run very aggressive caching, and you may find it to be a problem with CiviCRM.  </p>
  
  <p>You should definitely do your first run over there as an experiment and test it heavily, logging in as various users and trying out a variety of CiviCRM features.  There's a good possibility that it will either be unusable or take more of your time than you'd save by having things in the same place.  If you think of it, please comment with your experience--whether it works or doesn't.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-10-16T15:59:48.813Z
Answers.Text: Andrew, I had thought WP Engine was either 5.3.3 or HHVM only, do you know what they updated to?
Answers.UserDisplayName: Kevin Cristiano
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-10-16T16:23:01.723Z
Answers.Text: I had simply seen this blog post: http://wpengine.com/blog/php-5-5-upgrade-available-wp-engine-customers/ Reading the link shows that it's HHVM with failover to PHP 5.5.  Who knows how that performs.  More fundamentally, WPEngine does things so heavy-handedly that I would never consider putting a CiviCRM site on there in the first place.
Answers.UserDisplayName: Andie Hunt
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-10-18T20:46:21.763Z
Answers.Text: HI Andrew, thanks for the great response - I never thought of combining the databases into a third database.  I am currently working with a test site anyway, so I will try this tip this afternoon and let you know how it works.    The real site is running on Hostgator currently, so I really need to move it.  It's my only CiviCRM install, so if it doesn't work on WP Engine, I will move it to a recently vacated SiteGround account.
Answers.UserDisplayName: DanM
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-11-11T15:45:49.390Z
Answers.Text: Just been talking with WPEngine tech support.Apparently they only run HHVM on "selected servers" so I wouldn't need to worry about that. I was also told that they do have customers running CiviCRM, and that if I had any issues relating to caching to let them know. I'm about to begin testing it out for real...
Answers.UserDisplayName: Graham
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-10-16T14:31:55.370Z
Answers.LastActivityDate: 2015-10-16T14:31:55.370Z
Answers.UserDisplayName: Andie Hunt
Body: <p>I am using CiviCRM on WordPress and I am moving my hosting to WP Engine - where I have all of my other sites hosted.  Unfortunately, I set this instance of CiviCRM to use a separate database, however, WP Engine only supports one database per install.  I am trying to convert my existing CiviCRM install to use the default WordPress database before I migrate the site to WP Engine.  Is this possible?  </p>
  
  <p>If I can't convert the install, can I create a new install (using the WordPress database) and IMPORT the data from the old site?</p>
  
Tags: <wordpress><database><configuration>
Title: In Wordpress, I want to convert my installation from an external database to use the default database
ThreadText: # In Wordpress, I want to convert my installation from an external database to use the default database
  
  (Asked by: username_0 on 2015-10-15)
  
  I am using CiviCRM on WordPress and I am moving my hosting to WP Engine - where I have all of my other sites hosted. Unfortunately, I set this instance of CiviCRM to use a separate database, however, WP Engine only supports one database per install. I am trying to convert my existing CiviCRM install to use the default WordPress database before I migrate the site to WP Engine. Is this possible?
  
  If I can't convert the install, can I create a new install (using the WordPress database) and IMPORT the data from the old site?
  
  **Tags:** wordpress, database, configuration
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2015-10-16. Score: 3
  
  It's actually quite simple to combine your databases.
  
  1. Do a database export of your WP database:
  
     ```
     mysqldump -u [username] -p [wp database name] > wp-original.sql
  
     ```
  
     It'll ask for your password and then output your WordPress database to the `wp-original.sql` file.
  2. Do a database export of your CiviCRM database:
  
     ```
     mysqldump -u [username] -p [civi database name] > civi-original.sql
  
     ```
  
     It'll ask for your password and then output your CiviCRM database to the `civi-original.sql` file.
  3. Create a new database that'll be your combined database. This way, you will still have your two original ones in case of emergency. Grant permissions on the new database to the user that has permissions for your WordPress database.
  4. Load the two exports into the new database:
  
     ```
     mysql -u [username] -p [new database name] < wp-original.sql
     mysql -u [username] -p [new database name] < civi-original.sql
  
     ```
  5. Edit your wp-config.php to have the new database name:
  
     ```
     define('DB_NAME', '[new database name]');
  
     ```
  6. Edit your civicrm.settings.php to have the new database name (and appropriate username/password, if you had different ones for CiviCRM). This will need to be done in both places--once for the CMS database and once for the CiviCRM database.
  
     ```
     define( 'CIVICRM_UF_DSN', 'mysql://[username]:[password]@[hostname (probably just "localhost")]/[new database name]?new_link=true' );
  
     define( 'CIVICRM_DSN', 'mysql://[username]:[password]@[hostname (probably just "localhost")]/[new database name]?new_link=true' );
  
     ```
  
     You can probably just copy the `CIVICRM_UF_DSN` value once you've fixed the database name and paste it in place of the `CIVICRM_DSN` value.
  7. Log in and make sure everything works on your existing server.
  
  For Drupal and Joomla users, the principle is the same, just with settings.php and configuration.php, respectively, instead of wp-config.php. The only difference is that on Joomla, you need to fix both civicrm.settings.php files (in `administrator/components/com_civicrm` and `components/com_civicrm`).
  
  Now, I used to say that you should never put your site on WPEngine because they used to only run a version of PHP that was too old for CiviCRM. That's been fixed. However, they still run very aggressive caching, and you may find it to be a problem with CiviCRM.
  
  You should definitely do your first run over there as an experiment and test it heavily, logging in as various users and trying out a variety of CiviCRM features. There's a good possibility that it will either be unusable or take more of your time than you'd save by having things in the same place. If you think of it, please comment with your experience--whether it works or doesn't.
  
  > **Comments:**
  > **username_2**: Andrew, I had thought WP Engine was either 5.3.3 or HHVM only, do you know what they updated to?  
  > **username_1**: I had simply seen this blog post: http://wpengine.com/blog/php-5-5-upgrade-available-wp-engine-customers/ Reading the link shows that it's HHVM with failover to PHP 5.5.  Who knows how that performs.  More fundamentally, WPEngine does things so heavy-handedly that I would never consider putting a CiviCRM site on there in the first place.  
  > **username_0**: HI Andrew, thanks for the great response - I never thought of combining the databases into a third database.  I am currently working with a test site anyway, so I will try this tip this afternoon and let you know how it works.    The real site is running on Hostgator currently, so I really need to move it.  It's my only CiviCRM install, so if it doesn't work on WP Engine, I will move it to a recently vacated SiteGround account.  
  > **username_3**: Just been talking with WPEngine tech support.Apparently they only run HHVM on "selected servers" so I wouldn't need to worry about that. I was also told that they do have customers running CiviCRM, and that if I had any issues relating to caching to let them know. I'm about to begin testing it out for real...  
  
  ---
  
  