|Use this document to UPGRADE CiviCRM installations on Drupal to a 2.2 or later release from version 2.1x, or from an earlier 2.2 version|
|Version 2.2 Requirements|
Before beginning this upgrade, verify that your server meets the requirements for CiviCRM 2.2.
- CiviCRM 2.1.x : You must be running CiviCRM 2.1.x to use this upgrade. Running a version prior to 2.1? First upgrade to 2.1 using these instructions
- Drupal 6.x : CiviCRM 2.2 is been built to run under Drupal 6 and is not compatible with Drupal 5 sites.
- PHP 5.x : Starting with the 1.9 release, CiviCRM will NOT run on PHP4 servers* (more info...).
- MySQL 5.0.x or higher : CiviCRM is compatible the current generally available MySQL release.
|Upgrade a Copy of Your Site First and Make a Complete Backup|
We strongly recommend that you create a copy of your existing site (directories and database) - and upgrade that copy first in order to make sure you can complete the upgrade successfully. In any case, you should create a full backup of the installed civicrm directory tree and civicrm database before beginning the upgrade process.
If you are upgrading a COPY of your production 2.1 site - make sure the site you are about to upgrade is a fully functioning 2.1 installation before you begin the upgrade process. (more info...)
Step-by-step Upgrade Procedures
1. Download the v2.2 CiviCRM Package
2. Take the Site Offline (for production site upgrades)
When upgrading a production site, it is recommended that you take your site offline during the upgrade process.
Administer » Site Configuration » Site Maintenance
3. Backup your CiviCRM database
Refer to the http://dev.mysql.com/doc/refman/5.1/en/mysqldump.html or http://wiki.cihar.com/pma/FAQ_6.4|phpMyAdmin documentation] if you need information on backing up your database.
4. Backup and then delete all 2.1 code files
CiviCRM will not run properly if 2.1 files are present after the upgrade. Make sure you have a good backup of your complete 2.1 installation and then delete /sites/all/modules/civicrm.
Be sure that your backup copy of the previous version codebase is NOT located below the <drupal home>/modules or <drupal home>/sites/all/modules directory. For example, placing your codebase backup in <drupal home>/modules/civicrm.bak... will cause errors (Drupal executes any *.module files that are found in the modules or sites/all/modules directory tree).
5. Unpack the 2.2 package and verify permissions
- Unpack the 2.2 files into <drupal home>/sites/all/modules/.
- You should now have a new civicrm directory tree under the <drupal home>/sites/all/modules/ directory.
- Ensure that your Drupal files directory is writeable by the webserver. You can use the following command to set proper permissions:
6. Run the Upgrade script
This step is required for ALL upgrades.
|MySQL 4.0 and 4.1 are Not Supported|
Support for MySQL versions 4.0 and 4.1 has been discontinued. This means that you may encounter various issues and/or unexpected behavior if you atempt to run CiviCRM under these versions, and the CiviCRM engineering team will not provide support for debugging or resolving these issues. You are strongly encouraged to upgrade to the current generally available release of MySQL.
* Point your web browser to the following URL (you should already be logged in to Drupal with administrator-level permissions):
- *- If "clean URLs" are enabled
- If "clean URLs" are NOT enabled
- You should see the Upgrade screen.
- If you are ready to upgrade, click the Upgrade Now button.
- You should see the message Upgrade successful when the upgrade completes.
- If you receive any errors during the process, please note down the exact error message, and check for solutions on the community support forum.
- Now click the Return to CiviCRM home page link. This will rebuild CiviCRM menus automatically and return you to the CiviCRM home dashboard. You should the message Menu has been rebuilt.
7. Verify and Update Resource URL Settings
- Go to Administer CiviCRM » Global Settings » Resource URLs
- Refer to the field help on that screen for instructions.
8. Enable Components
If you plan on using the new CiviCase component, or any components that you weren't using in the prior version (e.g. CiviPledge or CiviGrant for grant management) - you'll need to enable these component(s):
- Go to Administer CiviCRM » Global Settings » Enable Components
If you have been using Cases in 2.1 and / or want to start using the CiviCase component, you will also need to complete additional configuration steps. Learn more...
9. Review and Update Drupal Permissions Settings
- It's a good idea to verify Drupal role-based permissions which were added in recent releases. You can review and update these at Administer » User Management » Permissions:
- access CiviMail subscribe/unsubscribe pages : Enable this permission for the anonymous user role if you want any contact in your database to be able to subscribe to public "Mailing List" groups from http://<drupal_site>/civicrm/mailing/subscribe?reset=1 AND to unsubscribe by clicking a web-link in your mailings.
- view event participants : If you want to allow some constituents to see a list of registered participants for a given event at http://<drupal_site>/civicrm/event/participant?id=N&reset=1, then enable this permission for the appropriate Drupal role(s).
- access all custom data : You must enable this permission for any role which you want to view or edit custom data fields. EXAMPLE: If your site uses Profile(s) which include custom fields - make sure the role(s) that need to access these Profiles have this permission.
- access Contact Dashboard : You can now provide authenticated users with access to a screen where they can review their subscribed groups, contributions, memberships and event registrations (as applicable). Enable this permission for role(s) for which you want to provide this feature.
- access CiviEvent : If you plan to use CiviEvent, enable this permission for role(s) which will be creating and managing Events and Event Participants.
- register for events : If you plan to use CiviEvent and want to allow online event registration - enable this permission. Be sure to assign this permission for the "anonymous" role if you want to allow un-authenticated visitors to register for events.
10. Clear Views' cache (for sites using Views 2 integration)
- If you were using Views integration prior to this upgrade, you will need to go to Administer › Site building › Views › Tools and press "Clear Views cache" for Views to capture changes in the CiviCRM Views integration code.
11. Put the Site Online (for production site upgrades)
- Toggle the following feature, and put your site back online:
Administer » Site Configuration » Site Maintenance
- Review Your upgraded site and verify that your data is intact.
- Check out the new features and improvements. A summary of the cool new stuff can be found here.
Check this section for answers to upgrade problems. If your problem isn't addressed here, check out the Installation and Configuration Trouble-shooting page for additional resources.
Reset Your User Session
If you are getting foreign key constraint errors when trying to add or modify records, you may need to reset your user session.
- Temporarily enable CiviCRM debug features:
- Go to Administer CiviCRM » Global Settings » Debugging
- Set Enable Debugging to Yes and click Save.
- Click the Administer CiviCRM menu (or any other CiviCRM menu item). After the page is loaded, add an additional query string value (sessionReset=2) to the URL in your browser's location bar, and reload the page.
- Now reset Enable Debugging to No and click Save.
|Do Not Leave Debug Features Enabled for a Public Site|
Debugging should be disabled for publicly available sites as it may allow browsers to view system configuration information.
Verify and Update Base Directory and Base URL Settings in the Database
If you are seeing problems with missing images or page styling, you may need to adjust the Base Directory and Base URL Settings in the database. You can do this from:
Administer CiviCRM » Configure raquo; Update Directory Path and URL
Verify and Update Configuration Settings File
CiviCRM v2.1 stores most configuration settings in the database. However values needed to load the code and database are stored in the settings file and may need to be updated prior to beginning the upgrade process if you are upgrading a copy of your working 2.1 site:
- Open civicrm.settings.php with your favorite editor and verify or update the following values:
- $civicrm_root : If you are running this installation in a different directory from your 2.1 site, update this setting with the new path.
- CIVICRM_TEMPLATE_COMPILEDIR : If you are running this installation in a different directory from your 2.1 site, update this setting with the new path.
- CIVICRM_UF_BASEURL : If the Drupal URL for this site is different from your 2.1 site, update this setting with the base URL for your Drupal home page.
- CIVICRM_UF_DSN : If this install will be using a different database for Drupal, update this setting.
- CIVICRM_DSN : This setting must contain the correct information for your 2.1 database. If you are upgrading a copy of your 2.1 database that has a different database name - you will need to change the civicrm_db portion of the setting below. Also review the other values to make sure they are correct for the database that will be used for 2.1.
- CIVICRM_SITE_KEY : If you are upgrading to 2.2 from a version earlier than 2.0.7, you will need to define your CIVICRM_SITE_KEY. Components such as CiviMail's cronjob will not function without the site key with CiviCRM 2.2. Learn how to define the site key here: http://wiki.civicrm.org/confluence/display/CRMDOC/Command-line+Script+Configuration
A fatal error appears when I try to load a CiviCRM page.
This error likely indicates that the new CiviCRM configuration file is not in the expected location or that the $civicrm_root setting is incorrect. See step 3 above.
Foreign Key Errors or Warnings During the Database Upgrade
Foreign keys may have been assigned different names on some installations. Also, different versions of MySQL handle the dropping and adding of constraint checks differently. Try this procedure or this procedure (on the forum) to reload your data into a new 2.0 database structure if you are having this type of issue with upgrading your database.
If your CiviCRM codebase is NOT located in either <drupal root>/modules/civicrm or <drupal root>/sites/all/modules (i.e. you are using a symlink from there to your codebase) - you will need to create a local file in the top-level directory of your codebase which points to the location of your drupal sites directory.
Access Forbidden (403) Error After Upgrade
This may be caused by directory permission settings. Make sure your <drupal home>/files/civicrm directory is set with chmod a+rwx -R
If you're still getting this error and have clean URLs enabled, try disabling clean URLS (Drupal >> admin >> settings) prior to running the session reset and cleanup. Then re-enable clean URLs.
Having strange problems with Administrative settings forms after upgrade? Try this: http://wiki.civicrm.org/confluence/pages/viewpage.action?pageId=2981949 or try deleting all files in [yoursite]/files/civicrm/templates_c/