Deploying your configuration data in command-line mode

About this task

There may be circumstances under which you want to run or schedule deployment of configuration data without user interface interaction or without viewing the source and target comparison results.

To accomplish this you can deploy your configuration data in command-line mode. When you deploy your data in command-line mode, CDT automatically compares the source and target environments and then deploys the configuration data.

To deploy configuration data in command-line mode:

Procedure

  1. Set the properties in the <INSTALL_DIR>/bin/cdtshell.cmd file for windows (cdtshell.sh for UNIX/Linux) as described in Table 1.
    Table 1. Configuration deployment tool properties
    Property Description
    SOURCE_DB The logical identifier for the source database. This value corresponds to the Name setting in the <SourceDatabases> element in the ydkprefs.xml file.
    SOURCE_PASSWORD Optional. If using a database as the source destination for data, specify the password for the database instance.
    TARGET_DB The logical identifier for the target database. This value corresponds to the Name setting in the <TargetDatabases> element in the ydkprefs.xml file.
    TARGET_PASSWORD Optional. If using a database for the target destination, specify the password for the database instance.
    TARGET_HTTP_PASSWORD Specify the password of the http user required to refresh the cache on the server.
    Note: This parameter is not required if there is no cache to refresh on the server.
  2. Run the <INSTALL_DIR>/bin/setupfiles.cmd script for windows (setupfiles.sh for UNIX/Linux).
  3. Run the <INSTALL_DIR>/bin/cdtshell.cmd script for windows (cdtshell.sh for UNIX/Linux).

Results

You can also schedule this script to run at any appropriate time.

You can use the following MODE command line options with CDT:

  • MODE Deploy—To deploy changes from source to target database. The various other options available with this MODE argument are:
    • ExportDir <directory>—The specified <directory> will be created, and the results of the comparison are stored in that <directory>.
    • ExportPassphrase <password>—The specified password will be used to encrypt supported Import or Export data when exporting results. This is only applicable when ExportDir parameter is passed.
    • ImportDir <directory>—The specified <directory> should contain the exported results. Instead of comparing the source and target databases, this export will be loaded. When you pass this argument, the source database properties are not used.
    • ImportPassphrase <password>—The specified password will be used to decrypt data from the import files, and it should match the password given to create the export file.
    • DoNotSynchronize <Y|N>—If you pass Y, only the comparison the is done; nothing is deployed. By default, exported results are automatically deployed.

For example, if you want to perform comparison and export the comparison results to specific directory. But you do not want to deploy those changes, pass the following arguments:


-MODE Deploy -ExportDir C:\CDT\Reports -DoNotSynchronize Y

If you do not pass the MODE java argument explicitly, CDT uses MODE Deploy option as default.

  • MODE CDT2IE—To convert the CDT comparison export format to the Import or Export file format. The two required parameters that you need to pass with this MODE argument are:
    • InputFile <Path to the ydkexport.xml file>
    • OutputFile <Name of the Import or Export file to write>

      For example:

      
      -MODE CDT2IE -InputFile C:\CDT\ydkexport.xml -OutputFile NewImportFile.xml
      
  • MODE IE2CDT—To convert the Import or Export file format to the CDT comparison file format. The two required parameters that you need to pass with this MODE argument are:
    • InputFile <Name of the Import or Export file to write>
    • OutputDir <Path to the directory where the CDT comparison file should be stored>

      For example:

      
      -MODE IE2CDT -InputFile MyImportFile.xml -OutputDir C:\CDT\Reports
      
  • MODE LABELDEPLOY—To deploy audit changes between two version labels. The two available options with this MODE argument are:
    • FromLabel <Label identifier to start from>
    • ToLabel <Label identifier to end with>

      For example:

      
      -MODE LABELDEPLOY -FromLabel MyLabel1 -ToLabel MyLabel2