Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Renaming (migrating in place) appears to be broken. Migrations across platforms appears to work, but when selecting the same platform, the new DB appears to be dropped, despite the new credentials being written into the vhost and drushrc. So the site breaks completely. Thankfully, the old database remains, so it's possible to recover, but only through manual intervention
Comment | File | Size | Author |
---|---|---|---|
#5 | provision-2055949-5.patch | 431 bytes | ergonlogic |
Comments
Comment #1
ergonlogicHere's a task log from a dev environment: http://pastebin.com/DAGxA6wz
The code in question is this in db/migrate.provision.inc:
Comment #2
ergonlogicActually, this is occurring whenever the domain name changes during a migration.
It's worth noting also that the task itself doesn't fail, per se. No error is thrown or anything like that. It just drops the new DB instead of the old one and then proceeds to delete the old site files.
Updated title to reflect this.
Comment #3
ergonlogicOkay, I think the problem here is with how we call destroy_site_database():
This method's parameter is optional, and we rely on fetch_site_credentials() to look up the proper site if none is provided. This in turn just looks at the current Drush 'site' context, which in this case has the credential for the new site. So, we could try to switch the site context credentials back to the original site. BTW, I think this might have been at the root of #1678528: Database deleted on edge cases.
But I believe we should be more conservative here. In all five instances where we call
destroy_site_database()
in Aegir core, we never pass in $creds. I think this is a mistake, considering the destructive nature of this method. I think we should make $creds required, so that the calling function has to be explicit about which database to destroy.Comment #4
ergonlogicFixed in b16aaef by reloading the original site context.
See #2056577: Ensure we're deleting the proper database for a follow-up on my broader concerns.
Comment #5
ergonlogicFor those running Aegir 2.0-rc2, here's a patch that fixes this issue, pending the release of RC3.
Comment #6
helmo CreditAttribution: helmo commentedSounds like a good idea.
Comment #7
anarcat CreditAttribution: anarcat commentedlooks good.