Deployment and Management Guide for Cisco IoT FND on OVA with Postgres and InfluxDB, Release 5.x.x and Later

PDF

Database and Cisco IoT FND Migration

Updated: February 4, 2026

Overview

This topic contains all the migration related information to achieve HA and DR on Cisco IoT FND with Postgres.


Migrate Influx DB to Postgres

This document provides a step-by-step guide for migrating time-series data (events and metrics) from InfluxDB to Postgres within the Cisco IoT FND environment. The current version of the FND is 5.1.0-155 is used for the Influx DB to Postgres migration.

Historically, Cisco IoT FND used Influx DB as a specialized time-series database to handle high volumes of events and performance metrics. Starting Cisco IoT FND Release 5.1.1, Cisco IoT FND consolidates this data into PostgreSQL to simplify the database architecture and management.

Before you begin

  • Ensure the following CPU and Memory configuration for Cisco IoT FND. Here's an example configuration for Cisco IoT FND running 50,000 routers:

    Configuration

    Value

    CPU Cores

    24

    Sockets

    6

    Core per Socket

    4

    IOMMU

    Disabled

    Memory

    96 GB

  • In the Data Retention page, configure the following values:

    Based on the image provided, here are the Data Retention settings in a tabular format:

    Field Value (days)
    Keep Event data for 7
    Keep Firmware Operation data for 7
    Keep Historical Dashboard data for 7
    Keep Dashboard data for 7
    Keep Closed Issues data for 7
    Keep JobEngine data for 7
    Keep Historical Metrics Statistics for 30
    Keep Device Network Statistics for 7
    Keep Open Issues data for 7
    Keep Service Provider down routers data for 7
  • Disable the data retention in Influx DB using the influxdb.conf script. Here's an example:

    $ vim /etc/influxdb/influxdb.conf
    
    [retention]
      # Determines whether retention policy enforcement enabled.
      enabled = false
    
    $ Restart the influxdb service - systemctl restart influxdb.service 
  • Run du -sh /var/lib/influxdb/data/fnd/ to confirm the total volume of InfluxDB data (e.g., 25GB) that will be moved to the PostgresDB.

  • The Influx DB to Postgres migration process filters events based on current device inventory. Events linked to deleted or decommissioned devices are excluded from the migration scope. For further technical details, refer to CSCwp87487.

  • The following table outlines the specific measurements being migrated from the InfluxDB time-series database to the PostgreSQL relational database:

    InfluxDB Table (Source) PostgresDB Table (Destination)
    events events
    historicalnameddata historical_named_data
    historicalnameddata_da historical_named_data_da
    historicalnameddata_1_hr historical_named_data_hr
    metricshistory metrics_history
    mhistory_1_hr metrics_history_hr

    The migration process is resource-intensive. It is mandatory to monitor system performance from the start of the migration until completion. If you encounter timeout or memory exhaustion issues, you must adjust the thread parameters in the influx2postgres.properties file.

Use these instructions to modify the influx2postgres.properties file:

Procedure

1.

Stop the Cisco IoT FND CGMS service or the Cisco IoT FND container:

Example:

[root@iot-fnd ~]# docker exec -it fnd-container /etc/init.d/cgms status
IoT-FND Version 5.1.0-154
02-04-2026 05:08:58 EST: INFO: IoT-FND database server: 192.68.5.1:5432
02-04-2026 05:08:59 EST: INFO: IoT-FND database connection verified.
02-04-2026 05:08:59 EST: INFO: IoT FND timeseries database server: 192.68.5.1
02-04-2026 05:08:59 EST: INFO: IoT FND kapacitor server: 192.68.5.1
02-04-2026 05:09:00 EST: INFO: IoT-FND timeseries database/kapacitor connection verified.
02-04-2026 05:09:02 EST: INFO: IoT-FND application server is up and running.
02-04-2026 05:09:05 EST: INFO: IoT-FND is up and running.
2.

Disable the Kapacitor tasks or stop the Kapacitor service:

Example:


[root@iot-fnd ~]# vim /etc/kapacitor/kapacitor.conf
[http]
bind-address = ":9092"  

