The CFO finally agreed to your department’s request for additional database server hardware. Now you have a completely new database environment that needs to be built consisting of several database servers. The Infrastructure Team has finished their part of allocating the resources necessary and installing the Operating System. They configured the servers so that the hard drive assignments are all identical. Management agrees that the database server version to be installed is identical, pretty much the same server builds except the RAM and CPU allocations based upon expected workloads. All of the settings are either identical or very similar.
As you are building one of the new servers you can take screen shots of every step, put them into a Word document or some such and click the appropriate buttons, and manually enter the data according to the captured steps. The other option is to use something you may have heard of that will allow for a consistent build and will also save you from making errors at 0300 hours and on your 6th build when you are really tired, and your eyes are getting a little buggy from repeatedly seeing the same screens over and over again. It is a configuration file called, cunningly enough, ConfigurationFile.ini and it is generated by SQL Server during the install process.
What is a ‘ConfigurationFile.ini’ file and how do I get one?
It is a file that is created every time a SQL Server Database Engine is installed. The path to it is provided right before you click ‘Install’. Here is the final screen when installing a named instance of SQL Server 2019 Developer Edition. Right on the very bottom you can see the path where this file is located. The second image is the close up of the same pathing information, just isolated to make it easier to find. Every install of the database engine produces this file, and your existing servers should have this file as well based upon the version installed
Below is my Configuration File, particulars altered of course. In this example there are 56 switches/options that will need to be reviewed and set for each installation. We will not be covering any of them in detail as that is covered off better here by Microsoft.
Contents of a Configuration File
;SQL Server 2019 Configuration File
; Specifies a Setup work flow, like INSTALL, UNINSTALL, or UPGRADE. This is a required parameter.
; Specifies that SQL Server Setup should not display the privacy statement when ran from the command line.
; Use the /ENU parameter to install the English version of SQL Server on your localized Windows operating system.
; Setup will not display any user interface.
; Setup will display progress only, without any user interaction.
; Parameter that controls the user interface behavior. Valid values are Normal for the full UI,AutoAdvance for a simplied UI, and EnableUIOnServerCore for bypassing Server Core setup GUI block.
; Specify whether SQL Server Setup should discover and include product updates. The valid values are True and False or 1 and 0. By default SQL Server Setup will include updates that are found.
; If this parameter is provided, then this computer will use Microsoft Update to check for updates.
; Specifies that SQL Server Setup should not display the paid edition notice when ran from the command line.
; Specify the location where SQL Server Setup will obtain product updates. The valid values are “MU” to search Microsoft Update, a valid folder path, a relative path such as .\MyUpdates or a UNC share. By default SQL Server Setup will search Microsoft Update or a Windows Update service through the Window Server Update Services.
; Specifies features to install, uninstall, or upgrade. The list of top-level features include SQL, AS, IS, MDS, and Tools. The SQL feature will install the Database Engine, Replication, Full-Text, and Data Quality Services (DQS) server. The Tools feature will install shared components.
; Displays the command line parameters usage.
; Specifies that the detailed Setup log should be piped to the console.
; Specifies that Setup should install into WOW64. This command line argument is not supported on an IA64 or a 32-bit system.
; Specify a default or named instance. MSSQLSERVER is the default instance for non-Express editions and SQLExpress for Express editions. This parameter is required when installing the SQL Server Database Engine (SQL), or Analysis Services (AS).
; Specify the root installation directory for shared components. This directory remains unchanged after shared components are already installed.
INSTALLSHAREDDIR=”F:\Program Files\Microsoft SQL Server”
; Specify the root installation directory for the WOW64 shared components. This directory remains unchanged after WOW64 shared components are already installed.
INSTALLSHAREDWOWDIR=”F:\Program Files (x86)\Microsoft SQL Server”
; Specify the Instance ID for the SQL Server features you have specified. SQL Server directory structure, registry structure, and service names will incorporate the instance ID of the SQL Server instance.
; Account for SQL Server CEIP service: Domain\User or system account.
; Startup type for the SQL Server CEIP service.
; Specify the installation directory.
INSTANCEDIR=”S:\Program Files\Microsoft SQL Server”
; Agent account name
; Auto-start service after installation.
; CM brick TCP communication port
; How matrix will use private networks
; How inter brick communication will be protected
; TCP port used by the CM brick
; Startup type for the SQL Server service.
; Level to enable FILESTREAM feature at (0, 1, 2 or 3).
; The max degree of parallelism (MAXDOP) server configuration option.
; Set to “1” to enable RANU for SQL Server Express.
; Specifies a Windows collation or an SQL collation to use for the Database Engine.
; Account for SQL Server service: Domain\User or system account.
; Set to “True” to enable instant file initialization for SQL Server service. If enabled, Setup will grant Perform Volume Maintenance Task privilege to the Database Engine Service SID. This may lead to information disclosure as it could allow deleted content to be accessed by an unauthorized principal.
; Windows account(s) to provision as SQL Server system administrators.
; The default is Windows Authentication. Use “SQL” for Mixed Mode Authentication.
; The number of Database Engine TempDB files.
; Specifies the initial size of a Database Engine TempDB data file in MB.
; Specifies the automatic growth increment of each Database Engine TempDB data file in MB.
; Specifies the initial size of the Database Engine TempDB log file in MB.
; Specifies the automatic growth increment of the Database Engine TempDB log file in MB.
; The Database Engine root data directory.
; Default directory for the Database Engine backup files.
; Default directory for the Database Engine user databases.
; Default directory for the Database Engine user database logs.
; Directories for Database Engine TempDB files.
; Directory for the Database Engine TempDB log files.
; Provision current user as a Database Engine system administrator for SQL Server 2019 Express.
; Specify 0 to disable or 1 to enable the TCP/IP protocol.
; Specify 0 to disable or 1 to enable the Named Pipes protocol.
; Startup type for Browser Service.
; Use SQLMAXMEMORY to minimize the risk of the OS experiencing detrimental memory pressure.
; Use SQLMINMEMORY to reserve a minimum amount of memory available to the SQL Server Memory Manager.
I have a Configuration File, now what?
There are two ways that this file can be leveraged. While on the setup screen click on ‘Advanced’ then select ‘Install based on configuration file’. Provide the path to the configuration file and you are good to start the installation process.
Another method to complete a SQL Server install is to use the command prompt coupled with the configuration file. To do this, open a command prompt window and navigate to the installation folder for SQL Server. As passwords are not stored in the configuration file you will need to be able to provide those as part of the command prompt options.
In this instance I would change directory to my ‘I$’ as I am using a Development iso for installation purposes and it is a temporarily mounted DVD drive. The specific passwords have been modified, so the command line in the command prompt window would be:
I:> Setup.exe /SQLSVCPASSWORD=”SVCAccountPassword” /SAPWD=”SysAdmPassword” /ConfigurationFile=S:\NewSQLServer3\ConfigurationFile.ini
If you want to perform and unattended installation you will need to include /Q or /QS along with /IACCEPTSQLSERVERLICENSETERMS options. /Q is known as Quiet Mode and does not a user interface and /QS is QuietSimple Mode and shows the UI but does not require any input. These options can also be set in the Configuration File but keep in mind that you can override the Configuration File’s options by providing the options in the command line as the command line will override the Configuration File parameters.
It is also worth mentioning that this installation process can be used for far more than just a basic engine installation, this process can be used to add a node to a fail-over cluster, install Analysis Services and Integration Services.
Why Configuration Files are very useful?
For that, let us go back to what we are trying to accomplish. We have a several new machines, be it new bare metal boxes or a new single large physical host with new virtual machines carved out on it. Either way, we have a number of new SQL Servers to build. Given that they probably all have different configurations necessary due to different hardware allocations it can get a bit confusing as you switch from machine to machine to monitor the installation process. Mistakes are possible especially when installing several servers simultaneously. I would rather front-end load the planning before I start the installation process. By creating a ConfigurationFile.ini file for each server to be installed ensures that the configuration settings are correct on each server. It also allows me to perform simultaneous installations across multiple servers with installation of all of the configuration, file placements, accounts, etc. etc. being error free. Not sure about you, but anything that can simplify the installation process is always a good thing.