Hello,
The last time I updated my Drupal 7 following a new version of "Backup and Migrate", I just had time to see a red line without seeing what was wrong, and my terminal scrolled through a lot of lines (a common bug I have, when there is a cache dump, with the "Boost" module enabled) to finally give me back my hand. Finally, since I don't use Backup and Migrate for this site, I decided to disable the module (without uninstalling it for the moment). But tonight, while updating a completely different module (custom_breadcrumbs), I noticed that there were still traces of Backup and Migrate and that it wasn't going to make my life easier ^^.
Here's the terminal output:
drush8 up
Update information last refreshed: ven, 17/07/2020 - 23:03
Name Installed Version Proposed version Message
Custom breadcrumbs (custom_breadcrumbs) 7.x-2.0-beta1+34-dev 7.x-2.x-dev Mise à jour disponible
Code updates will be made to the following projects: Custom Breadcrumbs [custom_breadcrumbs-7.x-2.x-dev]
Note: A backup of your project will be stored to backups directory if it is not managed by a supported version control system.
Note: If you have made any modifications to any file that belongs to one of these projects, you will have to migrate those modifications after updating.
Do you really want to continue with the update process? (y/n): y
Project custom_breadcrumbs was updated successfully. Installed version is now 7.x-2.x-dev.
Backups were saved into the directory /home/admin/drush-backups/mydrupal7installation/20200717210317/modules/custom_breadcrumbs. [ok]
Backup_migrate 7303 Add a serial id field to all tables to allow them to be ctools exportable.
Backup_migrate 7304 Update all schedules to use the built in cron if none is specified.
Backup_migrate 7305 Fix schema mismatch after upgrade.
Backup_migrate 7306 Leave a message to explain the mixup over the backup option.
Backup_migrate 7307 - 'backup_migrate_backup_memory_limit' vs 'backup_migrate_memory_limit'.
Backup_migrate 7308 Update profiles table filter field to accommodate larger serialized strings.
Backup_migrate 7309 NodeSquirrel support has been removed.
Backup_migrate 7310 Disable e-mail destinations.
Backup_migrate 7311 Adjust the default performance settings.
Do you wish to run all pending updates? (y/n): y
SQLSTATE[42000]: Syntax error or access violation: 1072 Key column 'source_id' doesn't exist in table [error]
Performed update: backup_migrate_update_7303 [ok]
'all' cache was cleared. [success]
Finished performing updates.
What do you suggest I do to get back on my feet and have a clean approach to this site?
Comment | File | Size | Author |
---|---|---|---|
#18 | backup_migrate_update_8-25-20_success.png | 96.4 KB | ownage |
#3 | backup_migrate-n3159991-3.patch | 2.28 KB | DamienMcKenna |
Comments
Comment #2
NobuT CreditAttribution: NobuT commentedI'm having the same issue from 7.x-2.8 to 7.x-3.9. In my case, I've updated only Backup and Migrate module. I have replaced the module folder with the new version (no 7.x-2.8 remains there). Then, I ran drush updb.
Then, I ran the dbup the second time. Now, the SQL error is the same as OP.
Appreciate if someone know any remediation.
Comment #3
DamienMcKennaThat sucks, I'm sorry you've both run into this problem.
This is a bit tricky. When backup_migrate_update_7303() runs it should already have backup_migrate_sources.source_id available, but it seems like in certain circumstances this isn't true.
At the very least it should check the four tables have the appropriate field, and if not fail so it can be reran.
Please test this patch to see if it helps. Thank you.
Comment #5
floown CreditAttribution: floown commentedI had desactivated the module, so what should I do now? Reactivate it, then apply the patch?
Or what else to do? Make a drush8 dl 7.x-3.x-dev?
Thanks.
Comment #6
solideogloria CreditAttribution: solideogloria commentedYou won't be able to do the upgrade using
drush up backup_migrate
, so you will have to download the module, apply the patch, then install/enable the module. The patch has not yet been applied to dev, so you need to download the module's latest release, then download the patch and apply it. See https://www.drupal.org/patch/applyComment #7
floown CreditAttribution: floown commented@solideogloria : ok, I will try so. But the patch is ok? It is 'in red'.
Comment #8
DamienMcKennaIf you uninstall the module then it won't run the updates because they won't be needed. If you don't need to retain your B&M settings then this might be the simplest way of handling it.
If you do want to test the patch you can leave it disabled, apply the patch, run the updates again and see what happens.
Could everyone who running into this problem please let me know what version of the module you were using before you updated? That'll help work out a fix that works for all scenarios. Thank you.
Comment #9
floown CreditAttribution: floown commentedThank you Damien for your first piece of advice, as I was saying I wasn't using B&M anymore and you allowed me to get back on my feet without any damage. I've just understood a bit more about the upgrade mechanics thanks to you. You have always been extremely educational with me.
I'm sorry I couldn't do the patch test, and I hope someone will be able to answer your question.
Very nice evening to you, I can breathe again with my D7 ^^
Comment #10
NobuT CreditAttribution: NobuT commentedThank you, Damien. Your suggestion is the simplest way to upgrade! Haven't thought about it at first, but I've realized that I don't have complicated configuration. Appreciate your time for the patch. Let me know if it's worthwhile to test it in my environment, which is older PHP (5.x) and MySQL 5.7.
Comment #11
DamienMcKennaYou're welcome.
Out of interest, what version of PHP 5?
Comment #12
NobuT CreditAttribution: NobuT commentedThe environment I tested was
PHP: 5.6.37
MySQL: 5.7.23 (utf8mb4 not enabled)
Comment #13
Kniekel CreditAttribution: Kniekel commentedThank you for your time and your support!
I've applied the patch and I'm now getting the error message that you added in the patch:
I am using PHP 7.0.33-nmm1 and MySQL 5.7.28
Perhaps I could do the necessary changes by hand in MySQLAdmin? Well, that's not a solution for everybody, but that could solve it for me.
Comment #14
Kniekel CreditAttribution: Kniekel commentedOK, now I did a pm-uninstall and reinstall.
There seem to be some rests of the old configuration. Especially, I still have a (greyed out) entry for NodeSquirrel under "Schedules".
When I try to configure things (eg add a Schedule) I get the following:
REFERRER /admin/config/system/backup_migrate/settings/destination/add/file
NACHRICHT Notice: Undefined index: subtype in backup_migrate_item->decode_db_row() (Zeile 545 von /d7/sites/all/modules/backup_migrate/includes/crud.inc).
Addition: It seems that updates 7303 and following didn't perform at all, but due to the reinstall, the update script doesn't know that. So, what to do now?
Comment #15
DamienMcKenna@kniekel: What version of B&M did you have installed before you updated?
You don't need to run updates 7303+ because when you uninstall the module completely and reinstall it, all of the schema & configuration changes are built using the latest APIs.
I am confused as to why it mentions Nodesquirrel - had you exported your site's B&M configuration with Features or something? There should be no mention of Nodesquirrel anywhere at this point.
Comment #16
Kniekel CreditAttribution: Kniekel commented@DamienMcKenna Well, that confuses me, too. I don't have anything like Features enabled. I did drush pm-disable, pm-uninstall, and then drush en. And of course drush cc all in between. I'll give it another try.
On the other side, it would be a bit of work to re-configure this for all my sites. I still have a bunch of sites running on D7 in a multisite installation. (Lots of work to do for D9 ...)
I'm afraid I can't tell which was the last version before the upgrade. Probably the last stable before. I run an update script (including drush up, drush updb and some other things) about once a week.
Edit: I tried uninstall/reinstall for a second time and now everything works fine. I don't know why.
Comment #17
AnybodyI can confirm this problem still exists. Patch from #3 leads to:
and even if running this multiple times, it doesn't work. PHP 7.2
Comment #18
ownage CreditAttribution: ownage commentedI haven't applied any patches but just updated two of my sites (nearly identical) from 7.x-2.8 to 7.x-3.4 (newest). One succeeded (image below) and one failed (same couple errors noted from #2).
First the one that succeeded:
Then the one that failed:
Update #7303
First error upon running update.php:
Now continuous error upon running update.php:
Help!
Comment #19
ownage CreditAttribution: ownage commentedJust tried to update from 7.x-2.24 to 7.x-3.4 on another website and the same failures are happening.
Comment #20
ahmed.raza CreditAttribution: ahmed.raza commentedI am having the exact same issue while trying to run database updates. Version: 7.x-3.9
Failed: PDOException: SQLSTATE[42000]: Syntax error or access violation: 1072 Key column 'source_id' doesn't exist in table: ALTER TABLE {backup_migrate_sources} ADD INDEX `temp` (`source_id`); Array ( ) in db_add_index() (line 3000 of /Users/ahmedraza/sites/drupal/includes/database/database.inc).
Comment #21
ownage CreditAttribution: ownage commentedI just fixed it by uninstalling & reinstalling... be sure to backup your schedules / directories if you go this route.
Comment #22
danrodI also fixed this by uninstalling & reinstalling.
Comment #23
DamienMcKennaComment #24
arnoldbird CreditAttribution: arnoldbird commentedI am having this same issue. Uninstalling & re-installing is not a good option for me because there are several modules in my site that have this module as a dependency. Can I add the column manually?
The site current has Backup and Migrate 7.x-3.9. I don't know what it had previously. I have inherited the site from someone else and apparently they upgraded the module code at some point but never successfully ran the database update.
Comment #25
Patricia_W CreditAttribution: Patricia_W as a volunteer commentedI decided to uninstall and reinstall backup_migrate and the problem went away