[root@iot-fnd ~]# systemctl restart kapacitor.service 
[root@iot-fnd ~]# kapacitor list tasks
ID                       Type      Status    Executing Databases and Retention Policies
epmhistory_plc_cnt_1_da  batch     disabled  false     ["fnd"."epmhistoryrp"]
epmhistory_plc_cnt_1_hr  batch     disabled  false     ["fnd"."epmhistoryrp"]
epmhistory_rf_cnt_1_da   batch     disabled  false     ["fnd"."epmhistoryrp"]
epmhistory_rf_cnt_1_hr   batch     disabled  false     ["fnd"."epmhistoryrp"]
evallfiltercnt           batch     enabled   true      ["fnd"."eventsrp"]
evissuefiltercnt         batch     enabled   true      ["fnd"."eventsrp"]
evtypecnt                batch     enabled   true      ["fnd"."eventsrp"]
historicalnameddata_1_hr batch     enabled   true      ["fnd"."histdatarp"]
historicalnameddata_da   batch     enabled   true      ["fnd"."histdatarp"]
mhistory_1_hr            batch     enabled   true      ["fnd"."mhistoryrp"]
mhistory_da              batch     disabled  false     ["fnd"."mhistoryrp"]
[root@iot-fnd ~]# 
[root@iot-fnd ~]# kapacitor disable <tasks_ID>
[root@iot-fnd ~]# systemctl restart kapacitor.service

OR

[root@iot-fnd ~]# systemctl status kapacitor.service 
● kapacitor.service - Time series data processing engine.
   Loaded: loaded (/usr/lib/systemd/system/kapacitor.service; enabled; vendor preset: disabled)
   Active: active (running) since Fri 2025-06-20 15:27:18 CEST; 14h ago
     Docs: https://github.com/influxdb/kapacitor
 Main PID: 1397 (kapacitord)
    Tasks: 43 (limit: 614881)
   Memory: 2.0G
   CGroup: /system.slice/kapacitor.service
           └─1397 /usr/bin/kapacitord -config /etc/kapacitor/kapacitor.conf -pidfile=/etc/kapacitor/kapacitord.pid
[root@iot-fnd ~]# systemctl mask kapacitor.service 
Created symlink /etc/systemd/system/kapacitor.service → /dev/null.

[root@iot-fnd ~]# systemctl stop kapacitor.service 

[root@iot-fnd ~]# systemctl status kapacitor.service 
● kapacitor.service
   Loaded: masked (Reason: Unit kapacitor.service is masked.)
   Active: inactive (dead) since Sat 2025-06-21 05:39:07 CEST; 3s ago
 Main PID: 408336 (code=exited, status=0/SUCCESS)
[root@iot-fnd ~]#
3.

Install or upgrade the cgms-5.1.1-16x86_64.rpm on Cisco IoT FND.

Example:

[root@iot-fnd ~]# rpm -qa | grep cgms-tools
[root@iot-fnd ~]# rpm -ivh cgms-tools-5.1.1-16.x86_64.rpm --force
Verifying...                          ################################# [100%]
Preparing...                          ################################# [100%]
Updating / installing...
   1:cgms-tools-5.1.1-16              ################################# [100%]
[root@iot-fnd ~]# rpm -qa | grep cgms-tools
cgms-tools-5.1.1-16.x86_64
[root@iot-fnd ~]#
4.

Navigate to the /opt/cgms-tools/conf path and modify the influx2postgres.properties file:

Example:

[root@iot-fnd ~ conf]# cat influx2postgres.properties
# InfluxDB connection
influx-host=192.68.5.1
influx-port=8086
influx-database=fnd
influx-username=<user-name>
influx-password=<password>
influx-connect-timeout=60
influx-read-timeout=120

# PostgreSQL connection
postgres-host=192.68.5.1
postgres-port=5432
postgres-database=cgms
postgres-username=<user-name>
postgres-password=<password>

# Migration options
parallelize-measurements=true

# should be multiple of 4
fields_per_batch=12

logging-interval=10
read-chunk-size=25000
write-chunk-size=20000
read-min-threads=10
read-max-threads=20
read-queue-size=100
# Adjust write threads based on the server capacity
write-min-threads=16
write-max-threads=32
write-queue-size=100
await-termination-time=30
measurements=events,historicalnameddata,historicalnameddata_1_hr,historicalnameddata_da,metricshistory,mhistory_1_hr
[root@iot-fnd ~ conf]#
5.

Restart the Influx DB service. If any service is consuming the memory, restarting frees up the memory.

Example:

[root@iot-fnd ~]#systemctl restart influxdb.service

Verify the free memory

[root@iot-fnd ~]# free -m
6.

Navigate to the script path and execute the influx2postgres.sh script on OVA.

Example:

[root@iot-fnd ~]# cd /opt/cgms-tools/bin
[root@<ip-address> bin]#./influx2postgres.sh

Note: During the migration, CPU slowly increase to 90% to 100% and immediately come down to 90% to 70% and vice versa.
Memory also will slowly increas to 85% to it remains to 85% till it completed.

You've successfully migrated time-series data from InfluxDB to Postgres.

What to do next

Example log is provided in the Example Influx DB to Postgres migration log topic.

Verify the data in the Postgres DB

Procedure

1.

(Optional) Verify the data in the Postgres DB using a standalone Cisco IoT FND using these steps:

  1. Install the RHEL 8.10 OS. The standalone VMs can RHEL 8.10 and later OS.

  2. Install the Cisco IoT FND RPM cgms-5.1.0-154.pg.x86_64.rpm

    Example:

    [root@iot-fnd home]# rpm -ivh cgms-5.1.0-154.pg.x86_64.rpm --force
    Verifying...                          ################################# [100%]
    Preparing...                          ################################# [100%]
    Updating / installing...
       1:cgms-5.1.0-74              ################################# [100%]
    [root@<ip-address> home]# rpm -qa | grep cgms-tools
    cgms-5.1.0-74.pg.x86_64.rpm
    [root@<ip-address> home]#
  3. Copy the Cisco IoT FND certificates to the standalone Cisco IoT FND:

    Example:

    [root@iot-fnd ~]# cd /opt/cgms/server/cgms/conf/
    [root@<ip-address> conf]# ll
    cgms.properties 
    cgms_keystore
  4. Execute the setupCgms.sh script. When prompted, configure the PostgreSQL database to point to the existing FND server and set the time-series database option to No.

    Example:

    [root@iot-fnd ~]# cd /opt/cgms/bin/
    [root@iot-fnd ~]# ./setupCgms.sh
    06-20-2025 14:32:05 EDT: INFO: ========== IoT-FND Setup Started - 2025-06-20-14-32-05 ==========
    06-20-2025 14:32:05 EDT: INFO: Log file: /opt/cgms/bin/../server/cgms/log/cgms_setup.log
    
    Are you sure you want to setup IoT-FND (y/n)? y
    
    06-20-2025 14:32:50 EDT: INFO: User response: y
    
    Do you want to change the database settings (y/n)? y
    
    06-20-2025 14:32:52 EDT: INFO: User response: y
    
    Do you want to configure Postgres with High Availability (y/n)? n
    
    06-20-2025 14:32:54 EDT: INFO: User response: n
    
    Do you want to use custom database connection string (y/n)? n
    
    06-20-2025 14:32:57 EDT: INFO: User response: n
    
    Enter database server hostname or IP [<ip-address>]: <remote-ip-address>
    06-20-2025 14:33:01 EDT: INFO: Database server: <remote-ip-address>
    
    Enter database server port [5432]: 
    06-20-2025 14:33:03 EDT: INFO: Database server port: 5432
    
    Enter database SID [cgms]: 
    06-20-2025 14:33:04 EDT: INFO: Database SID: cgms
    
    Do you wish to configure another database server for this IoT-FND (y/n)? n
    
    06-20-2025 14:33:06 EDT: INFO: User response: n
    06-20-2025 14:33:06 EDT: INFO: Configuring database settings. This may take a while. Please wait ...
    06-20-2025 14:33:07 EDT: INFO: Database settings configured.
    
    Do you want to change the database password (y/n)? n
    
    06-20-2025 14:33:08 EDT: INFO: User response: n
    
    Do you want to change the keystore password (y/n)? n
    
    06-20-2025 14:33:09 EDT: INFO: User response: n
    
    Do you want to change the web application 'root' user password (y/n)? n
    
    06-20-2025 14:33:09 EDT: INFO: User response: n
    
    Do you want to change IPAM and PSK Settings (y/n)? n
    
    06-20-2025 14:33:10 EDT: INFO: User response: n
    
    Do you want to change the FTP settings (y/n)? n
    
    06-20-2025 14:33:11 EDT: INFO: User response: n
    
    Do you want to change router CGDM protocol settings (y/n)? n
    
    06-20-2025 14:33:12 EDT: INFO: User response: n
    
    Do you want to change router management mode [Demo, Bandwidth Optimized, Default] (y/n)? n
    
    06-20-2025 14:33:13 EDT: INFO: User response: n
    
    Do you want to configure timeseries database (y/n)? n
    
    06-20-2025 14:33:13 EDT: INFO: User response: n
    06-20-2025 14:33:13 EDT: INFO: Configuring timeseries flag  none in system properties. This may take a while. Please wait...
    06-20-2025 14:33:13 EDT: INFO: timeseries flag none
    
    Do you want to change log file settings? (y/n)? n
    
    06-20-2025 14:33:14 EDT: INFO: User response: n
    06-20-2025 14:33:14 EDT: INFO: ========== IoT-FND Setup Completed Successfully ==========
    [root@iot-fnd ~]#
2.

Perform the database migration using db-migrate:

Example:

[root@scale-pg-fnd ~]# /opt/cgms/bin/db-migrate
Enter database password: <cgms123>
3.

Start the cgms service:

Example:

[root@iot-fnd ~]# service cgms start
4.

