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!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...