All Apps and Add-ons

Trying to migrate from Splunk DB Connect 1 to DB Connect 2, why is the inputs.py migration script not working?

ejharts2015
Communicator

After following the migration process to migrate from DB Connect 1 to DB Connect 2 located here

  • splunk cmd python dbx_migrate_connections.py - worked
  • splunk cmd python dbx_migrate_lookups.py - worked
  • splunk cmd python dbx_migrate_inputs.py didn't work

Fails silently with no exceptions or outputs.

0 Karma
1 Solution

ejharts2015
Communicator

Answering my own question here, to save folks time and agony in finding a solution.

Our existing database names contain hyphens and underscores (ex. database-things_are-in-dev) which the migration script fails on, to fix edit the following line in

/opt/splunk/etc/apps/splunk_app_db_connect/bin/dbx2/migration/migrations/input/001_migrate_from_dbx1.py

Change this:

name_pattern = r'dbmon-(?P<type>\w+)://(?P<database>\w+)/(?P<unique_name>\w+)'

to this:

name_pattern = r'dbmon-(?P<type>\w+)://(?P<database>\S+)/(?P<unique_name>\S+)'

Rerun script.

Another note you'll need to manually check your migrated inputs, if you used either:

  • interval = auto
  • interval = 24h

instead of a cron, those will import, but continue to fail until you manually edit them (similar to how you manually edit the lookups).

View solution in original post

ejharts2015
Communicator

Answering my own question here, to save folks time and agony in finding a solution.

Our existing database names contain hyphens and underscores (ex. database-things_are-in-dev) which the migration script fails on, to fix edit the following line in

/opt/splunk/etc/apps/splunk_app_db_connect/bin/dbx2/migration/migrations/input/001_migrate_from_dbx1.py

Change this:

name_pattern = r'dbmon-(?P<type>\w+)://(?P<database>\w+)/(?P<unique_name>\w+)'

to this:

name_pattern = r'dbmon-(?P<type>\w+)://(?P<database>\S+)/(?P<unique_name>\S+)'

Rerun script.

Another note you'll need to manually check your migrated inputs, if you used either:

  • interval = auto
  • interval = 24h

instead of a cron, those will import, but continue to fail until you manually edit them (similar to how you manually edit the lookups).

Get Updates on the Splunk Community!

Join Us for Splunk University and Get Your Bootcamp Game On!

If you know, you know! Splunk University is the vibe this summer so register today for bootcamps galore ...

.conf24 | Learning Tracks for Security, Observability, Platform, and Developers!

.conf24 is taking place at The Venetian in Las Vegas from June 11 - 14. Continue reading to learn about the ...

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...