DNotes LLC

DNotes LLC

Drupal development, hosting, and consulting

Quick and dirty migration to new Aegir platform

EDIT: This post is being left published for archival purposes; however, the procedure described below is definitely not recommended. In fact, it is not recommended to keep anything in the site-specific modules and themes folders.


I've been trying out the managed Aegir mini offering by Omega8.cc, and been quite happy with it. A few days ago I got a message that I needed to migrate them over to another platform because they weren't on a Pressflow-based Drupal 6 platform. These are sites that I haven't touched for a long time - apparently, in fact, since before I started using Pressflow. So then: how to migrate the sites without spending a lot of time on them? I decided to just move all the code into each site's folder and then migrate. Here's how to do it:

  • Backup your sites. It's just a good idea.
  • Log in as user 1.
  • If there are any modules that EXPECT libraries to be in your sites/all/libraries folder, you must first COPY those libraries over to your site's folder and then redo the settings. The "Drupal for Facebook" module, for example, wanted me to edit the settings.php file, but mine was not writable, so a little drush vset worked just as well:
    cp -R sites/all/libraries/facebook-php-sdk sites/[sitename]/libraries
    drush vset fb_api_file 'sites/[sitename]/libraries/facebook-php-sdk/src/facebook.php'
  • Move all your contrib modules, libraries and themes out of sites/all and into your site's folder, e.g. from your Drupal directory:
    mv sites/all/modules/* sites/[sitename]/modules
    mv sites/all/libraries/* sites/[sitename]/libraries
    mv sites/all/themes/* sites/[sitename]/themes
  • You will notice that violently jerking your modules and themes out from underneath your site has the effect of breaking it. On the Aegir mini instances, probably because of their caching voodoo, even update.php gave me a 500 error. But, it worked again within 5 minutes, and after I ran through update.php (to tell the site where I put all its modules) and cleared the cache, it worked fine.

After all that work, your sites should be completely platform independent; all their site-specific code is stored in their own directories, and when Aegir migrates them to new core platforms, all that code will just be transferred right along with them. So, you're ready for the final step:

  • Migrate the site through the Aegir front end.

I used this recipe for dnotes.net and it took about 4 minutes for everything. For my purposes, this method - having all contrib modules, themes and libraries in the site-specific folder - will also work better for Drupal version updates and the like.

Technologies: