Updating 3DPassport Database Properties

The updateDatabaseProperties_3dpassport.bat|.sh tool lets you update the passwords or the JDBC URL of the 3DPassport database. You can run the tool to perform either operation individually, or both operations at the same time.

This task shows you how to:

Update Database Passwords

You can run the tool to inform 3DPassport of the database passwords updates.

Before you begin:

Update the database with the new passwords of the database users for the passport/cas schema.

  1. Stop TomEE.
  2. Run the following command on all machines running 3DPassport instances.

    On Windows:

    %passport_install_path%\win_b64\code\command\updateDatabaseProperties_3dpassport.bat 
    --installation-path %passport_install_path% --database-properties-file %passport_database_props_input%

    On Linux:

    ${passport_install_path}/linux_a64/code/command/updateDatabaseProperties_3dpassport.sh 
    --installation-path ${passport_install_path} --database-properties-file ${passport_database_properties_file}

    where:

    • ${passport_install_path} is mandatory and must be set to the 3DPassport installation path
    • ${passport_database_properties_file} is mandatory and is a custom file created by the administrator with new passwords and can keep at any location. The properties file must contain at least one of the supported properties.

      The format of the file is:

      database.password.admin=x3dpassadmin_new
      database.password=x3dpassadmin_new
      database.cas.password=x3dpasstokens_new

      where:

      • database.password: database user password for the main 3DPassport database
      • database.password.admin: database admin user password for the main 3DPassport database
      • database.cas.password: database user password for the 3DPassport tokens database.

    Since the passwords will be in encrypted form, copy the previous database properties file to verify that the update has taken place.

  3. Restart TomEE.

Update the JDBC URL

In certain circumstances, you may need to migrate your 3DPassport users to a different database, in which case you need to export the users, import them into the new database, then update the JDBC URL.

  1. Export the users from database 1 and import them into database 2.

    Note: If the 3DPassport installation was performed using tnsnames.ora path, ensure that the details of the new databases have been correctly specified in the tnsnames.ora file, otherwise the connection will fail.

    On Oracle:

    1. To export users from a database named AAD5PASS7:

      expdp sys/sys@AAD5PASS7 schemas=aad5_pass17 directory=DATA_PUMP_DIR
      dumpfile=aad5_pass17.dmp logfile=aad5_pass17.log

    2. To import the exported users into a database named AAD5PASS5:

      impdp system/system@AAD5PASS5 directory=DATA_PUMP_DIR DUMPFILE=aad5_pass17.dmp
      REMAP_SCHEMA=aad5_pass17:aad5_pass17 logfile=aad5_pass17.log full=y

    On SQL Server:

    1. In SQL Server Management Studio, right-click on the database and select Tasks > Export Data...
    2. Specify the data sources from which to copy the data, then click Next.
    3. Specify the details of the databases into which you want to import the data, then click Next.

      Make sure the databases have already been created. They should have the same schema names as used in the database from which the data has been exported.

    4. In the next dialog box, select the option Copy data from one or more tables or views, then click Next.
    5. In the next dialog box, select the tables to be exported.
    6. Click Next then Finish to start the export/import procedure.
  2. Stop TomEE.
  3. Run the following command.

    On Windows:

    %passport_install_path%\win_b64\code\command\updateDatabaseProperties_3dpassport.bat 
    --installation-path %passport_install_path% --database-properties-file %passport_database_props_input%

    On Linux:

    ${passport_install_path}/linux_a64/code/command/updateDatabaseProperties_3dpassport.sh 
    --installation-path ${passport_install_path} --database-properties-file ${passport_database_properties_file}

    where:

    • ${passport_install_path} is mandatory and must be set to the 3DPassport installation path
    • ${passport_database_properties_file} is mandatory and is a custom file created by the administrator with new URLs and can keep at any location.

      The format of the file is:

      database.url=jdbc\:oracle\:thin\:@AAD5PASS5
      database.cas.url=jdbc\:oracle\:thin\:@AAD5PASS5

      where:

      • database.url: JDBC URL of the main 3DPassport database
      • database.cas.url: JDBC URL of the 3DPassport tokens database.

    JDBC URL syntax for Oracle:

    jdbc:oracle:thin:@//<host>[:port]/<service>

    Example:

    database.url=jdbc:oracle:thin:@//localhost:1521/iam
    database.cas.url=jdbc:oracle:thin:@//localhost:1521/cas

    JDBC URL syntax for SQL Server:

    jdbc:sqlserver://[serverName[\instanceName][:portNumber]][;property=value[;property=value]]

    Example:

    database.url=jdbc:sqlserver://localhost;databaseName=iam
    database.cas.url=jdbc:sqlserver://localhost;databaseName=cas

  4. Restart TomEE.
  5. Check the database.properties file for the updated URL, and access the admin tools and check the repository properties.