You are viewing the documentation for a prerelease version.

Database installation

All stored objects and configurations on the server are stored in databases.

Available databases

PortalSystem

This database contains all objects and configurations of the system.

PortalAuditLogServer

This database contains all audit log items explicit for changes in the system and/or tracking of objects.

PortalDiagnosticLogServer

This database contains all diagnostic log items of the server. The diagnostic logs are all the calls against the API of the system.

PortalDiagnosticLogClient

This database contains diagnostic log items of the client. Its possible to use the Net iD Client to store diagnostic logs using ODBC against this database.

Database collation

Note that all databases must have the collation:

  • SQL_Latin1_General_CP1_CI_AS.

Install the databases

The databases can be installed in several ways using the UtilityTool, defined in the /UtilityTool/ directory.

Install databases using either:

Install by using predefined connection

The connection string against the databases can be predefined in the configuration file Pointsharp.NiS.UtilityTool.exe.config. This means that the static configuration will be used every time the databases are installed or upgraded.

Example 1. Static connection string definition in configuration file
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <connectionStrings>
    <add name="Portal_System" connectionString="Data Source=localhost\MSSQLSERVER2017;Initial Catalog=NiSDB;Integrated Security=SSPI;MultipleActiveResultSets=True;" />
    <add name="Portal_Audit_Log_Server" connectionString="Data Source=localhost\MSSQLSERVER2017;Initial Catalog=NiSDB_log;Integrated Security=SSPI;MultipleActiveResultSets=True;" />
    <add name="Portal_Diagnostic_Log_Server" connectionString="Data Source=localhost\MSSQLSERVER2017;Initial Catalog=NiSDB_diag;Integrated Security=SSPI;MultipleActiveResultSets=True;" />
    <add name="Portal_Diagnostic_Log_Client" connectionString="Data Source=localhost\MSSQLSERVER2017;Initial Catalog=NiSDB_logClient;Integrated Security=SSPI;MultipleActiveResultSets=True;" />
  </connectionStrings>
</configuration>

Install by using the console

If no predefined configuration is available, the databases can be installed using the console.

  1. Run Pointsharp.NiS.UtilityTool.exe.

  2. Select Server Manager, and then select Install/Upgrade Net iD Portal database.

Set the information of the database manually. See the explanation of the database arguments for more information.

Install by using command arguments

If no predefined configuration is available, the databases can be installed using the UtilityTool with command arguments using the command line in Windows.

Pointsharp.NiS.UtilityTool.exe -installdatabase <database-arguments> (1)
1 See the explanation of the database arguments below.

Using command argument installs the databases in silent mode and only returns Success or an exception from the database instance if it fails. Using command argument will build a connection string stored in the configuration file using a predefined configuration next time this operation is processed. See information about predefined configuration above.

Example 2. Using a command line using the current user
pointsharp.nis.utilitytool.exe -installdatabase server=localhost\mssqlserver2017 port=1433 databasename=NiSDB createnew=true
Example 3. Using a command line impersonating another user
pointsharp.nis.utilitytool.exe -installdatabase server=localhost\mssqlserver2017 port=1433 databasename=NiSDB username=sqlAccount@contoso.com userpassword=%PWD% createnew=true

Database arguments

Server

The server instance of the SQL Server.

Port

The port of the server instance (default: 1433).

DatabaseName

The name of the NiS database.

UserName

The principal name of the interactive account that will be used for setup against the SQL Server. This account must be a Windows authenticated user. If the arguments UserName and UserPassword are not specified, the current interactive user account is used.

UserPassword

The password of the Windows account if specified above.

CreateNew

Condition if the the database should be created if not available as true/false.

Silent

Condition if the installation of the database should be in silent-mode. This can be used for other kind of installation packages and will only return Success or database exception errors in the console. This is set to false if not specified.

After installation or upgrade

Set connection strings to services

When the installation or upgrade is done, the UtilityTool has the possiblity to copy the database connection string to the rest of the services that requires a database connection.

  1. Open the UtilityTool directory.

  2. Run the UtilityTool, and then select ServerManager.

  3. Select Set connection strings.

Alternatively, use the Windows command prompt:

$ Pointsharp.NiS.UtilityTool.exe -setconnectionstrings

The UtilityTool will now copy the database connection strings from the UtilityTool configuration file to the rest of the services that requires a database connection (OrderServiceAPI, PortalAPI, ReceiverService and TimerService).

Troubleshooting

When upgrading the database from the previous generation of the portal, the current tokens need to be fully supported by Pointsharp. If not, the following error message is shown:

Some token keys has failed to be migrated. Please check that the token profile is correct and try again.

This happens when a token has a relation to a token profile that has unspecified specifications. Please see the list of supported tokens in the chapter above. If this happens, a local trace file is created within the UtilityTool directory named _TraceDump_TokenKeys.txt containing the identifier(s) of the token profile that could not match the key of current token.

Solution 1

Remove the unsupported tokens from the database and upgrade the database again.

Solution 2

Contact Pointsharp to implement support for the current token.