Installing and Configuring the Database

This section explains how to execute Powershell scripts to run the database installation for the Default Data database.

Prerequisites

Before beginning the installation process, the server executing these scripts must have the following:
  • Powershell 4.0
  • SQL Server (2012)

Installing the Default Data Database

The Deploy.ps1 (PowerShell) file installs the Default Data Database based on input parameters (see parameters below).

  1. To prepare for the database installation process, copy all contents from the DefaultData\DBInstallerScripts folder to the Database Server.
  2. 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
  3. Change the directory to the folder where the Deploy.ps1 file is located.
  4. Run Deploy.ps1 using 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 Default Data 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 Default Data 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 Default Data 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 database
    Note: 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 Default Data 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 "DefaultDataDb" -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 "DefaultDataDb"
          -AppUsers "SomeMachineName"