1

Working on a project on localhost, for which I installed the backup_migrate module, it seems one update procedure for this module had some problem (can't really remember what). And now every time I update any module (even totally unrelated), when performing the "update.php" script, Drupal states that there's the following pending update for the backup_migrate module:

7303 - Add a serial id field to all tables to allow them to be ctools exportable.

If I click apply, I get the usual progress bar, then the following error message:

backup_migrate module
Update #7303

Failed: PDOException: SQLSTATE[42000]: Syntax error or access violation: 1075 Incorrect table definition; there can be only one auto column and it must be defined as a key: ALTER TABLE {backup_migrate_sources} DROP PRIMARY KEY; Array ( ) in db_drop_primary_key() (line 2904 of C:\xampp\htdocs\my_site\includes\database\database.inc).

So it seems to me that the update job #7303 has already been applied successfully, but for some reason Drupal hasn't registered that and thinks it still needs to be done.

How can I correct that?

2

OK I think I found it, although I haven't yet been able to confirm that the problem has been corrected, since all my modules are up to date.

Based on this question, here's what I did:

  • find the ID number for the pending update. In my case it was stated plainly in Drupal's update.php messages, so it's 7303. This information can also be found in the .install file in the module folder (e.g. function backup_migrate_update_7303).
  • access the database (e.g. via phpmyadmin) and go to the system table.
  • in this table, find the entry corresponding to the module whose update is still pending (in my case: backup_migrate)
  • edit the schema_version column for this row and give it the value of the update ID found in step 1 (e.g. 7303).

And that's it.

  • Not sure this answer is fine : it will only skip the update, which could compromise the module if the db doesn't match the code. Partitularly important on backup functionnalities. – Countzero Aug 31 '17 at 13:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.