The kandoMaintain utility allows you to administer, upgrade, backup, and restore, the GitCentric database. It is similar to the AccuRev maintain utility. For details, see "maintain" Command Reference.
The kandoMaintain utility is located in the bin directory where you installed GitCentric. To use kandoMaintain, the AccuRev database server must be running, but we recommend that you stop the GitCentric server, by shutting down Tomcat. For example:
cd <ac_home>/WebUI/tomcat/bin ./shutdown.sh
All kandoMaintain commands (except help) require a database administrator user and password. You can enter the user name and password on the command line with the -u and -P options, respectively. If you do not supply these, kandoMaintain will prompt you for them. You can also provide either or both of these values in a text file and provide a path to the file (see the -Fc <path> option).
Note: Providing the database password in a script or in a configuration file can compromise system security. Make sure that such files are protected and not generally accessible.
The commands to make, remove, upgrade, back up, or restore a database (mkdb, rmdb, upgradedb, backupdbs, restoredbs) prompt you to confirm the operation before proceeding. This confirmation prompt can be overridden with the -y option.
The command line usage is as follows:
kandoMaintain [ mkdb|rmdb|upgradedb|backupdbs|restoredbs|mvrepos|testconn|lsconfig|addconfig|rmconfig|checksync|help ] [ -u <dbadmin> -P <dbpass> -c <url> | -Fc <path> ]
This table lists the kandoMaintain commands alphabetically. Click the link for more information.
|addconfig||Adds a configuration parameter to the GitCentric database configuration table. Returns an error if you specify a name that already exists with -n <name>.|
|backupdbs||Creates a backup of the GitCentric database and writes the backup file to the directory from which the backupdbs command was run.|
|checksync||Verifies that the latest branch-stream synchronization for the specified branch is correct.|
|help||Displays usage information.|
|lsconfig||Lists the entries from the GitCentric database configuration table.|
|mkdb||Creates a GitCentric database with the latest schema.|
|mvrepos||Moves any Kando 2012.1 repository from an old storage area to the new GitCentric storage area.|
|restoredbs||Restores the backup of the GitCentric database created by the backupdbs command.|
|rmconfig||Deletes a configuration parameter from the GitCentric database configuration table.|
|rmdb||Removes a GitCentric database|
|testconn||Tests the Java Database Connectivity (JDBC) connection to the PostgreSQL instance (does not test for the existence of a GitCentric database.|
|upgradedb||Upgrades a GitCentric database to the latest schema.|
kandoMaintain command line options
This following table describes the kandoMaintain command line options and flags.
|-u <dbadmin>||The database administration user. This is the same user name as specified during installation (default is postgres). If this is required by the command you are using but you do not include it, kandoMaintain prompts you for it.|
|-P <dbpass>||The database administration password. This is the same user password as specified during installation. If this is required by the command you are using but you do not include it, kandoMaintain prompts you for it. If you write scripts that incorporate this option, be sure to secure the file against unauthorized access.|
The database connection string:
jdbc:postgresql://<host>:<port>/<dbname>If you do not specify -c for a command that requires it, kandoMaintain assumes the default value
|-Fc <path>||The path to a text file (such as
<gc_home>/dbsettings.conf) containing values for three of the parameters used by
kandoMaintain. The contents of this file should include:
DB_USER=postgres DB_PASS=postgres DB_CONNECT =dbc:postgresql://localhost:5075/kando
Note: The settings and the values accepted by this configuration file can change without notice from release to release.
|-Fb <path>||The path to the backup file of the GitCentric database created by the backupdbs.|
|-n <name>||Configuration name (the param_name field in the GitCentric database configuration table).|
|-v <value>||Configuration value (the param_value field in the GitCentric database configuration table).|
|-m '<comment>'||Configuration comments (the comments field in the GitCentric database configuration table). Double or single quotes are required if the comment includes spaces.|
|-r <repository_path>||The path to the GitCentric repository. For mvrepos, the path to the repository to which the command should move existing repositories after an upgrade installation. For checksync, the path to the repository whose synchronization status you are checking.|
|-b <branch>||The name of the branch in the GitCentric repository whose synchronization status you are checking with the checksync command.|
|-y||Suppress confirmation prompting for mkdb, rmdb, mvrepos, or upgradedb.|
|-I||When executing an upgradedb command, initialize a new database if one does not exist.|
|--diff||For checksync, compares each directory, file, and link between the Git branch and AccuRev stream whose synchronization status you are checking and reports any discrepancies.|
To troubleshoot errors during import and export operations you can use kandoMaintain to enable a logging file and preserve temporary files.
Run the utility with the following options:
kandoMaintain addconfig -u <dbadmin> -n ACCUREV_COMMAND_LOGFILE -v <fullpath> |
kandoMaintain addconfig -u <dbadmin> -n PRESERVE_TEMP_FILES -v y