Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

If you currently use the Datical GUI to manually change your passwords, we have provided a sample script and associated input file that can be used for updating passwords using a CSV file. The following two files are required:

  • updateDBPasswords.groovy (download here)

  • changePasswords.csv (download here)

updateDBPasswords.groovy

This file should be housed in the <datical_installation_dir>\repl\scripts folder.

There are two parameters that should be modified within this file:

  • daticalBaseDir - the parent directory where all Datical DB projects are housed. Be sure to use a Windows path for this directory, eg.

    def daticalBaseDir = "C:\\Users\\AmySmith\\datical\\"
  • passwordFile - set to changePasswords.csv but can be adjusted if you wish to rename this file. This password file should be placed in the daticalBaseDir specified above.

    def passwordFile = "passwordList.csv"

changePasswords.csv

To use the updateDBPasswords.groovy, Liquibase administrators must supply the information in the following format in a changePasswords.csv file: project, dbDef, password

  • project - the name of the folder housing the DDB project. If projects are housed within subfolders from the daticalBaseDir, include the subfolder in the path. In this case use a '/' as the separator.

  • dbDef - the name of the dbDef as specified in the datical.project

  • password - the password for the dbDef. This password should be added in clear text. It is important to keep this file secure and not check the file into source control.

Sample changePasswords.csv content

project,dbDef,password
ET/ET_ORACLE_DDB,REF1,liquibase_user
GAMBIT_DDB,REF5,changeme
GAMBIT_DDB,PROD,changeme

Process Overview and Instructions

  1. Place the updatedDBPasswords.groovy in the <datical_install_dir>/repl/scripts folder.

    1. Update the daticalBaseDir variable to point to the parent directory where all Datical DB projects are housed.

  2. Populate the changePasswords.csv and place in the parent directory where all Datical DB projects are housed (the same value that was set as daticalBaseDir.)

  3. From the same directory where you added the changePasswords.csv file, run the following command:

    hammer groovy updateDBPasswords.groovy
  4. The process performs the following:

    1. For each row in the changePasswords.csv file, runs a git status and git pull in the project’s directory.

    2. Base64 encodes the password value.

    3. Checks the datical.project file in the project’s directory for the dbDef.

    4. Replaces the old password string with the new base64 encoded password.

    5. Runs a git add datical.project, git commit -m'<Message>', and a git push.

Troubleshooting

  • If the daticalBaseDir or the project cannot be found, the following example error is thrown:

    • Error executing Groovy script. C:\Users\AmySmith\datical\ET\ET_ORACLE_DDB\datical.project (The system cannot find the path specified)

  • For missing project, dbDef, or password values the following example errors are thrown:

    • A project value was not found. Skipping row 3.

    • A dbDef value not supplied for ET/ET_ORACLE_DDB. Skipping row 2.

    • Password value not supplied for ET/ET_ORACLE_DDB and REF1. Skipping row 2.

  • If the dbDef cannot be found in the project, the following example error is thrown:

    • DbDef REF10 was not found in the datical.project for ET/ET_ORACLE_DDB.

  • If a change has not been detected for an existing dbDef password, the following example error is thrown:

    • No changes detected for the password to REF1 in project ET/ET_ORACLE_DDB

  • No labels