A number of settings stored in CiviCRM's database relate to the physical location in the server file system and the URL path. When you move an existing CiviCRM installation to a new server (or a new location on the same server) - these settings usually need to be changed. This documentation covers the general steps. Procedure applies to CiviCRM 2.0 +
This procedure is a "draft" and needs to be verified and improved on as people use it.
- Copy the codebase files to the new location.
- Copy the CiviCRM settings file(s) - civicrm.settings.php - to the new server / location. Drupal installs will generally have one settings file in <drupal_root>/sites/default. Joomla installs have two settings files: <joomla_root>/components/com_civicrm and <joomla_root>/administrator/components/com_civicrm.
- Copy your database(s) to the MySQL server if needed. (You can use mySQLdump or phpMyAdmin to dump the structure and content of your CiviCRM / CMS database(s)).
- Review the settings file(s) - and modify the following settings as needed:
- Update the following file so it uses the correct path:
- Empty civicrm_menu table, ( TRUNCATE TABLE `civicrm_menu` )
- Login to Drupal or to Joomla Administrator and enter the following URL in your browser:
- Drupal sites: http://<drupal_site>/civicrm/admin/setting/updateConfigBackend?reset=1
- Joomla sites: http://<joomla_site>/administrator/index2.php?option=com_civicrm&task=civicrm/admin/setting/updateConfigBackend&reset=1
- Rebuild the menus. The menu links in the civicrm_menu table contain full URL links and need to be updated with the new domain.
- Drupal sites: _http://<drupal_site>/civicrm/menu/rebuild?reset=1
- Joomla sites: _http://<joomla_site>/administrator/index2.php?option=com_civicrm&task=civicrm/menu/rebuild?reset=1
- Review the recommended modified paths in the form - they should reflect the new Base Directory and Base URL for CiviCRM.
Base Directory - For Drupal installs, this is the absolute path to the location of the 'files' directory. For Joomla installs this is the absolute path to the location of the 'media' directory.Base URL - This is your Drupal or Joomla site URL (e.g. http://www.mysite.com/drupal/).
- If these values do NOT look correct, then recheck the changes you made to civicrm.settings.php
- Otherwise click Save.
- Delete files with cached settings if you have copied files over into the 'files' directory.
- delete /civicrm/upload/Config.IDS.ini (contains URL values and will be rebuilt with correct settings if deleted)
- delete /civicrm/templates_c/* (cached versions of Smarty templates that will be rebuilt)
Your site should now be properly configured for it's new location but take a moment to check that the paths configured on the following pages appear to be correct.
CiviCRM › Administer CiviCRM › Global Settings Settings - Upload Directories Administer CiviCRM
CiviCRM › Administer CiviCRM › Settings - Update Directory Path and URL
CiviCRM › Administer CiviCRM › Global Settings >Settings - Resource URLs