Answers.Body: <p>As you can probably tell, CiviCRM is looking for a table that doesn't exist (at least where it's looking).  Given your context, there are a few possibilities for why.</p>
  
  <p>CiviCRM creates a bunch of tables that are independent of WordPress and about which WordPress has no knowledge.  They may be in the same database as WordPress, or they may be in a separate database.  The connection to the database is stored in wp-content/plugins/civicrm/civicrm.settings.php.  There, you'll see two lines of database information: "CIVICRM_UF_DSN" for the WordPress database connection, and "CIVICRM_DSN" for the CiviCRM database connection.</p>
  
  <p>So, the possible situations:</p>
  
  <ol>
  <li><p>You have separate databases, and you have been only backing up the WordPress database.  You'll see this if your database connections in civicrm.settings.php differ from each other.  The good news is that if this is the case, you might be able to find the old CiviCRM database sitting around somewhere, and it would probably be unaffected from a bad plugin.</p></li>
  <li><p>You were only backing up the WordPress tables.  Even if CiviCRM is in the same database as WordPress, if you're using a WordPress tool for backup, it might decide to only handle certain tables.  If this is the case, you may be out of luck unless you still have the pre-restore database around.</p></li>
  <li><p>You failed to update civicrm.settings.php after restoring the site.  If you had Database A running the site, and you restored the backup to Database B, you'd need to update wp-config.php <em>and</em> wp-content/plugins/civicrm/civicrm.settings.php.  If you neglected to do the latter, and you got rid of your old database, you'd see this.  Likewise, if you simply changed the password on the database user and forgot to update civicrm.settings.php, you'd have this sort of problem.</p></li>
  </ol>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-12-09T02:46:27.593Z
Answers.Text: Thank you for your detailed answer, I really appreciate it.
  
  As I was not the one actually doing the backup, I will forward to the person who did it and see if this makes sense to him. For whatever reason, when we looked at database listed in CIVICRM_DSN path in the civicrm_settings.php, it indeed did NOT have civicrm_domain table. Would there have been any way this got deleted during the backup, even if he did not touch the crm database at all? 
  
  I will get confirmation from him regardless, but thank you again for explaining the error to me.
Answers.UserDisplayName: papayapaya
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-12-09T04:34:30.337Z
Answers.Text: Are any of the civicrm_... tables in that database?  If so, you have a really strange situation.  If not, maybe your colleague connected to or restored with the wrong database.
Answers.UserDisplayName: Andie Hunt
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-12-09T15:06:29.483Z
Answers.Text: Yes, but it looks like all the tables after the ones called BATCH got dropped?
Answers.UserDisplayName: papayapaya
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-12-09T20:37:03.057Z
Answers.Text: Hmm.  I wonder if something failed in your backup.  If MySQL runs into an error in generating a dump, the file might cut off.  If you load that file, it would populate all the tables up until that point.
Answers.UserDisplayName: Andie Hunt
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-12-09T21:01:29.343Z
Answers.Text: That's what I was asking the guy who did the backup, but he said he didn't notice any errors during the process of backing up data. I'm having him check older backups to see if how it compares to the newer backup files he has. Thank you again for your replies.
Answers.UserDisplayName: papayapaya
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-06-20T22:00:12.673Z
Answers.Text: This could happen when making *or* restoring the backup. The table after _batch, `civicrm_cache`, is a good candidate for failing to mysqldump or restore successfully ... fortunately it's one you can happily drop the data from :) Recommend checking whether the backup you've received contains later tables, and if not then requesting a backup which includes the structure of all tables, but only data from other tables.
Answers.UserDisplayName: Chris Burgess
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-12-09T02:16:09.220Z
Answers.LastActivityDate: 2015-12-09T02:16:09.220Z
Answers.UserDisplayName: Andie Hunt
Answers.Body: <p>One of the reason for the following Error:</p>
  
  <p>you get this error if you have restored your latest civicrm database (eg.4.7.8) and you are still having your old civicrm Core (eg: 4.6) </p>
  
  <p>so just replace your Civicrm Core files to the latest one should fix the issue </p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-06-20T11:29:54.813Z
