This article is from 2012 and a lot has changed in CiviCRM since it was written. Some useful comments below:
- Paul says that this procedure does not work for upgrading from 3.4 to 4.2. (Thanks Paul!)
- Sophie says you have to go to the latest 4.x via a stop-over at 4.1, which introduces a security bug that won't be solved by then upgrading. Please see her comment. (Thanks Sophie!)
Original article from 2012
The path I took was
- Migrate my site to a test server
- Upgrade CiviCRM from 3.4 to 4.1 on the existing Drupal 6 site.
- Upgrade Drupal from 6 to 7 while simultaneously updating the CiviCRM codebase for Drupal 7
I found lots of pages on CiviCRM's wiki about various upgrades, but apparently one's not been written for the upgrade of D6 to D7. So thought it would be worth sharing this.
Migrating to a test server
Believe me, you need a practise run at this upgrade, but even this first step is ridiculously fiddly!
Upgrading CiviCRM from 3.4 to 4.1
CiviCRM 4.1 has two versions, one for Drupal 6 and one for Drupal 7. There's a constant, CIVICRM_UF, in the civicrm.settings.php file that needs to be Drupal6 for the drupal 6 version, and just Drupal for the d7.
I mostly followed the instructions except that you need to ignore the big red warning at the top that tells you "Please modify civicrm.settings.php" because while you do need to do it, if you do it first you'll get nowhere. It tells you when to do it later on.
Upgrading to Drupal 7
I mostly followed the instructions on Drupal.org but with a twist. Here's what I did
- Logged in as admin.
- deleted sites/default/default.settings.php
- moved the sites/ folder (and my other folders, e.g. I use a civicrm_customisations folder) out of the way.
- deleted everything in the webroot folder(!)
- Downloaded and un-tarred the latest Drupal 7.14 (well, I cloned it from git).
- Brought back in my sites folder, overwriting any files therein, with cp -ar /path/to/old/sites ./
- Edited sites/default/civicrm.settings.php and changed Drupal6 to just Drupal
- Deleted sites/all/modules/civicrm
- Downloaded and unpacked CiviCRM 4.1 for Drupal 7 into sites/all/modules
- Visited http://example.com/update.php
Comfortingly, this last step brought up Drupal's lovely updates interface with 128 updates required, and sure enough one of them was to do with CiviCRM - great!
This ran through smoothly. Yippee.
Fiddles and the last remaining niggle
A lot gets unbroken by visiting, checking and submitting the forms on these pages:
rm -rf sites/default/files/civicrm/templates_c/*
The last thing I'm stuck with is that Contact pictures are still failing to load - the PHP is calling getimagesize() but using the old URL! I haven't found where this is stored yet (or why it's not updated with the path/updateConfigBackend wizardry). If you know, do leave a comment :-)