I am finally upgrading the CiviCRM on a website I didn't develop. It is running on Drupal 7.50, (upgraded from 7.37), and is currently version 4.3.8. Planning to upgrade to 4.7.13.

Here's the thing: it was set up outside of the Drupal docroot, using symlinks and some other setting changes. It works, but it's more complex than the usual setup. Due to the already heavy nature of our Drupal site, it is my understanding that this setup would help with performance issues. I want to both upgrade it and move it into the Drupal sites/all/modules directory.

Aside from the usual steps to perform the upgrade up so many versions, I wanted to see if anyone could anticipate any upgrade problems I might have and evaluate my plan outlined below to complete the upgrade, due to this unique situation? Let me know if this is out of the scope of this forum, and I'll remove it, though it might be helpful if someone else finds themselves in the same boat. I am going to try these steps out on a dev copy before attempting it on production.

The Setup:

CiviCRM root is in /var/www/html along with our Drupal Docroot, and all components are as such:

  • CiviCRM Home: /var/www/html/civicrm/v.4.3.8-d7

  • Drupal Home: /var/www/html/drupal/docroot

  • CiviCRM Settings: <drupal home>/sites/default/civicrm.settings.php

  • CiviCRM Files: <drupal home>/sites/default/files/civicrm

  • Symlink to Codebase: <drupal home>/sites/all/modules/civicrm -> <civicrm root>/v.4.3.8-d7

  • Settings_Location.php: <civicrm home>/v.4.3.8-d7/settings_location.php

       define( 'CIVICRM_CONFDIR', '/var/www/html/drupal/docroot/sites' );

The Plan:

  • Back up the Drupal and CiviCRM codebase and database into '/var/www/html/backups'

  • Login to Drupal site and put website into maintenance mode; stay logged in

  • Disable Drupal CiviCRM integration modules

  • *Delete symlink in <drupal home>/sites/all/modules

  • Make the <drupal home>/sites/default directory writeable to the server

  • Download and unpack v4.7.13 to <drupal home>/sites/all/modules

  • Backup and move civicrm.settings.php file

  • Clear browser cache and all files in <drupal home>/sites/default/files/civicrm/templates_c/

  • Run the install: http://<drupal home>/civicrm/upgrade?reset=1 (for clean URLS)

  • Update the CiviCRM Resource URL

  • Re-enable Drupal CiviCRM integration modules

  • Check Drupal role settings

  • Pull the site out of maintenance mode

*extra or modified steps I added to the usual ones listed in the upgrade guide:

Resources https://wiki.civicrm.org/confluence/display/CRMDOC/Upgrading+CiviCRM+for+Drupal+7

1 Answer 1


This looks overall good! A few suggestions though:

  • I would advise moving Civi 4.3.8 into the sites/all/modules folder separately from the upgrade. Since this is a fairly unique setup, it would be good to eliminate it so that if something goes wrong, you know this isn't the issue. You should be able to do that just by enabling maintenance mode, removing the symlink, and moving the CiviCRM folder to where the symlink was. Make sure there are no references to the incorrect location in civicrm.settings.php or in Administer menu » System Settings » Directories or Administer menu » System Settings » Resource URLs.
  • I'm not sure what settings_location.php is, that's probably specific to your setup
  • Depending on how abused your database is, you may encounter upgrade errors going from 4.3 to 4.7. If so, don't forget when rolling back to drop your CiviCRM database and create a new blank database before restoring! A restore will not delete newly-created tables, and CiviCRM upgrades choke when they try to create a table that already exists.
  • I also needed to move my backups folder and my original CiviCRM folder out of var/www/html or else I would get the following error: Fatal error: Cannot redeclare class CRM_Core_DAO in /var/www/html/example/docroot/sites/all/modules/civicrm/CRM/Core/DAO.php on line 0
    – Christia
    Dec 20, 2016 at 23:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.