SOT
    • Introduction
    • User manual
      • Basic operation
        • Create and delete a device as a favorite
        • Use the filter function
      • Process
        • Compare processes
        • Change axes in the diagram
        • Show and hide axis in the diagram
        • Show special values
        • Display measured values in the diagram
        • Display process data in the diagram
        • Displaying diagram content
        • Permanently highlight a process curve
        • Temporarily highlight a process curve
        • Monitoring processes
        • Configure columns
        • Export process data
    • Operations manual
      • Overview
      • System architecture and interfaces
      • System requirements
        • trinity/static-content
        • trinity/trinity-core-service
        • trinity/trinity-gateway-service
      • Migration from previous versions
        • Influx database migration
        • Deletion of an old CPM installation
      • Setup and configuration
        • AI add-on: Process Intelligence
        • Database configuration
        • Port configuration
        • HELM configuration
        • Application account roles provided
        • Relational database
        • General logging
        • General OpenTelemetry
        • trinity/static-content
        • trinity/trinity-core-service
        • trinity/trinity-gateway-service
      • Start and shutdown
      • Regular operations
      • Failure handling
        • Processes are not received
        • Module is not visible in the Web Portal
        • How to verify if the broker is out of sync
        • Devices are missing
      • Backup and restore
      • Logging and monitoring
        • Observability
        • Logging characteristics
        • Logging format
        • Logging level
        • Required monitoring
        • Request-based logging format
        • Security logging format
        • Lifecycle logging format
        • Health verification endpoints
      • Known limitations
    • API documentation
Process Quality
  • Smart Operations Toolkit
    • Deviation Processor
    • Multitenant Access Control
    • Notification Service
    • Ticket Management
    • Web Portal
  • Shopfloor Management
    • Andon Live
    • KPI Reporting
    • Operational Routines
    • Shift Book
    • Shopfloor Management Administration
  • Product & Quality
    • Process Quality
    • AI Services
  • Machine & Equipment
    • Condition Monitoring
    • Device Portal
  • Enterprise & Shopfloor Integration
    • Information Router
    • Master Data Management

SOT Learning Portal

  • Process Quality
  • Operations manual
  • Migration from previous versions
  • Influx database migration

Influx database migration

In the course of the split of the Condition Process Monitoring (CPM) module into Condition Monitoring (CM) and Process Quality (PQ) the existing CPM data in the Influx database needs to be migrated to a new Influx database for each respective module.

This explains the CPM to PQM data migration. For CPM to CM data migration, please check the CM migration docs.

To migrate the PQM Influx data use the following guides:

  1. Migrating processes

For more details on how to use the Influx data migration tool see Appendix: influx migration tool

Prerequisites

  1. Prepare the new Influx Databases

  2. Clarify with the business which data needs to be migrated

    • Should all data be migrated or just the data after a specific date?

    • Should the original data be deleted after the migration?

  3. Inspect the retention policies in the existing Influx DB and their disk sizes

    • What is a suitable chunk size for migrating the data so that we don’t run out of memory?

  4. Derive the fitting parameters for the migration tool (see below for details) and create a migration plan according to your previous findings

  5. Install Java JDK 21 on the machine on which you want to execute the migration tool

  6. Add the needed Certificates in the Java KeyStore (optional if 'disable-ssl' option is enabled).

  7. The JAR file can be found in artifactory (use the newest released version):

    • https://artifactory.boschdevcloud.com/artifactory/lab000003-bci-mvn-release-local/com/bosch/bci/trinity/influx-migration/

Make sure that there is a valid and stable connection between the Source, Target and the host where the Influx Migration Application is running.
The migration mainly depends on 3 variables: the data size per Influx Point that is to be migrated, the query-chunk-size and the quality of the HTTP connection between the Source, Target and host where the Influx Migration application is running. Therefor there is no golden value for setting the query-chunk-size; it all depends on how much data there is to migrate and how fast and reliable the HTTP connection is.
Please be advised that K9s’s port forwarding feature proved to be very unreliable during our tests. If you rely on this feature to do the migration, it is a high chance that you will encounter problems. However, there is a workaround by setting ok-http-logging-interceptor-level to BODY. This will result in lots of output information, so grep for errors to make sure the migration ran successfully. We advise to find a better solution and DO NOT rely on this workaround.

Migrating processes

Processes will have a very large data size per Influx point as they contain blob data. Here we need a small query-chunk-size, so the migration process will take longer.

If the migration is done within a trusted network, the --disable-ssl option can be used in order to trust the certificates of the Source and Target. This implies that there will be no need to add the self-signed certificates to the Java TrustStore.

During our test phase, we used the following query to migrate processes (it excludes rp_event, among others, to only migrate rp_processes):

java -jar influx-migration-<release_version>.jar \
--tenant-id=7311ea8c-5d48-43fe-acf9-980eedf24b6c \
--query-chunk-size=2500 \
--source-url=https://si0vmc3101.de.bosch.com:8086 \
--source-db=cpm \
--source-username=cpm \
--source-password=aklnnNBUIf-efekla \
--target-url=http://localhost:8086 \
--target-db=cpm \
--target-username=admin \
--target-password=admin_password \
--skip-continuous-queries=true \
--source-retention-exclusions=autogen,rp_msm_deferred,rp_msm_level1,rp_msm_level2,rp_msm_level3,rp_msm_raw,rp_ppmp_meta_data,rp_event

