Database Migration Script
  • 22 Apr 2024
  • Dark
    Light
  • PDF

Database Migration Script

  • Dark
    Light
  • PDF

Article summary

Run DB Migration

A migration script must be manually run to import properties.json configuration into the MongoDB database. After the migration script is run once, the properties.json file will only be referenced by IAP for the MongoDB connection properties, with IAP referencing the database for all other configuration properties.

Note: Any desired changes to properties.json should be made before proceeding.

  1. Enter the directory containing the IAP migration script.

    cd /opt/pronghorn/current/node_modules/@itential/pronghorn-core/migration_scripts
    
  2. Run the migration script.

    node migratePropertiesToDatabase.js
    

Click here for IAP 2023.1 and IAP 2022.1

Key/value pairs after --userInputs can be changed to match the RabbitMQ deployment in the 2023.1 and 2022.1 release versions.

# Option 1) RabbitMQ installed on IAP server with default port.
node migratePropertiesToDatabase.js --userInputs protocol=amqp port=5672 hosts="localhost"

# Option 2) RabbitMQ installed on standalone server.
node migratePropertiesToDatabase.js --userInputs protocol=amqp port=5672 hosts="rabbitmq.test.com"

The properties.json file will be updated during the migration script run to only contain the MongoDB connection properties, with all other configuration parameters stored within the default MongoDB database named pronghorn. The migration script creates a backup of the original properties.json file that will look similar to properties_b4b03d30-ad00-4f61-bd9e-7953968ef8c4.json.

Migration Script Help Options

The migratePropertiesToDatabase.js script has a --help option that allows you to use the script in unattended mode with the --userInputs option. The following example depicts the various help options available and briefly explains how they are used.

Figure 1: Help Options

01_migrationScriptHelpOptions.png

Option to Ignore Schema Errors

The migration script also has an option that will ignore schema validation errors during migration. Run the migratePropertiesToDatabase.js script, but this time add -i to the parameters.

node migratePropertiesToDatabase.js -i

Start IAP (First Time)

Once the migration script runs, start IAP. Refer to Start IAP (First Time) for more information.


Was this article helpful?

Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.