Restore backup from 2.0 into 2.2 gives error Table "backup_ids_temp" does not exist

Restore backup from 2.0 into 2.2 gives error Table "backup_ids_temp" does not exist

by Kurien Philip -
Number of replies: 7

Hello fellow Moodlers,

I am trying to restore a  backup from Moodle 2.0 (2.0.6 (Build: 20111128)) into 2.2 (2.2+ (Build: 20111223)) and it gives me the error "Table "backup_ids_temp" does not exist". Has anyone faced this error / can throw some light on this?

Thanks

Kurien

Average of ratings: -
In reply to Kurien Philip

Re: Restore backup from 2.0 into 2.2 gives error Table "backup_ids_temp" does not exist

by Kurien Philip -

Ok, some more information that I have been able to get on this. In both Moodle installations there is a table by the name of "backup_ids_template". The structure of the table is 

id bigint(10) UNSIGNED
backupid varchar(32) utf8_unicode_ci
itemname varchar(160) utf8_unicode_ci
itemid bigint(10) UNSIGNED
newitemid bigint(10) UNSIGNED
parentitemid bigint(10) UNSIGNED
info mediumtext utf8_unicode_ci

Off to find the source of the problem now ... 

Any tips welcome. 



In reply to Kurien Philip

Re: Restore backup from 2.0 into 2.2 gives error Table "backup_ids_temp" does not exist

by Kurien Philip -

Fellow Moodlers,

Not been able to solve this as yet. There is some script which - instead of referring to the table as "backup_ids_template" is referring to it as "backup_ids_temp".  Any clues on finding the name of the script will help.

Copied the table "backup_ids_template" as "backup_ids_temp" but then the script at some other place gives a DDL exception error. 

Thanks in advance on any clue to solving this problem.

In reply to Kurien Philip

Re: Restore backup from 2.0 into 2.2 gives error Table "backup_ids_temp" does not exist

by Eloy Lafuente (stronk7) -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Peer reviewers Picture of Plugin developers Picture of Testers

Hi Kurien,

First some explanations:

  • Each backup/restore execution automatically creates one temporary table (backup_ids_temp), were a lot of transient information is stored in order to finish the process with success.
  • The structure of that table (backup_ids_temp) is exactly the same than the structure of backup_ids_template, in fact the later is a "template" to create the temporary table. So no modification on the template table is needed at all.

The way to fix it:

  • First of all, I'd suggest you to enable DEBUG_DEVELOPER in your site and try the operation once more. If the error happens, it would be great to have all the information available (here and/or at the Tracker) to know where exactly the error is happening.

The bet:

  • Without knowing the results of the point above and ignoring other possible causes, I'd say that it is highly possible that you're getting those errors because your DB user lacks permissions to handle temporary tables, hence it's not able to create it. Under MySQL, such permission is called "CREATE TEMPORARY TABLES". Verify if your user has it or no, apply it, and try again.

Ciao smile

Average of ratings: Useful (2)
In reply to Eloy Lafuente (stronk7)

Re: Restore backup from 2.0 into 2.2 gives error Table "backup_ids_temp" does not exist

by Annie Price -

Hi Eloy,

I am having a problem with backups after upgrading to 2.2

I would follow your instructions above but I don't know where in phpmyadmin I can find "CREATE TEMPORARY TABLES" in order to give permissions.  I have looked and cannot find anything.

Can you help please?

In reply to Annie Price

Re: Restore backup from 2.0 into 2.2 gives error Table "backup_ids_temp" does not exist

by Annie Price -

Hi,

This is the output for a manual backup

Debug info: Access denied for user 'web167-course22'@'%' to database 'web167-course22' CREATE TEMPORARY TABLE mdl_backup_ids_temp (     id BIGINT(10) unsigned NOT NULL auto_increment,     backupid VARCHAR(32) NOT NULL DEFAULT '57c951b3e8e457c62eeead432c862128',     itemname VARCHAR(160) NOT NULL DEFAULT '',     itemid BIGINT(10) unsigned NOT NULL,     newitemid BIGINT(10) unsigned NOT NULL DEFAULT 0,     parentitemid BIGINT(10) unsigned,     info MEDIUMTEXT, CONSTRAINT  PRIMARY KEY (id) )
Stack trace:
  • line 400 of /lib/dml/moodle_database.php: ddl_change_structure_exception thrown
  • line 669 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
  • line 88 of /lib/ddl/database_manager.php: call to mysqli_native_moodle_database->change_database_structure()
  • line 75 of /lib/ddl/database_manager.php: call to database_manager->execute_sql()
  • line 499 of /lib/ddl/database_manager.php: call to database_manager->execute_sql_arr()
  • line 159 of /backup/util/dbops/backup_controller_dbops.class.php: call to database_manager->create_temp_table()
  • line 106 of /backup/util/dbops/backup_controller_dbops.class.php: call to backup_controller_dbops::create_temptable_from_real_table()
  • line 39 of /backup/moodle2/backup_stepslib.php: call to backup_controller_dbops::create_backup_ids_temp_table()
  • line 34 of /backup/util/plan/backup_execution_step.class.php: call to create_and_clean_temp_stuff->define_execution()
  • line 153 of /backup/util/plan/base_task.class.php: call to backup_execution_step->execute()
  • line 148 of /backup/util/plan/base_plan.class.php: call to base_task->execute()
  • line 110 of /backup/util/plan/backup_plan.class.php: call to base_plan->execute()
  • line 309 of /backup/controller/backup_controller.class.php: call to backup_plan->execute()
  • line 111 of /backup/util/ui/backup_ui.class.php: call to backup_controller->execute_plan()
  • line 89 of /backup/backup.php: call to backup_ui->execute()
In reply to Eloy Lafuente (stronk7)

Re: Restore backup from 2.0 into 2.2 gives error Table "backup_ids_temp" does not exist

by Enrique Arturo García -

I have this proble, please help me.

Regards,

 

Table "backup_ids_temp" doesn't exist

Debug info: 

Error code: ddltablenotexist
Stack trace:
  • line 519 of /lib/dml/moodle_database.php: dml_exception thrown
  • line 1112 of /lib/dml/moodle_database.php: call to moodle_database->where_clause()
  • line 1659 of /backup/moodle2/backup_stepslib.php: call to moodle_database->get_records()
  • line 34 of /backup/util/plan/backup_execution_step.class.php: call to backup_annotate_groups_from_groupings->define_execution()
  • line 153 of /backup/util/plan/base_task.class.php: call to backup_execution_step->execute()
  • line 163 of /backup/util/plan/base_plan.class.php: call to base_task->execute()
  • line 110 of /backup/util/plan/backup_plan.class.php: call to base_plan->execute()
  • line 309 of /backup/controller/backup_controller.class.php: call to backup_plan->execute()
  • line 111 of /backup/util/ui/backup_ui.class.php: call to backup_controller->execute_plan()
  • line 89 of /backup/backup.php: call to backup_ui->execute()
 
In reply to Kurien Philip

Re: Restore backup from 2.0 into 2.2 gives error Table "backup_ids_temp" does not exist

by Darren Dickson -

I get this same error message when I try to use the x2 function to copy an activity or label (which seems really bizar, coz I don't know what that has to do with backup).

I previously had a similar problem with an error message that said that the backup_ids_temp already exists when I tried to run a backup. On deleting the temp file, my back up works, but I have the ne problem outlined above.

Have checked permissions and they seem to be fine.