Installing and Configuring the Database
This section explains how to execute Powershell scripts to run the database installation for the Packages and Packets database.
Prerequisites
- Powershell 4.0
- SQL Server (2012)
Installing the Packages and Packets Database
The Deploy.ps1 (PowerShell) file installs the Packages and Packets
Database based on input parameters (see parameters below).
- To prepare for the database installation process, copy all contents from the
PackagesAndPackets\DBInstallerScriptsfolder to the Database Server. - Open Windows PowerShell console.
- Run the command prompt as an administrator.
- The default Powershell execution policy value is Restricted. To be
able to run PowerShell scripts, enter the following command at the
PowerShell command line to change the execution policy.
>Set-ExecutionPolicy RemoteSigned
- Change the directory to the folder where the
Deploy.ps1file is located. - Run
Deploy.ps1using following parameters:Parameter Description -Debug <boolean>This property controls whether or not debug information is provided during script processing.
true = displays debug information during script processing.
null/false = (default) debug information does not display during script processing.-WorkingDir “<value>”Optional. This is the directory location for where the powershell script is being run. This parameter is not needed if running the script from the directory where the install files are located. -DBServer “<value>”This property is the name of the SQL Server Name that will host the Packages and Packets Database. NOTE: Must include Instance name in the value if applicable. -Login “<value>”Property to define the SQL user that the script will use to connect to SQL Server when installing the Packages and Packets DB.
If using Windows Authentication, this parameter should not be included.-Password “<value>”Property to define the password for SQL user that the script will use to connect to SQL Server when installing the Packages and Packets DB.
If using Windows Authentication, this parameter should not be included.-DBDrop <Boolean>Property to indicate whether to drop the database prior to installing the new database.
true-will drop the database
null/false – (default) will not drop the databaseNote: This property should be used ONLY within test environments.-DBName “<value>”Property that defines the name of the database.
Note: This value needs to also be specified in the Transform file for the application installation.-AppUsers “<value>”This property is the SQL Login Username used by the application to access the database.
If running as a Network Service, this will be the machine account for the server hosting Packages and Packets Application and multiple machine accounts can be specified.
Syntax for Single Domain/User:
-
AppUsers "DOMAIN\DGS-CI-SRVC"Syntax for Multiple Machine Accounts (each Machine Account must be separated using the Pipe ( | ) delimiter):
-AppUsers "DOMAIN\MACHINENAME1$|DOMAIN\MACHINENAME2$"-Userpassword “<value>”This property is the SQL Login Username’s password used by the application to access the database.
If running as a Network Service, this parameter should not be included.-MigrationFilter “<value>”This property is for future database upgrades if a specific SQL script is required to be executed. This SQL script is provided with the installation files. Navigate to the DBInstallerScripts/Migrations/ folder to obtain and name of the .sql script and set this value to filename.
Example Powershell Command Syntax
Using Windows Authentication and Application User Specified:
.\Deploy.ps1 -Debug true -WorkingDir "C:\SomeFolder\" -DBServer "SQLServerName"
-DBName "PackagesAndPacketsDb" -AppUsers "DOMAIN\DGS-CI-SRVC"
Using SQL Account For Script Access and Application is Running as a Network Service:
.\Deploy.ps1 -Debug true -WorkingDir "C:\SomeFolder\" -DBServer "SQLServerName"
-Login "sa" -Password "saUserPassword" -DBName "PackagesAndPacketsDb"
-AppUsers "SomeMachineName"