How I upgraded CiviCRM 3.4 to 4.1 and Drupal 6 to 7
Note: A comment below says that this procedure does not work for upgrading from 3.4 to 4.2. (Thanks Paul!)
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!
As you'll see from this 1,500 word wiki page it's not simple. In the end I sort of found my own way to do it and wrote a script to make it (slightly) easier.
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:
- civicrm/admin/setting/path?reset=1
- civicrm/admin/setting/updateConfigBackend?reset=1
And by 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 :-)

Comments
Add new comment