Skip to main content

Windows Installation

This page installs Analytics Data Processing and Analytics API as Windows services. It applies to Analytics Data Processing v2.6.0 and later, and Analytics API v1.4.13 and later. Older versions have their own guides, see Older versions.

Read Installation first: it lists what you need, and how settings, the first run and upgrades work.

In the steps below, replace x.y.z with the version you install.

1. Prerequisites​

  • Install Microsoft ODBC Driver 18 for SQL Server. If the installation fails, install Microsoft Visual C++ Redistributable first.
  • Download NSSM, and add the folder with nssm.exe to the system PATH. NSSM runs the services.
  • Get the package for each service from support. Each package contains the service .exe file and a wheels folder with the Python packages it installs. No internet access is needed.

The two services are installed the same way, but they do not behave the same in every detail. Check this table before you install, and see Differences between the services for what it means for you.

Analytics Data ProcessingAnalytics API
Service fileanalytics_dp_service.exeanalytics_api_service.exe
Folder variableBLIKSUND_ANALYTICS_DP_INITIAL_PATHBLIKSUND_ANALYTICS_API_INITIAL_PATH
Install folder variablePYAPP_INSTALL_DIR_BLIKSUND-DATA-PROCESSING-EWAPYAPP_INSTALL_DIR_BLIKSUND-ANALYTICS-API-EWA
Windows service nameBliksundAnalyticsDPBliksund Analytics API Service
Where .env is read fromThe folder in the folder variableThe install folder, or one of its parent folders. Not the folder in the folder variable.
Where the service log is writtenlogs in the folder in the folder variable, or LOG__PATHlogs inside the install folder, or LOG__PATH if it is an absolute path
Where the install and NSSM logs are writtenlogs in the folder in the folder variablelogs in the folder in the folder variable
Restarts by itself if it stopsNoYes
Starts when the server restartsNoNo
PortN/AAlways 127.0.0.1:9090

2. Install a service​

Install Analytics Data Processing first, then Analytics API. The steps are the same for both, with the names from the table above.

  1. If an earlier version is running, stop it, see Stopping a service.

  2. Unpack the package to a new folder for this version, for example C:\ProgramData\BliksundAnalyticsDP\x.y.z. Keep wheels next to the .exe file.

  3. Set the system environment variable for the folder (BLIKSUND_ANALYTICS_..._INITIAL_PATH) to that folder. The install command and NSSM write their logs to logs in it. Analytics Data Processing also reads its .env file from it and writes its own log there.

  4. Set the system environment variable for the install folder (PYAPP_INSTALL_DIR_...) to the folder where the service installs Python and its packages, for example C:\ProgramData\BliksundAnalyticsDP\installation\x.y.z. Use a new folder for each version: the last folder in the path must not exist yet.

  5. Create the .env file. Use the same settings as .env.data_processing and .env.api in the Docker installation, and see the configuration reference for your version. When you upgrade, copy the .env file from the previous version.

    • Analytics Data Processing: in the folder from step 2.
    • Analytics API: in the install folder from step 4, after step 6 has created it. Also set LOG__PATH to an absolute path, for example C:\ProgramData\BliksundAnalyticsAPI\x.y.z\logs, so the service log is not written inside the install folder.
  6. Open PowerShell as administrator, go to the folder, and install the service. This can take a few minutes:

    cd C:\ProgramData\BliksundAnalyticsDP\x.y.z
    .\analytics_dp_service.exe install

    The log shows the version when the service starts. If it shows another version, delete the install folder from step 4 and run the install command again.

  7. Start the service:

    .\analytics_dp_service.exe start

Keep the .env files private: they contain passwords and the API key.

Create the .env file before you start the service. The service reads it only when it starts.

3. First run​

See First run. Look for Transformer completed! in the Analytics Data Processing service log, see Logging.

4. Upgrade​

See Upgrading for the steps. To install a new version on Windows, repeat Install a service in a new folder. The install command replaces the Windows service of the previous version.

To go back to the previous version, stop the service, and run the install and start commands from the previous version's folder.

Running the services​

Neither service starts by itself when the server starts. Start both again after a server restart.

If Analytics Data Processing stops, for example after an error, it stays stopped until you start it. Analytics API is started again by NSSM.

Restarting a service​

In PowerShell as administrator, from the folder with the .exe file:

.\analytics_dp_service.exe stop
.\analytics_dp_service.exe start

Stopping a service​

In PowerShell as administrator, from the folder with the .exe file of the running version:

.\analytics_dp_service.exe stop

To remove the service completely, run .\analytics_dp_service.exe remove after stopping it.

Logging​

Each service writes several log files. See the table at the top for where they are.

  • service.log, or the name in LOG__FILE__FILENAME: the log of the service, rotated as set in LOG__FILE__MAX_SIZE and LOG__FILE__MAX_FILES.
  • analytics_dp_service.out.log and analytics_dp_service.err.log, or analytics_api_service.out.log and analytics_api_service.err.log: console output captured by NSSM. Set LOG__CONSOLE__ENABLED=false if you do not want the service log repeated there.
  • analytics_api_service.log (Analytics API only): the log of the install, start and stop commands.

For Analytics Data Processing, a relative LOG__PATH is relative to the folder in the folder variable. For Analytics API, it is relative to a folder inside the install folder, so use an absolute path.

Differences between the services​

The Windows packages of the two services are built the same way, but have grown apart. Note the following:

  • .env location. Analytics Data Processing reads .env from the folder in BLIKSUND_ANALYTICS_DP_INITIAL_PATH. Analytics API v1.4.13 does not read .env from BLIKSUND_ANALYTICS_API_INITIAL_PATH, as v1.1.0 did, but searches the install folder and its parent folders. If you upgrade from v1.1.0, move the .env file. If Analytics API cannot connect to the database after an upgrade, check this first.
  • Service log. Analytics API writes its service log inside the install folder unless LOG__PATH is an absolute path.
  • Restart. NSSM restarts Analytics API if it stops, but not Analytics Data Processing.
  • Port. Analytics API always listens on 127.0.0.1:9090 as a Windows service, so it is only reachable from the server itself. APP__PORT has no effect. Put a reverse proxy with HTTPS in front of it, see the FAQ.
  • Service names. The Windows service names follow different patterns: BliksundAnalyticsDP and Bliksund Analytics API Service. Use these names in the Windows Services console and with nssm.

With Docker, both services behave the same way, see Docker Installation.

Older versions​

These versions are only available as Windows services, and each has its own installation guide: