setup_db_create_database is not honored in SilentInstall #3477

Open
opened 2026-02-20 16:05:54 -05:00 by deekerman · 0 comments
Owner

Originally created by @rthomas67 on GitHub (Dec 27, 2018).

Issue

If SuiteCRM is being set up using the config_si.php file containing setup_db_create_database=0, the code should assume that the intent is to use an existing database.

Expected Behavior

Setup should skip over the create database and drop/create tables code, as well as all user creation and demo data generation.

Actual Behavior

Tables are dropped and recreated anyway, even if setup_db_create_database = 0 (false)
Before performSetup.php is called, the value of setup_db_create_database is overwritten to 1 (true)

Possible Fix

Fix the logic around line 325 of checkDBSettings.php such that it does not overwrite the value of setup_db_create_database.
https://github.com/salesagility/SuiteCRM/blob/v7.10.11/install/checkDBSettings.php#L325

Currently the logic is:

if (the database doesn't support createUser) {
   turn off database creation
   ...other stuff...
} else // when the database does support createUser {
   ALWAYS turn on database creation, even if config_si.php said turn it off
   ...other stuff...
}

Steps to Reproduce

  1. Unpack SuiteCRM
  2. Create a valid config_si.php file in the app root directory
    Example: http://www.jsmackin.co.uk/suitecrm/suitecrm-command-line-install/
  3. Set the value of setup_db_create_database => 0
  4. Configure other settings to connect to an existing SuiteCRM mysql database
  5. Navigate to install.php?goto=SilentInstall&cli=true
    or invoke it from the command line with $_REQUEST = array('goto' => 'SilentInstall', 'cli' => true);

Context

Attempting to set up SuiteCRM in a docker container image so that it can be started/restarted from scratch with a SilentInstall to generate the config.php but NOT destroy the an existing database.

Low priority. Have worked around it for the moment by altering the SuiteCRM logic that mishandles the SilentInstall.
Patch files to make the container work are here (for reference): https://github.com/rthomas67/rpi-suitecrm/tree/master/container_setup_patches

Your Environment

  • SuiteCRM Version used: 7.10.11
  • PHP executed from command line (i.e. no browser involved)
  • PHP 7.0.33-0+deb9u1
  • Linux 06f490fbbd3e 4.14.67-1-ARCH #1 SMP Fri Aug 31 01:06:19 UTC 2018 armv7l GNU/Linux
    • On Docker for Raspberry Pi
  • mysql Ver 15.1 Distrib 10.0.36-MariaDB, for debian-linux-gnueabihf (armv7l) using readline 5.2
Originally created by @rthomas67 on GitHub (Dec 27, 2018). #### Issue If SuiteCRM is being set up using the config_si.php file containing setup_db_create_database=0, the code should assume that the intent is to use an existing database. #### Expected Behavior Setup should skip over the create database and drop/create tables code, as well as all user creation and demo data generation. #### Actual Behavior Tables are dropped and recreated anyway, even if setup_db_create_database = 0 (false) Before performSetup.php is called, the value of setup_db_create_database is overwritten to 1 (true) #### Possible Fix Fix the logic around line 325 of checkDBSettings.php such that it does not overwrite the value of setup_db_create_database. https://github.com/salesagility/SuiteCRM/blob/v7.10.11/install/checkDBSettings.php#L325 Currently the logic is: ``` if (the database doesn't support createUser) { turn off database creation ...other stuff... } else // when the database does support createUser { ALWAYS turn on database creation, even if config_si.php said turn it off ...other stuff... } ``` #### Steps to Reproduce 1. Unpack SuiteCRM 2. Create a valid config_si.php file in the app root directory Example: http://www.jsmackin.co.uk/suitecrm/suitecrm-command-line-install/ 3. Set the value of setup_db_create_database => 0 4. Configure other settings to connect to an existing SuiteCRM mysql database 5. Navigate to install.php?goto=SilentInstall&cli=true or invoke it from the command line with $_REQUEST = array('goto' => 'SilentInstall', 'cli' => true); #### Context Attempting to set up SuiteCRM in a docker container image so that it can be started/restarted from scratch with a SilentInstall to generate the config.php but NOT destroy the an existing database. Low priority. Have worked around it for the moment by altering the SuiteCRM logic that mishandles the SilentInstall. Patch files to make the container work are here (for reference): https://github.com/rthomas67/rpi-suitecrm/tree/master/container_setup_patches #### Your Environment * SuiteCRM Version used: 7.10.11 * PHP executed from command line (i.e. no browser involved) * PHP 7.0.33-0+deb9u1 * Linux 06f490fbbd3e 4.14.67-1-ARCH #1 SMP Fri Aug 31 01:06:19 UTC 2018 armv7l GNU/Linux * On Docker for Raspberry Pi * mysql Ver 15.1 Distrib 10.0.36-MariaDB, for debian-linux-gnueabihf (armv7l) using readline 5.2
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/SuiteCRM-SuiteCRM#3477
No description provided.