How to change database settings for a cloned SuiteCRM instance

Hi, I cloned SuiteCRM from ‘site1.mydomain.com’ to 'site2.mydomain.com". I did the cloning using tools external to SuiteCRM (I am not sure SuiteCRM has any self-cloning tools).

I am guessing that the database of the cloned instance (site2) still points to the same database as the original (site1) database. I need the cloned instance to be 100% stand-alone and separate from the original.

Where in Suite CRM would I go update the database settings?

Cheers,

Andy

It depends on what you are looking to obtain:

Option 1: Everything is the same but after the clone has taken place the original and the clone evolve separately
These are the steps:
. copy the whole directory of SuiteCRM in a new directory
. copy the database and install it with a new name
. update config.php of the clone (both db settings and host/directory settings)
. check that config_override of the clone does not contain references to db and host/directory information and in case update it
. update .htaccess of the clone
. log into the SuiteCRM clone as admin and run quick repair and rebuild

Option 2: Everything is the same and the db is shared
Note this is a risky situation because certain things like files, images, customisations are done at the filesystem level so you will end up in toruble unless you have a system to align the two folders simultaneously.
In any case these are the steps:
. copy the whole directory of SuiteCRM in a new directory
. update config.php of the clone (only host/directory settings)
. check that config_override of the clone does not contain references to host/directory information and in case update it
. update .htaccess of the clone
. log into the SuiteCRM clone as admin and run quick repair and rebuild

Option 3: Same program with same customisations but empty database
These are the steps:
. install a new instance of the same version of your original SuiteCRM
. once done delete the folder and keep the db
. copy the whole directory of the original SuiteCRM in a new directory
. update config.php of the clone (both db and host/directory settings - Note that you will have to point your db settings to the db created in the new installation)
. check that config_override of the clone does not contain references to db and host/directory information and in case update it
. update .htaccess of the clone
. log into the SuiteCRM clone as admin and run quick repair and rebuild

Extra information
. remember to set your permissions correctly on the instance you are creating before, during (I would do it after each step, and after). Search the forum if you need help on this
in config.php and config_override,php you have to look for:

 array (
    'db_host_name' => '<your_db_server_address>[:your_db_server_port]',
    'db_user_name' => '<your_db_server_user>',
    'db_password' => '<your_db_server_user_password>',
    'db_name' => '<your_db_name>',
    'db_type' => 'mysql',
  ),

 'host_name' => '<your_domain_name>',  // example: www.example.com
 
 'site_url' => '<url_to_your_suite_crm_instance>', // example: http://www.example.com/suitecrm

In .htacces you have to look for the folder where SuiteCRM is installed and update it with the folder of the clone

2 Likes

Thank you for a wonderfully exhaustive reply, I really appreciate it! Working on it now :slight_smile:

It is Option 1: Everything is the same but after the clone has taken place the original and the clone evolve separately.

Andy

Not sure if this is the correct place to post this but I would like to do option 3 mentioned above but with Sugar 6.5.16 ce. My longer term goal is to switch to SuiteCRM however I need to test some things first and upgrade mysql and php and the server OS before hand.

I have successfully cloned our production instance on the same server and it works but what I really want is an empty database with the same users, their screen customizations, and custom fields. Can you get a tad more specific in your instructions. Specifically -

“. install a new instance of the same version of your original SuiteCRM”
Do you use a different db name here so it does not overwrite the production one? It has been a while since I installed Sugar. Hopefully the install process asks for a directory to install to?

“. once done delete the folder and keep the db”
Would the folder to delete be /var/www/html/<new_db_name>?
I assume you mean keep new empty db you just created with the new install in mysql?

“. copy the whole directory of the original SuiteCRM in a new directory”
I assume /var/www/html/<production_db_name> to /var/www/html/<new_db_name>?

What about all the data in the upload directory? Will the Repair process delete all that? We have collected quite a bit there.

With the new fresh empty db does that mean I lost my user information as well as their customizations and my custom fields? Or does the repair bring that back also?

Let me know.