Easy Upgrade to Drupal 7
If there's one thing I've learned about upgrading Drupal sites, it's that you're going to have to do the same 50 steps over and over and over again to fix things as they fail. It's awful, tedious work. Luckily, Drush now has "drush site-upgrade," which makes things considerably easier. Still it ignores a couple of the really fundamental things like making sure your existing Drupal 6 site is up to date before it starts, and copying the files directory over to your new site. So I wrote a shell script to do all of this for me.
What it does:
- Take a Drupal 6 site, update all modules and core to the latest 6.x versions.
- Copy the site to a new directory, download Drupal 7 and any modules that have 7.x equivalents.
- Transfer and attempt to update the database for core and all installed contributed modules.
- Fix a few common problems that typically pop up along the way.
How to use it:
- Download the scripts. Make them executable by doing:
chmod 700 Up2Drupal7.sh RegistryRebuild.sh
- Create a new Drush site alias. This alias will be for your NEW site, not the old one. It's a bit confusing, but you need to make an alias for a site that doesn't exist yet. Make sure you specify an empty folder as the drupal root and an empty database for db-url.
- Move to the root of your Drupal 6 site, and run the script with the following command:
Up2Drupal7.sh @your_destination_alias.
You do not need to enter a source alias. - Sit back and watch as your site transforms into a Drupal 7 masterpiece.
Notes:
- Don't run this from your production Drupal 6 site. Use a development/staging environment, because it can easily break things.
- If you have any "trouble modules" (ones that break the upgrade process), just edit Up2Drupal7.sh and add them to the "trouble modules" list. They will be temporarily disabled on your Drupal 6 site and excluded from the auto upgrade. An attempt will be made to download and enable them after the rest of the upgrade is complete. I had some problems with views_update_6011 and needed to exclude views in order to do a successful upgrade.
- RegistryRebuild.sh fixes a disturbingly common problem of your upgrade getting stuck without any data in it's file registry. This typically shows up after Drush hits a minor error in the upgrade process and exits. RegistryRebuild.sh is required by Up2Drupal7 and will be run when necessary.