Appendix: influx migration tool

General notes

  1. This tool streams the Influx points into memory and then writes them to the target DB. So make sure that you have good internet connection between the source host, the host where you execute the tool and the target host.

  2. This tool does NOT create, delete, or modify rights to a specific database in any way

  3. As continuous queries do not belong to a retention policy, they will either all be copied or none (use --skip-continuous-queries)

  4. This tool does NOT delete any Continuous Queries whatsoever. The reason for this is that not all data is guaranteed to be moved to the new database, and then the Continuous Query might still be relevant to the remaining data in the original database.

  5. One of the stretch goals for this tool was to be able to continue the migration at a later stage (to continue where it was previously stopped). Although this was not specifically implemented, the tool will not duplicate any Data, Measurements, Retention Policies, Continuous Queries or anything else when it is run again with the same parameters.

  6. BE CAREFUL when choosing to add the --delete-source tag. The results are permanent and immediate. (It has been set to default=false to prevent this accidentally happening)

  7. ALWAYS check and double-check the results, especially Retention Policies and Continuous Queries that were created.

  8. The tool will output the number of points copied per chunk to give a sense of progress. You can use a count query to know how many points to expect before starting the migration tool

    • If the tool doesn’t output progress for some time (> 30s) and seems stuck, hit CTRL-C and decrease the chunk size
      with --query-chunk-size

  9. Migrate processes, see Migrating processes

  10. Figure out which retention policies you do not want to migrate and add then use --source-retention-exclusions to exclude them

  11. As PQM doesn’t use/need any continuous queries, they can always be excluded using --skip-continuous-queries

  12. If the tool crashes at some time, you can run it again - existing points will just be overridden. If you know what data is missing, you can tweak it with the --from-timestamp and --to-timestamp options.

  13. There might be some points that run out of retention when writing them into the database!

Using the migration tool

The provided migration tool can be run via the command line. Prerequisite: Java 21 installed.
The following parameters needs to be provided and should be specified before running the tool:

Source Database Configuration

Parameter Required Description Example

source-db

Name of the migration source database

cpm

source-url

URL to the migration source Influx DB instance

https://rngvmc0129.de.bosch.com:8086

source-username

Username to read data from source database. Recommendation: use user with admin rights.

admin

source-password

Password to the respective username to read data from source database

influx-db-admin-secret!

Target Database Configuration

Parameter Required Description Example

target-db

Name of the migration target database

pq

target-url

URL to the migration target Influx DB instance

https://rngvmc0129.de.bosch.com:8086

target-username

Username to write data to target database. Recommendation: use user with admin rights.

admin

target-password

Password to the respective username to write data to target database

influx-db-admin-secret!

Migration Related Parameters

Parameter Required Description Default Example

tenant-id

Id of the tenant whose data should be migrated

-

7311ea8c-5d48-43fe-acf9-980eedf24b6c

query-chunk-size

The number of data points to be migrated at the same time.

10000

10000

source-retention-exclusions

Comma-separated list of retention policies to be excluded from migration.If not set or empty, will migrate all retention policies

-

rp_process, rp_event

skip-continuous-queries

Whether the continuous queries shall be skipped

false

true

from-timestamp

Only data newer than this UTC ISO timestamp will be migrated

-

2022-11-30T11:09:35+01:00

to-timestamp

Only data up until this timestamp will be migrated

The UTC timestamp when the migration tool was started

2022-11-30T12:09:35+01:00

delete-source

Whether the Source data should be deleted or not

false

false

disable-ssl

Whether to disable the SSL certificate checks

false

true

ok-http-logging-interceptor-level

Sets the logging level of the OK HTTP Client. Accepted values: NONE, BASIC, HEADERS or BODY

NE

BODY

ok-http-read-timeout

OK HTTP Client read timeout in seconds

30

30

ok-http-write-timeout

OK HTTP Client write timeout in seconds

30

30

To get the help of all options:

java -jar influx-migration-<version>.jar --help

Example Run in Command Line:

java -jar influx-migration-0.0.1-SNAPSHOT.jar \
--source-url=https://rngvmc0129.de.bosch.com:8086 \
--source-db=cpm \
--source-username=admin \
--source-password=pool31-admin-influxdb-secret! \
--target-url=https://rngvmc0129.de.bosch.com:8086 \
--target-db=cpm_migration \
--target-username=admin \
--target-password=pool31-admin-influxdb-secret! \
--tenant-id=7311ea8c-5d48-43fe-acf9-980eedf24b6c \
--query-chunk-size=50 \
--source-retention-exclusions=rp_process,rp_msm_raw \
--from-timestamp=2022-11-30T11:09:35+01:00 \
--delete-source=false

With the above parameters, the tool will use the SSL protocol to establish the connections to both Source and Target and it will create all retention policies of the source database 'cpm' except 'rp_process' and 'rp_msm_raw' on the target database 'cpm_migration'. Next, it will copy all data newer than 11/30/2022 9:35:01 from all retention policies except 'rp_process' and 'rp_msm_raw' from database 'cpm' to database 'cpm_migration' in batches of 50 data points each. It will also create Continuous Queries on 'cpm_migration' that existed on 'cpm' and are related to any but the excluded retention policies, and will NOT delete the original source data

Contents

© Robert Bosch Manufacturing Solutions GmbH 2023-2026, all rights reserved

Changelog Corporate information Legal notice Data protection notice Third party licenses