We have developed a white label Drupal and CiviCRM installation which we plan to use to launch a new server. When changing over I usually change the settings files to match the new database settings. However, I have noticed that the CiviCRM Site key also need to be changed. How can I go about doing this or is this not possible? THanks.

  • Are you just cloning and site and modifying the civicrm.settings.php file? Can you use a similar approach to what you are doing with the dsn? Apr 15, 2015 at 3:22
  • Hi Donald. Yes, just cloning the site and modifying the civicrm.settings.php file. I modify the base URL and the database login credentials. Not sure what to do with the site key. We are keeping the same name for the database for now on the new server. If I try to change the database name the website stops working. Another issue to figure out! Apr 15, 2015 at 3:53

1 Answer 1


Changing the site key will break a few things. How many of these are important is up to you, but at least: - every rest interface that connects to the site to read or write (you might not have any) - any hash (eg. link to update preferences). this might not be an issue if the domain name changes too - anything that is saved encrypted (eg. the password for the smtp connection).

search the code base for CIVICRM_SITE_KEY to have a complete list.

This being said, the easiest is probably simply to change and wait for a while to see if it breaks any of the features YOU use.

The value of the key itself doesn't matter, as long as it's hard to guess and long enough. The setup process generates it that way:

md5(uniqid('', TRUE) . $params['baseURL'])

so a random hash of 32 characters

  • Thanks for your reply. This is a new site changing over so I rather make the changes now and break it then later. How could I create a new site key then? Cheers Apr 15, 2015 at 7:56
  • the value of the key by itself doesn't matter. During the install, its md5(uniqid('', TRUE) . $params['baseURL']
    – Xavier
    Apr 15, 2015 at 8:17
  • thanks for your help. I have made the changes as per your suggestions. Lets see how it goes. Cheers. Apr 16, 2015 at 6:56

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.