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!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...