Migrate / Upgrade websites

Migrate / Upgrade websites

Migration Tips

In the context of sites, migration is the task of moving a site from one platform to another. Migration is the Aegir-preferred method for applying updates to modules and certainly to core. In other words, to upgrade core or modules, create a new platform with the upgrades, then migrate sites to the new platform.

Ideally, a migration requires nothing more than a mouse-click on the Migrate button on the Site node in your Aegir for the site you want to migrate. If you've prepared your destination platform properly, a migration will be this simple. Proper preparation, therefore, is vital.

To prepare a new platform to be a destination for migration, consider at least the following:

  • The directory structure for your modules and themes must be the same on the source and destination platforms. For example, if the modules on the source platform are in
    ../platform-abc/sites/all/modules/contrib
    then the destination platform must have its modules also in this directory.
  • You may need to clear the Drupal cache on the source platform to avoid migration errors. Upgrades to Aegir in the future may handle this automatically, so be aware of the version of Aegir you're running and whether it includes upgrades to address this issue.

Renaming the Aegir hostmaster site itself

From http://community.aegirproject.org/node/363 :

WARNING: Be sure to have a good backup (which you can restore) before attempting this.

  1. manually edit the crontab for aegir to stop the periodic execution of the command 'hosting-dispatch' (the drush command 'hostmaster-pause' did not exist on my system)
  2. delete the hostmaster site (drush @hostmaster provision-delete)
  3. change the alias (drush provision-save @hostmaster --uri=hostmaster2.example.com --aliases=hostmaster.example.com)
  4. deploy the backup (drush @hostmaster provision-deploy /var/aegir/backup/hostmaster.example.com...tgz)
  5. checked that all changes appeared correct - YES
  6. Reneabled the hosting-dispatch task by editing the crontab again
  7. ran a verify task against the new hostmaster site. Noticed that the site is listed on the site page with the old domain name. The verify failed.
  8. Found that the verify task had created a new entry in the hostmaster-6.x-1.7/sites directory for the old domain name. I removed this created directory. I found and edited (using phpMyAdmin) the relevant entries in the node and node revision tables for the hostmaster site to update the domain name (change the title field). The hosting_site_alias table may also need to be updated if you have site aliases.
  9. The verify task also seemed to have regressed the @hostmaster alias file (~/.drush/hostmaster.alias.drushrc.php) as it had the URI and aliases details from the old site back in it. I edited this file to return these items to their new values.
  10. The verify task now completed successfully and all seems to be working correctly.

#1

Various bits and pieces are fixed up, such as paths to files in the 'files' table of the database.

Can you be more precise here please? Or just tell where in the code we should look for it. Thanks!

#2

This is defined in provision, platform/drupal/deploy.inc