Log in to Cisco IoT FND and verify the events, dashboard charts, and graphs.

You've successfully verified the data in the Postgres DB after the Influx DB to Postgres migration.


Migrate data from standalone to EDB Postgres

This procedure configures the Cisco IoT FND to connect to an external EDB Postgres database and executes a migration script to transfer the necessary data to the new environment. It subsequently ensures data integrity and operational readiness by performing a complete backup and restore sequence on the database server.

Procedure

1.

Configuration and Migration on DC2 FND:

  1. Navigate to the binary directory and execute the setup script to configure the database connection.

    Example:

    [root@dc2fnd opt]# cd /opt/cgms/bin/
    [root@dc2fnd bin]# ./setupCgms.sh
    
    #02-02-2026 20:05:03 IST: INFO: ========== IoT-FND Setup Started - 2026-02-02-20-05-03 ==========
    02-02-2026 20:05:03 IST: INFO: Log file: /opt/cgms/bin/../server/cgms/log/cgms_setup.log
    
    Are you sure you want to setup IoT-FND (y/n)? y
    
    02-02-2026 20:05:05 IST: INFO: User response: y
    
    Do you want to change the database settings (y/n)? y
    
    02-02-2026 20:05:07 IST: INFO: User response: y
    
    Do you want to configure Postgres with High Availability (y/n)? n
    
    02-02-2026 20:05:08 IST: INFO: User response: n
    
    Do you want to use custom database connection string (y/n)? n
    
    02-02-2026 20:05:12 IST: INFO: User response: n
    
    Enter database server hostname or IP : [<IP-address>]
    02-02-2026 20:05:24 IST: INFO: Database server: [<IP-address>]
    
    Enter database server port [420]: 5432
    02-02-2026 20:05:31 IST: INFO: Database server port: 5432
    
    Enter database SID [cgms]:
    02-02-2026 20:05:32 IST: INFO: Database SID: cgms
    
    Do you wish to configure another database server for this IoT-FND (y/n)? n
    
    02-02-2026 20:05:35 IST: INFO: User response: n
    02-02-2026 20:05:35 IST: INFO: Configuring database settings. This may take a while. Please wait ...
    02-02-2026 20:05:36 IST: INFO: Database settings configured.
    
    Do you want to change the database password (y/n)? n
    
    02-02-2026 20:05:39 IST: INFO: User response: n
    
    Do you want to change the keystore password (y/n)? n
    
    02-02-2026 20:05:41 IST: INFO: User response: n
    
    Do you want to change the web application 'root' user password (y/n)? n
    
    02-02-2026 20:05:42 IST: INFO: User response: n
    
    Do you want to change IPAM and PSK Settings (y/n)? n
    
    02-02-2026 20:05:43 IST: INFO: User response: n
    
    Do you want to change the FTP settings (y/n)? n
    
    02-02-2026 20:05:44 IST: INFO: User response: n
    
    Do you want to change router CGDM protocol settings (y/n)? n
    
    02-02-2026 20:05:45 IST: INFO: User response: n
    
    Do you want to change router management mode [Demo, Bandwidth Optimized, Default] (y/n)? n
    
    02-02-2026 20:05:45 IST: INFO: User response: n
    
    Do you want to configure timeseries database (y/n)? n
    
    02-02-2026 20:05:46 IST: INFO: User response: n
    02-02-2026 20:05:46 IST: INFO: Configuring timeseries flag  none in system properties. This may take a while. Please wait...
    02-02-2026 20:05:47 IST: INFO: timeseries flag none
    
    Do you want to change log file settings? (y/n)? n
    
    02-02-2026 20:05:47 IST: INFO: User response: n
    02-02-2026 20:05:47 IST: INFO: ========== IoT-FND Setup Completed Successfully ==========
  2. Execute the migration script to migrate the schema and data.

    Example:

    [root@dc2fnd bin]# ./db-migrate
    Enter database password:
    # Wait for "Migration completed" and "Post migration completed" messages.
2.

Run the backup script pointing to the specific database server IP.

Example:

[root@pgda1 ~]# cd /opt/cgms-postgres/scripts/
[root@pgda1 scripts]# ./backupdb.sh cgms cgms_dev /opt/5.1.1_backup_file <Database_Server_IP> 5432

# Enter password when prompted.
# Wait for "Backup completed successfully!"
3.

Restore the database.

Example:

[root@pgda1 scripts]# ./restoredb.sh cgms cgms_dev /opt/5.1.1_backup_file localhost 5432

# Enter password for user cgms_dev when prompted.
# Wait for "Restore completed successfully!" and "Firmware references cleaned successfully!"

Example:

Note

Restore the data in the EDB write leader.

You've migrated the data from standalone to EDB Postgres.