This is all I know for now, I'll test more and update the issue. It seems to be happening on many servers, with Debian Jessie (8) and Apache 2.4+ and PHP 5.3 to 5.6.

Please report here if you encounter this issue as well.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

gboudrias created an issue. See original summary.

gboudrias’s picture

This will produce a "database" error when visiting the old URL (instead of the logical 404), saying something like the database wasn't found (which is normal because it presumably got correctly deleted).

npacker’s picture

Just noticed this issue as well.

The cause seems to be the following logic:

function drush_provision_drupal_pre_provision_migrate($platform, $new_name = NULL) {
...
// If we are renaming the site, pick this up early.
if (!is_null($new_name) && ($new_name != d()->name)) {
  drush_set_option('target_name', $new_name);
  drush_set_option('source_name', d()->uri);

  // Detect if the platform stays the same.
  if (d()->platform->name == $platform) {
    drush_log('Replacing the existing site on the same platform');
    // deploying over existing site.
    drush_set_option('deploy_replace_site', TRUE);
  }
}
else {
  // The site url stays the same, so the target platform
  // must be different if we run Migrate task, right?
  drush_set_option('target_name', d()->name);
}
...

In combination with:

function drush_provision_drupal_post_provision_migrate($platform, $new_name = NULL) {
...
if (!drush_get_option('deploy_replace_site', FALSE)) {
  // we remove the aliases even if redirection is enabled as a precaution
  // if redirection is enabled, keep silent about errors
  _provision_drupal_delete_aliases();
  _provision_recursive_delete(d()->site_path);
  d()->service('http')->sync(d()->site_path);
}
...

The issue seems to be that the code is only deleting the old site if the platforms are different, even if the site is renamed in the process.

I'll see if I can devise a patch as it seems a straightforward issue to remedy.

npacker’s picture

Haven't had a chance to test this yet.

npacker’s picture

Status: Active » Needs review
gboudrias’s picture

Status: Needs review » Reviewed & tested by the community

Thanks for the patch, seems to work nicely. Ideally I'd like to wait for someone else to test it too before committing since it's an important issue.

npacker’s picture

I expect to have a chance to test it today as well, should give us another data point.

  • helmo committed 0ed84fb on 7.x-3.x authored by npacker
    Issue #2617718 by npacker, gboudrias: Renaming site through Migrate...
helmo’s picture

Status: Reviewed & tested by the community » Fixed

Without the patch I verified that the site specific folder was left behind.
And after applying it was properly cleaned up.

Committed!

helmo’s picture

Issue tags: +Aegir 3.3
npacker’s picture

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.