Skip to main content

Database

Host Provisioning Server uses SQL Server or SQL Server Express. It has been tested in versions 2022, 2019, 2017.

tip

No special space requirements are needed, database size should be small over time.

Credentials

At installation time a user to connect to the SQL Server is required with these permissions:

  • CREATE SCHEMA
  • CONNECT
  • UPDATE
  • INSERT
  • DELETE
info

Database user must be a SQL User, domain users are not currently supported.

Configuration to connect to database

When a SQL Server or Server Express is installed, some configuration in the database server needs to be checked so Host Provisioning Server is able to connect:

  • If not running in the same computer, check TCP/IP protocol is enabled. Open SQL Server Configuration Manager, enable the protocol if disabled. The SQL Server service must be restarted.

TCP/IP Protocol

  • By default, dynamic ports in the SQL Server instance are used, to be able to locate the database instance if running on a remote computer, you need to do one of these configurations:

    • Enable the SQL Server Browser Service and start it. You may still to set the dynamic port but not the instance: sqlserver,56583
    • Set the connection string with the dynamic or fixed port (if different than 1433), e.g. sqlserver,56583\SQLExpress.
    • Configure the instance to use a fixed port, usually 1433, by right clicking on the TCP/IP protocol and selecting Properties and IP Addresses. You can also locate the dynamic port that is currently being using in the same properties option.

    You will need to restart the SQL Server service to apply changes on the listening ports.

Fixed port

tip

To use a different port than 1433 or a dynamic port without enabling the SQL Browser Service, you need to set the port in the connection string, e.g. 192.168.1.20,56583\SQLExpress for port 56583.

Changing SQL Server after installation

If you move your database server after installing Host Provisioning Server, you need to edit the server's config.xml found on the server's installation root directory, e.g. C:\inetpub\wwwroot\HPSCore. Update host with the new sql server's hostname or IP address and instance if neeeded.

Restart IIS Application Pool to apply changes.

tip

A network related error will be recorded on the log if the Host Provisioning Server is unable to contact the SQL server unable to read server list from database.

Changing Database User password after installation

The installer encrypts the credentials and saves them in the server's config.xml to be read by the program when it starts. If you need to update the credentials a tool is provided to generate the encrypted password so you can update the file.

  • Launch HostProvisioningPasswordEncryptor.exe and type the new password.
  • Edit config.xml and paste the encrypted password in the password tag.
  • Restart IIS Application Pool to apply changes.
tip

You can find HostProvisioningPasswordEncryptor.exe at the utils directory of Host Provisioning installation folder, for example C:\inetpub\wwwroot\HPSCore\utils.

Encrypter Example

Backing up

You can use regular SQL Server backup tools. The size of the database will not specially grow over time, there is a Environment Variable that controls the computer's history data that is kept in the database PURGE_CLIENT_HISTORY_MAXAGE, by default is set in 365 days. You may need to reduce the days if your space is very limited, but usually this is not necessary.

tip

sqlcmd.exe or powershell can be used to backup a database. Check out Microsoft's documentation to learn how to use these commands.

Uninstallation

After uninstalling Host Provisioning Server, you would need to remove the HPS SQL instance manually.