Title: Restore &#8211; WordPress database error Key &#8216;PRIMARY&#8217; doesn&#8217;t exist in table
Last modified: March 1, 2024

---

# Restore – WordPress database error Key ‘PRIMARY’ doesn’t exist in table

 *  Resolved [koolpal007](https://wordpress.org/support/users/koolpal007/)
 * (@koolpal007)
 * [2 years, 3 months ago](https://wordpress.org/support/topic/restore-wordpress-database-error-key-primary-doesnt-exist-in-table/)
 * Hi,
 * Upon restore, I am seeing the below errors in debug.log
 * I have tried this with versions
 * 1.24.1 – 21/Feb/2024 and 1.23.16 – 23/Dec/2023
 * I followed the steps suggested here – [https://updraftplus.com/forums/topic/problem-migrating-a-site/#post-301937](https://updraftplus.com/forums/topic/problem-migrating-a-site/#post-301937)
 * When I am restoring the database last, I see the below errors in debug.log
 *     ```wp-block-code
       [01-Mar-2024 01:57:30 UTC] WordPress database error Key 'PRIMARY' doesn't exist in table 'wp_digits_mobile_otp' for query SELECT COUNT(*) FROM wp_digits_mobile_otp USE INDEX (PRIMARY) made by do_action('wp_ajax_updraft_ajaxrestore'), WP_Hook->do_action, WP_Hook->apply_filters, UpdraftPlus_Admin->updraft_ajaxrestore, UpdraftPlus_Admin->prepare_restore, UpdraftPlus_Admin->restore_backup, Updraft_Restorer->perform_restore, Updraft_Restorer->restore_backup, Updraft_Restorer->restore_backup_db, Updraft_Restorer->prepare_create_table, Updraft_Restorer->restored_table, do_action('updraftplus_restored_db_table'), WP_Hook->do_action, WP_Hook->apply_filters, UpdraftPlus_Migrator_Lite->updraftplus_restored_db_table, UpdraftPlus_Search_Replace->icit_srdb_replacer
   
       [01-Mar-2024 01:57:30 UTC] WordPress database error Key 'mobileno' doesn't exist in table 'wp_digits_mobile_otp' for query SELECT COUNT(*) FROM wp_digits_mobile_otp USE INDEX (mobileno) made by do_action('wp_ajax_updraft_ajaxrestore'), WP_Hook->do_action, WP_Hook->apply_filters, UpdraftPlus_Admin->updraft_ajaxrestore, UpdraftPlus_Admin->prepare_restore, UpdraftPlus_Admin->restore_backup, Updraft_Restorer->perform_restore, Updraft_Restorer->restore_backup, Updraft_Restorer->restore_backup_db, Updraft_Restorer->prepare_create_table, Updraft_Restorer->restored_table, do_action('updraftplus_restored_db_table'), WP_Hook->do_action, WP_Hook->apply_filters, UpdraftPlus_Migrator_Lite->updraftplus_restored_db_table, UpdraftPlus_Search_Replace->icit_srdb_replacer
   
       [01-Mar-2024 01:57:49 UTC] WordPress database error Key 'PRIMARY' doesn't exist in table 'wp_rs_expiredpoints_email' for query SELECT COUNT(*) FROM wp_rs_expiredpoints_email USE INDEX (PRIMARY) made by do_action('wp_ajax_updraft_ajaxrestore'), WP_Hook->do_action, WP_Hook->apply_filters, UpdraftPlus_Admin->updraft_ajaxrestore, UpdraftPlus_Admin->prepare_restore, UpdraftPlus_Admin->restore_backup, Updraft_Restorer->perform_restore, Updraft_Restorer->restore_backup, Updraft_Restorer->restore_backup_db, Updraft_Restorer->prepare_create_table, Updraft_Restorer->restored_table, do_action('updraftplus_restored_db_table'), WP_Hook->do_action, WP_Hook->apply_filters, UpdraftPlus_Migrator_Lite->updraftplus_restored_db_table, UpdraftPlus_Search_Replace->icit_srdb_replacer
   
       [01-Mar-2024 01:57:49 UTC] WordPress database error Key 'PRIMARY' doesn't exist in table 'wp_rs_templates_email' for query SELECT COUNT(*) FROM wp_rs_templates_email USE INDEX (PRIMARY) made by do_action('wp_ajax_updraft_ajaxrestore'), WP_Hook->do_action, WP_Hook->apply_filters, UpdraftPlus_Admin->updraft_ajaxrestore, UpdraftPlus_Admin->prepare_restore, UpdraftPlus_Admin->restore_backup, Updraft_Restorer->perform_restore, Updraft_Restorer->restore_backup, Updraft_Restorer->restore_backup_db, Updraft_Restorer->prepare_create_table, Updraft_Restorer->restored_table, do_action('updraftplus_restored_db_table'), WP_Hook->do_action, WP_Hook->apply_filters, UpdraftPlus_Migrator_Lite->updraftplus_restored_db_table, UpdraftPlus_Search_Replace->icit_srdb_replacer
   
       [01-Mar-2024 01:57:49 UTC] WordPress database error Key 'PRIMARY' doesn't exist in table 'wp_rsgiftvoucher' for query SELECT COUNT(*) FROM wp_rsgiftvoucher USE INDEX (PRIMARY) made by do_action('wp_ajax_updraft_ajaxrestore'), WP_Hook->do_action, WP_Hook->apply_filters, UpdraftPlus_Admin->updraft_ajaxrestore, UpdraftPlus_Admin->prepare_restore, UpdraftPlus_Admin->restore_backup, Updraft_Restorer->perform_restore, Updraft_Restorer->restore_backup, Updraft_Restorer->restore_backup_db, Updraft_Restorer->prepare_create_table, Updraft_Restorer->restored_table, do_action('updraftplus_restored_db_table'), WP_Hook->do_action, WP_Hook->apply_filters, UpdraftPlus_Migrator_Lite->updraftplus_restored_db_table, UpdraftPlus_Search_Replace->icit_srdb_replacer
   
       [01-Mar-2024 01:57:50 UTC] WordPress database error Key 'PRIMARY' doesn't exist in table 'wp_rspointexpiry' for query SELECT COUNT(*) FROM wp_rspointexpiry USE INDEX (PRIMARY) made by do_action('wp_ajax_updraft_ajaxrestore'), WP_Hook->do_action, WP_Hook->apply_filters, UpdraftPlus_Admin->updraft_ajaxrestore, UpdraftPlus_Admin->prepare_restore, UpdraftPlus_Admin->restore_backup, Updraft_Restorer->perform_restore, Updraft_Restorer->restore_backup, Updraft_Restorer->restore_backup_db, Updraft_Restorer->prepare_create_table, Updraft_Restorer->restored_table, do_action('updraftplus_restored_db_table'), WP_Hook->do_action, WP_Hook->apply_filters, UpdraftPlus_Migrator_Lite->updraftplus_restored_db_table, UpdraftPlus_Search_Replace->icit_srdb_replacer
   
       [01-Mar-2024 01:57:50 UTC] WordPress database error Key 'PRIMARY' doesn't exist in table 'wp_rsrecordpoints' for query SELECT COUNT(*) FROM wp_rsrecordpoints USE INDEX (PRIMARY) made by do_action('wp_ajax_updraft_ajaxrestore'), WP_Hook->do_action, WP_Hook->apply_filters, UpdraftPlus_Admin->updraft_ajaxrestore, UpdraftPlus_Admin->prepare_restore, UpdraftPlus_Admin->restore_backup, Updraft_Restorer->perform_restore, Updraft_Restorer->restore_backup, Updraft_Restorer->restore_backup_db, Updraft_Restorer->prepare_create_table, Updraft_Restorer->restored_table, do_action('updraftplus_restored_db_table'), WP_Hook->do_action, WP_Hook->apply_filters, UpdraftPlus_Migrator_Lite->updraftplus_restored_db_table, UpdraftPlus_Search_Replace->icit_srdb_replacer
   
       [01-Mar-2024 01:57:50 UTC] WordPress database error Key 'PRIMARY' doesn't exist in table 'wp_sumo_reward_encashing_submitted_data' for query SELECT COUNT(*) FROM wp_sumo_reward_encashing_submitted_data USE INDEX (PRIMARY) made by do_action('wp_ajax_updraft_ajaxrestore'), WP_Hook->do_action, WP_Hook->apply_filters, UpdraftPlus_Admin->updraft_ajaxrestore, UpdraftPlus_Admin->prepare_restore, UpdraftPlus_Admin->restore_backup, Updraft_Restorer->perform_restore, Updraft_Restorer->restore_backup, Updraft_Restorer->restore_backup_db, Updraft_Restorer->prepare_create_table, Updraft_Restorer->restored_table, do_action('updraftplus_restored_db_table'), WP_Hook->do_action, WP_Hook->apply_filters, UpdraftPlus_Migrator_Lite->updraftplus_restored_db_table, UpdraftPlus_Search_Replace->icit_srdb_replacer
   
       [01-Mar-2024 01:57:51 UTC] WordPress database error Key 'PRIMARY' doesn't exist in table 'wp_sumo_reward_send_point_submitted_data' for query SELECT COUNT(*) FROM wp_sumo_reward_send_point_submitted_data USE INDEX (PRIMARY) made by do_action('wp_ajax_updraft_ajaxrestore'), WP_Hook->do_action, WP_Hook->apply_filters, UpdraftPlus_Admin->updraft_ajaxrestore, UpdraftPlus_Admin->prepare_restore, UpdraftPlus_Admin->restore_backup, Updraft_Restorer->perform_restore, Updraft_Restorer->restore_backup, Updraft_Restorer->restore_backup_db, Updraft_Restorer->prepare_create_table, Updraft_Restorer->restored_table, do_action('updraftplus_restored_db_table'), WP_Hook->do_action, WP_Hook->apply_filters, UpdraftPlus_Migrator_Lite->updraftplus_restored_db_table, UpdraftPlus_Search_Replace->icit_srdb_replacer
       ```
   
 * Please guide.
 * Thanks

Viewing 6 replies - 1 through 6 (of 6 total)

 *  Plugin Support [vupdraft](https://wordpress.org/support/users/vupdraft/)
 * (@vupdraft)
 * [2 years, 3 months ago](https://wordpress.org/support/topic/restore-wordpress-database-error-key-primary-doesnt-exist-in-table/#post-17467002)
 * This is just telling you that some of your tables don’t have a Primary key. This
   would be something to talk to the plugins development team about.
 *  Thread Starter [koolpal007](https://wordpress.org/support/users/koolpal007/)
 * (@koolpal007)
 * [2 years, 3 months ago](https://wordpress.org/support/topic/restore-wordpress-database-error-key-primary-doesnt-exist-in-table/#post-17467843)
 * [@vupdraft](https://wordpress.org/support/users/vupdraft/) Thank you for you 
   reply.
 * I have been using these plugins since long and earlier restores using Updraft
   did NOT display such errors.
 * Please guide.
 * Thanks
 *  Plugin Author [David Anderson / Team Updraft](https://wordpress.org/support/users/davidanderson/)
 * (@davidanderson)
 * [2 years, 3 months ago](https://wordpress.org/support/topic/restore-wordpress-database-error-key-primary-doesnt-exist-in-table/#post-17468793)
 * UpdraftPlus searches for a primary key because if there is one, certain things
   can be done faster. If there isn’t one, that’s not a problem. This code hasn’t
   always been there. If you can point us to where to find one or more of these 
   plugins that the mentioned database tables are for, we can read the code to see
   if they do indeed have a primary key on the table or not.
 *  Thread Starter [koolpal007](https://wordpress.org/support/users/koolpal007/)
 * (@koolpal007)
 * [2 years, 3 months ago](https://wordpress.org/support/topic/restore-wordpress-database-error-key-primary-doesnt-exist-in-table/#post-17469366)
 * Thank you for responding.
 * Both these plugins are commercials plugins.
 * `https://codecanyon.net/item/digits-wordpress-mobile-number-signup-and-login/
   19801105`
 * `https://codecanyon.net/item/sumo-reward-points-woocommerce-reward-system/7791451`
 * Is there any way I can check if these tables have a primary key on the table 
   or not?
 * If they do not, how can I add them myself and will it negatively impact their
   performance?
 * Please guide.
 * Thanks
 *  Plugin Support [vupdraft](https://wordpress.org/support/users/vupdraft/)
 * (@vupdraft)
 * [2 years, 3 months ago](https://wordpress.org/support/topic/restore-wordpress-database-error-key-primary-doesnt-exist-in-table/#post-17473528)
 * To check the structure of your table, you can use the `SHOW CREATE TABLE` command.
   This will show you the column names, data types, and other information about 
   the table including the primary key. You can also use the `SHOW INDEXES` command
   to see the indexes created by MySQL.
 * If UpdraftPlus is telling you that you do not have a Primary key then it’s very
   unlikely that it has a Primary key. If it’s not causing you any other issues 
   I would not risk altering the DB. I would however reach out the plugins support
   and raise this with them
 *  Thread Starter [koolpal007](https://wordpress.org/support/users/koolpal007/)
 * (@koolpal007)
 * [2 years, 3 months ago](https://wordpress.org/support/topic/restore-wordpress-database-error-key-primary-doesnt-exist-in-table/#post-17474120)
 * Thank you for your response.
 * Have a nice day!

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Restore – WordPress database error Key ‘PRIMARY’ doesn’t exist in table’
is closed to new replies.

 * ![](https://ps.w.org/updraftplus/assets/icon-256x256.jpg?rev=1686200)
 * [UpdraftPlus: WP Backup & Migration Plugin](https://wordpress.org/plugins/updraftplus/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/updraftplus/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/updraftplus/)
 * [Active Topics](https://wordpress.org/support/plugin/updraftplus/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/updraftplus/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/updraftplus/reviews/)

 * 6 replies
 * 3 participants
 * Last reply from: [koolpal007](https://wordpress.org/support/users/koolpal007/)
 * Last activity: [2 years, 3 months ago](https://wordpress.org/support/topic/restore-wordpress-database-error-key-primary-doesnt-exist-in-table/#post-17474120)
 * Status: resolved