Title: Problems restoring the WP database
Last modified: August 24, 2016

---

# Problems restoring the WP database

 *  [arredux](https://wordpress.org/support/users/arredux/)
 * (@arredux)
 * [11 years ago](https://wordpress.org/support/topic/problems-restoring-the-wp-database/)
 * Hello, I have a wordpress blog with the WP Athletics plugin installed ([https://wordpress.org/plugins/wp-athletics/](https://wordpress.org/plugins/wp-athletics/)).
   I was migrating my website to my localhost server for making some test when I
   received the next error when I was importing the sql file in phpMyAdmin:
 * _#1146 – Table ‘db1455552.wp\_wpa\_result’ doesn’t exist_
 * That table is used for the WP-Athletics plugin.
    I checked the sql file and I
   detect the first problem: – When BackWPup creates the sql file, it writes at 
   start of the file the view creation. I think that view sould be founded at the
   finish of the file, because a view needs tables and they aren’t created yet.
 * For solving the problem, I edited the file and I moved the view creation to the
   finish, and when I did the import I received a new error:
 * _#1393 – Can not modify more than one base table through a join view ‘db1455552.
   v\_wpa\_results’ _
 * Now the problem is in the same sql sentence of the view creation. BackWPup creates
   the view with this sql sentence:
    _— — View structure for `v\_wpa\_results` —
 * DROP VIEW IF EXISTS `v_wpa_results`;
    /*!40101 SET @saved_cs_client = @@character_set_client*/;/*!
   40101 SET character_set_client = ‘utf8’ */;
 * CREATE ALGORITHM=UNDEFINED DEFINER=`testUser`@`%` SQL SECURITY DEFINER VIEW `
   v_wpa_results` AS select `r`.`id` AS `id`,`r`.`time` AS `time`,`r`.`user_id` 
   AS `user_id`,`r`.`event_id` AS `event_id`,`r`.`garmin_id` AS `garmin_id`,`r`.`
   position` AS `position`,`r`.`age_category` AS `age_category`,`r`.`gender` AS `
   gender`,`r`.`pending` AS `pending`,`r`.`age_grade` AS `age_grade`,`r`.`date_created`
   AS `date_created`,`e`.`event_cat_id` AS `event_cat_id`,`e`.`name` AS `event_name`,`
   e`.`location` AS `event_location`,`ec`.`name` AS `category`,`ec`.`time_format`
   AS `time_format`,`ec`.`type` AS `type`,`ec`.`distance_meters` AS `distance_meters`,`
   e`.`date` AS `date`,`e`.`sub_type_id` AS `event_sub_type_id` from ((`wp_wpa_result``
   r` join `wp_wpa_event` `e` on((`e`.`id` = `r`.`event_id`))) join `wp_wpa_event_cat``
   ec` on((`ec`.`id` = `e`.`event_cat_id`)));
    /*!40101 SET character_set_client
   = @saved_cs_client */;
 * INSERT INTO `v_wpa_results` (`id`, `time`, `user_id`, `event_id`, `garmin_id`,`
   position`, `age_category`, `gender`, `pending`, `age_grade`, `date_created`, `
   event_cat_id`, `event_name`, `event_location`, `category`, `time_format`, `type`,`
   distance_meters`, `date`, `event_sub_type_id`) VALUES
    (2, 3661000, 6, 1, ”, 
   1, ‘S’, ‘F’, 0, ‘49.71’, ‘2015-05-05 19:50:49’, 12, ‘kkkk10k race’, ‘city’, ’
   10k’, ‘h:m:s’, ‘running’, 10000, ‘2015-05-02 00:00:00’, ‘R’); /*!40000 ALTER 
   TABLE `v_wpa_results` ENABLE KEYS */; UNLOCK TABLES;
 * The problem appears when phpMyAdmin imports the INSERT INTO sentence.
 * I have tried to export the database directly from phpMyAdmin and it has created
   a different file. At start of the sql file, it creates the view with this sentence:
   
   _CREATE TABLE IF NOT EXISTS `v\_wpa\_results` ( `id` mediumint(9) ,`time` bigint(
   10) ,`user\_id` mediumint(9) ,`event\_id` mediumint(9) ,`garmin\_id` varchar(
   100) ,`position` int(4) ,`age\_category` varchar(7) ,`gender` varchar(1) ,`pending`
   smallint(1) ,`age\_grade` decimal(10,2) ,`date\_created` timestamp ,`event\_cat\
   _id` mediumint(9) ,`event\_name` varchar(100) ,`event\_location` varchar(100),`
   category` tinytext ,`time\_format` varchar(6) ,`type` varchar(20) ,`distance\
   _meters` float ,`date` datetime ,`event\_sub\_type\_id` varchar(2) );
 * And after the tables creation and before of the index creations, it writes the
   next sentences:
    _DROP TABLE IF EXISTS `v\_wpa\_results`;_
 * CREATE ALGORITHM=UNDEFINED DEFINER=`testUser`@`%` SQL SECURITY DEFINER VIEW `
   v_wpa_results` AS select `r`.`id` AS `id`,`r`.`time` AS `time`,`r`.`user_id` 
   AS `user_id`,`r`.`event_id` AS `event_id`,`r`.`garmin_id` AS `garmin_id`,`r`.`
   position` AS `position`,`r`.`age_category` AS `age_category`,`r`.`gender` AS `
   gender`,`r`.`pending` AS `pending`,`r`.`age_grade` AS `age_grade`,`r`.`date_created`
   AS `date_created`,`e`.`event_cat_id` AS `event_cat_id`,`e`.`name` AS `event_name`,`
   e`.`location` AS `event_location`,`ec`.`name` AS `category`,`ec`.`time_format`
   AS `time_format`,`ec`.`type` AS `type`,`ec`.`distance_meters` AS `distance_meters`,`
   e`.`date` AS `date`,`e`.`sub_type_id` AS `event_sub_type_id` from ((`wp_wpa_result``
   r` join `wp_wpa_event` `e` on((`e`.`id` = `r`.`event_id`))) join `wp_wpa_event_cat``
   ec` on((`ec`.`id` = `e`.`event_cat_id`)));
 * With the phpMyAdmin export file works fine, but with the BackWPup export file
   doesn’t work. I think the problem is than you are using an INSERT INTO sentence
   to add data into a view (not into a table), and this step is unnecessary, because
   when you create the tables of the view, the view gets the data automatically.
 * Can do you check it? If do yo need more information, write me.
 * Thank you!!
 * [https://wordpress.org/plugins/backwpup/](https://wordpress.org/plugins/backwpup/)

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

 *  [detoris](https://wordpress.org/support/users/detoris/)
 * (@detoris)
 * [11 years ago](https://wordpress.org/support/topic/problems-restoring-the-wp-database/#post-6131543)
 * If that were so, that would be very bad and should be fixed as soon as possible.
   It would indeed only in an emergency notice B- (
 *  Plugin Contributor [Daniel Hüsken](https://wordpress.org/support/users/danielhuesken/)
 * (@danielhuesken)
 * [11 years ago](https://wordpress.org/support/topic/problems-restoring-the-wp-database/#post-6131577)
 * Hello,
 * i have chnaged the backup so that the view will be created in the end of the 
   sql file. So that the tables exists. That Insert intos will be done for a view
   was a bug to and i have removed that for views.
 * I think PHPMYAdmin creates the table and drops them agai if ther views that depends
   on views that are not created on view creation. I think i will try to do it in
   same way.
 *  Plugin Contributor [Daniel Hüsken](https://wordpress.org/support/users/danielhuesken/)
 * (@danielhuesken)
 * [11 years ago](https://wordpress.org/support/topic/problems-restoring-the-wp-database/#post-6131578)
 * I have now schnaged it in a similar way that mysqldump do it to.
 * I will update out master relase from github for testing today.
    [https://github.com/inpsyde/backwpup](https://github.com/inpsyde/backwpup)
 *  [detoris](https://wordpress.org/support/users/detoris/)
 * (@detoris)
 * [11 years ago](https://wordpress.org/support/topic/problems-restoring-the-wp-database/#post-6131579)
 * This is a great info. Thanks
    Do you have a idea for the release date? 😉
 *  Plugin Contributor [Daniel Hüsken](https://wordpress.org/support/users/danielhuesken/)
 * (@danielhuesken)
 * [11 years ago](https://wordpress.org/support/topic/problems-restoring-the-wp-database/#post-6131582)
 * Sorry we will release it asap but it needs some tests. You can test it too and
   give feeadback.

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

The topic ‘Problems restoring the WP database’ is closed to new replies.

 * ![](https://ps.w.org/backwpup/assets/icon-256x256.png?rev=3236141)
 * [BackWPup – WordPress Backup & Restore Plugin](https://wordpress.org/plugins/backwpup/)
 * [Support Threads](https://wordpress.org/support/plugin/backwpup/)
 * [Active Topics](https://wordpress.org/support/plugin/backwpup/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/backwpup/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/backwpup/reviews/)

## Tags

 * [database](https://wordpress.org/support/topic-tag/database/)
 * [insert into](https://wordpress.org/support/topic-tag/insert-into/)
 * [phpmyadmin](https://wordpress.org/support/topic-tag/phpmyadmin/)

 * 5 replies
 * 3 participants
 * Last reply from: [Daniel Hüsken](https://wordpress.org/support/users/danielhuesken/)
 * Last activity: [11 years ago](https://wordpress.org/support/topic/problems-restoring-the-wp-database/#post-6131582)
 * Status: not resolved