Answers.LastActivityDate: 2016-06-20T11:29:54.813Z
Answers.UserDisplayName: Ramesh - ARTECH Consultancy
Body: <p>This morning, a plugin update broke the website, so we did a restore from a backup from the previous day. CiviCRM was working properly at the time, but now when we try to access it, we get the following error:</p>
  
  <pre><code>Array
  (
      [callback] =&gt; Array
          (
              [0] =&gt; CRM_Core_Error
              [1] =&gt; simpleHandler
          )
  
      [code] =&gt; -18
      [message] =&gt; DB Error: no such table
      [mode] =&gt; 16
      [debug_info] =&gt; SELECT *,  config_backend, locales, locale_custom_strings  
   FROM civicrm_domain 
  
   WHERE (  civicrm_domain.id = 1 )  
  
  
  
   [nativecode=1146 ** Table 'frenchf_crm.civicrm_domain' doesn't exist]
      [type] =&gt; DB_Error
      [user_info] =&gt; SELECT *,  config_backend, locales, locale_custom_strings  
   FROM civicrm_domain 
  
   WHERE (  civicrm_domain.id = 1 )  
  
  
  
   [nativecode=1146 ** Table 'frenchf_crm.civicrm_domain' doesn't exist]
      [to_string] =&gt; [db_error: message="DB Error: no such table" code=-18 mode=callback callback=CRM_Core_Error::simpleHandler prefix="" info="SELECT *,  config_backend, locales, locale_custom_strings  
   FROM civicrm_domain 
  
   WHERE (  civicrm_domain.id = 1 )  
  
  
  
  
   [nativecode=1146 ** Table 'frenchf_crm.civicrm_domain' doesn't exist]"]
  )
  </code></pre>
  
  <p>Any idea on what this means and how we can go about fixing it?
  Thanks.</p>
  
Tags: <wordpress><database><backups>
Title: Initialization Error after restoring a Wordpress site from backup
ThreadText: # Initialization Error after restoring a Wordpress site from backup
  
  (Asked by: username_0 on 2015-12-08)
  
  This morning, a plugin update broke the website, so we did a restore from a backup from the previous day. CiviCRM was working properly at the time, but now when we try to access it, we get the following error:
  Array
  (
      [callback] => Array
          (
              [0] => CRM_Core_Error
              [1] => simpleHandler
          )
  
      [code] => -18
      [message] => DB Error: no such table
      [mode] => 16
      [debug_info] => SELECT *,  config_backend, locales, locale_custom_strings  
   FROM civicrm_domain 
  
   WHERE (  civicrm_domain.id = 1 )  
  
  
  
   [nativecode=1146 ** Table 'frenchf_crm.civicrm_domain' doesn't exist]
      [type] => DB_Error
      [user_info] => SELECT *,  config_backend, locales, locale_custom_strings  
   FROM civicrm_domain 
  
   WHERE (  civicrm_domain.id = 1 )  
  
  
  
   [nativecode=1146 ** Table 'frenchf_crm.civicrm_domain' doesn't exist]
      [to_string] => [db_error: message="DB Error: no such table" code=-18 mode=callback callback=CRM_Core_Error::simpleHandler prefix="" info="SELECT *,  config_backend, locales, locale_custom_strings  
   FROM civicrm_domain 
  
   WHERE (  civicrm_domain.id = 1 )  
  
  
  
  
   [nativecode=1146 ** Table 'frenchf_crm.civicrm_domain' doesn't exist]"]
  )
  
  Any idea on what this means and how we can go about fixing it?
  Thanks.
  
  **Tags:** wordpress, database, backups
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2015-12-09. Score: 1
  
  As you can probably tell, CiviCRM is looking for a table that doesn't exist (at least where it's looking). Given your context, there are a few possibilities for why.
  
  CiviCRM creates a bunch of tables that are independent of WordPress and about which WordPress has no knowledge. They may be in the same database as WordPress, or they may be in a separate database. The connection to the database is stored in wp-content/plugins/civicrm/civicrm.settings.php. There, you'll see two lines of database information: "CIVICRM\_UF\_DSN" for the WordPress database connection, and "CIVICRM\_DSN" for the CiviCRM database connection.
  
  So, the possible situations:
  
  1. You have separate databases, and you have been only backing up the WordPress database. You'll see this if your database connections in civicrm.settings.php differ from each other. The good news is that if this is the case, you might be able to find the old CiviCRM database sitting around somewhere, and it would probably be unaffected from a bad plugin.
  2. You were only backing up the WordPress tables. Even if CiviCRM is in the same database as WordPress, if you're using a WordPress tool for backup, it might decide to only handle certain tables. If this is the case, you may be out of luck unless you still have the pre-restore database around.
  3. You failed to update civicrm.settings.php after restoring the site. If you had Database A running the site, and you restored the backup to Database B, you'd need to update wp-config.php *and* wp-content/plugins/civicrm/civicrm.settings.php. If you neglected to do the latter, and you got rid of your old database, you'd see this. Likewise, if you simply changed the password on the database user and forgot to update civicrm.settings.php, you'd have this sort of problem.
  
  > **Comments:**
  > **username_0**: Thank you for your detailed answer, I really appreciate it.  As I was not the one actually doing the backup, I will forward to the person who did it and see if this makes sense to him. For whatever reason, when we looked at database listed in CIVICRM_DSN path in the civicrm_settings.php, it indeed did NOT have civicrm_domain table. Would there have been any way this got deleted during the backup, even if he did not touch the crm database at all?   I will get confirmation from him regardless, but thank you again for explaining the error to me.  
  > **username_1**: Are any of the civicrm_... tables in that database?  If so, you have a really strange situation.  If not, maybe your colleague connected to or restored with the wrong database.  
  > **username_0**: Yes, but it looks like all the tables after the ones called BATCH got dropped?  
  > **username_1**: Hmm.  I wonder if something failed in your backup.  If MySQL runs into an error in generating a dump, the file might cut off.  If you load that file, it would populate all the tables up until that point.  
  > **username_0**: That's what I was asking the guy who did the backup, but he said he didn't notice any errors during the process of backing up data. I'm having him check older backups to see if how it compares to the newer backup files he has. Thank you again for your replies.  
  > **username_2**: This could happen when making *or* restoring the backup. The table after _batch, `civicrm_cache`, is a good candidate for failing to mysqldump or restore successfully ... fortunately it's one you can happily drop the data from :) Recommend checking whether the backup you've received contains later tables, and if not then requesting a backup which includes the structure of all tables, but only data from other tables.  
  
  ---
  
  ### Answer by username_3 on 2016-06-20. Score: 0
  
  One of the reason for the following Error:
  
  you get this error if you have restored your latest civicrm database (eg.4.7.8) and you are still having your old civicrm Core (eg: 4.6)
  
  so just replace your Civicrm Core files to the latest one should fix the issue
  
  
  ---
  
  