# Creating Databases with Database Installation Wizard and Running PowerShell script

This tool allows you to specify database names for the servers used in the installation process. The wizard aggragates the server names for use in the resulting `CreateDatabase.ps1` script file.

The Database Installation Wizard creates databases and any necessary scripts for the following:

- Administration tool
- CoreServices
- Doc Gen Services (Document Generation Services - DGS)
- STS

Note: Required fields appear in red if left blank.

1. To launch the Database Installation Wizard, double-click `DBInstallWizard.exe`.
2. Enter the Database Host. This is the database server name.
3. Enter the App DB Name. While you may change this value, it is recommended that you use the default values.
4. Enter the Auth DB Name. While you may change this value, it is recommended that you use the default values.
5. Select any of the following applications that will exist in the installation environment:
   - Admin; enter the database host name for the Administration tool in the corresponding field. Click the Load Balanced checkbox to enter the node name(s).
   - CoreServices; enter the database host name for CoreServices in the corresponding field. Click the Load Balanced checkbox to enter the node name(s).
   - Doc Gen Services; enter the main load-balanced database host name. Click the Load Balanced checkbox to enter the node name(s).
   - STS; enter the database host name for STS in the corresponding field. Click the Load Balanced checkbox to enter the node name(s).
   Note: Consider the following:
   - While Admin, CoreServices, and STS might reside on the same server, the installation process allows you to install them on separate servers. The Wizard takes this into consideration and leaves each application as its own item.
   - If entering multiple server names in the Nodes field, separate using a comma.
   - If assigning rights, you will need to indicate which hosts are load-balanced and specify the load balanced nodes that require access to the database.
6. Click the Populate with development server data checkbox to populate the scripts with test data and add the -dev switch.
   Note: Consider the following when selecting this checkbox:
   - When generating the `CreateDatabase.ps1` script during an upgrade, it is recommended that you do not set this checkbox as you presumably have data prepopulated in your database. Selecting this checkbox would remove this data and require you to re-enter it.
7. Click the Assign machine rights to database server checkbox to grant access to SQL Server. Specify the Domain where the servers reside in the corresponding field.
8. Enter any Additional Servers. This value is a server name not included in the list below but still requires server access. This feature only appears if selecting the Assign machine rights to database server checkbox.
9. Click Generate Script to create the `CreateDatabase.ps1` script. This is the file to run from Powershell on the database server. Upon completion, the following confirmation message appears:
10. Run Powershell as an administrator. Within Powershell, run Set-ExecutionPolicy Unrestricted.
11. Locate and run the `CreateDatabase.ps1` script. Upon completion, the `CreateDatabase.ps1` will reside in `C:\Public\ReleaseMedia\DBInstaller\`.