Maintenance scripts

Maintenance scripts allow you to run utilities for logging and maintaining your synchronizations.

Fix script

The Fix script cleans up the data in the database.

This script is not meant to be used on a regular basis. You primarily use it to clean up stale and corrupt data, resulting from a product upgrade.

Back to top

FullRestClient script for global properties

The FullRestClient script lets you retrieve and set global properties. A common use of this script is to enable or disable web sockets within Micro Focus Connect.

Back to top

Maintenance script

The Maintenance utility can be used to move project maps from one connection into a new connection, within the same application instance. Run the utility using the following syntax: java -jar mfcMaintenance.jar.

For a typical connection, use the following options to move project mappings from one connection to another. To see a list and description of all of the available options, run the utility with no options.

java -jar mfcMaintenance.jar \

-basePath "<base_path_of_connection>" \

-migrateProject \

-synchronizationName "<name of original connection>" \

-newSynchronizationName "<name of new connection>" \

-projectMapping "sourceProject:TargetProject"

The following example looks for a synchronization named Connection A that has project mappings source1:target1 and source2:target2, and moves these mappings into a new synchronization named Connection B.

java -jar mfcMaintenance.jar \

-basePath "C:\Connect" \

-migrateProject \

-synchronizationName "Connection A" \

-newSynchronizationName "Connection B" \

-projectMapping "source1:target1" -projectMapping "source2:target2"

When using the Maintenance utility, follow these guidelines:

  • To move multiple project maps, repeat the projectMapping option:

    -projectMapping "source1:target1" -projectMapping "source2:target2"

  • If a project name contains a colon (such as in Jira), precede it with the backslash escape character, ‘\’. For example, to use the name source:1 add a backlash before the colon:

    -projectMapping "source\:1:target\:1" . This example also shows a non-escaped colon, as you only need the escape colon within the project name.

Back to top

Purge scripts

The Purge script performs the following actions:

  1. Deletes all iteration data from the Micro Focus Connect database.
  2. Removes old logging and audit data from the database and log files.
  3. Purges the dead space from the file system.

Recommended configuration

Set the script to run as a nightly, scheduled batch process, preferably at a time that causes the least inconvenience to users. If run every night, the script should require no more than 15 minutes of Micro Focus Connect server downtime. For details, see Purge files on Windows as a nightly task.

Stopping and restarting the Micro Focus Connect server clears out the process runtime memory cache.

Tip: If you would like the nightly purge to automatically generate a nightly audit report, add the Audit command to the purge script. For details, see Audit script.

Additional uses

You can use the Purge script as a general purpose utility to perform additional tasks that you need to run on a nightly basis. These include:

  • Data folder backups

  • Automatic clearing of watermarks across all connections

  • Extracting users from endpoint systems and importing them into the Micro Focus Connect database user maps

  • Stopping all connections, then starting and running them, one connection, one iteration at a time

  • Stopping all connections, then starting each connection, one at a time

  • Running custom scripts outside the context of Micro Focus Connect

Additional purge scripts

The following purge scripts are also available:

Script Purpose
PurgeDisabledProjects

Removes all disabled projects across all connections from the database.

Note: To target a single connection, include the connectionname parameter.

PurgeDisabledTypes

Removes all disabled types across all connections from the database.

Note: To target a single connection, include the connectionname parameter.

PurgePreviousPasswords Removes all previous passwords across all authenticator users from the database.

Purge script effects on resources

When the Purge script runs, it extracts the audits stored in the database since the last purge run. It also produces a .zip backup of the data folder, containing the most recent snapshot since the last purge. If SMTP email is configured, it also emails a .zip attachment of the audit extraction, to the addressees that were configured.

The size of the audit file and its content are directly affected by the success or failure of the Micro Focus Connect configuration. The more errors recorded in the audits, the larger the audit file. In general, we recommend increasing your disk space beyond the minimum required size since Micro Focus Connect is a resource intensive service. For details, see Windows installation.

The purpose of the audit file productions is to review and investigate errors and determine how to solve them. If the synchronization errors are not relevant for your environment, you may turn off the audit file.

To turn off the auditing:

  1. Open the mfcpurge.bat file, and rem out the line that calls audit.jar. Save the file.

  2. Run the Purge script or add it to your automated tasks.

  3. Set up a nightly job to delete all older audit and data .zip backups, for example seven or more days old. For details, see Purge files on Windows as a nightly task.

Back to top

Audit script

The Audit script generates a de-normalized flat .txt file representation of the audit UI log entries using the pipe character, |, as the column separator.

The file is given a timestamp and saved in the <MF Connect_installdir>\AppData\backup folder. The file can be imported into a spreadsheet or an SQL database for backup, querying, reporting, or general processing.

Note: The generated text file provides more details than the Troubleshooting. If you purge the database at regular intervals, the Audit tab only shows the data since the last purge. Older audit data is exported into a file by the Batch utility scripts, and saved in the backup folder.

Row subset

You can produce a subset of the audit rows by specifying the connections by their name. Use the following syntax: connectionnames=connectionname1,connectionname2,… parameter

If you use the default and do not specify connection names, you receive the rows from all of the connections.

Column subset

You can produce a subset of the audit columns by specifying the column names. Use the following syntax: columnnames=columnname1,columnname2,… parameter.

If you use the default, and do not specify column names, you get all of the columns.

The following is an alphabetical list of the available columns : action, actionvalue, associatedid, endtime, fieldname, fieldvalue, itemactionid, itemid, iterationid, starttime, stacktrace, sourceproject, sourcetype, syncguid, targetproject, and targettype.

Time-based subset

You can produce a subset of the audit rows using the datetime=yyyy-mm-dd parameter. You can specify the data after a specific date. For example datetime=2022-01-03 returns rows that were added after January 3, 2022.

If you use the default, and do not specify a date and time, you get all of the data.

Syntax examples

The following examples show common usages of this utility.

  • This example produces the default report, including all connections with all of the column names:

    "%JRE_PATH%\java.exe" -jar "%UTILITIES_PATH%\mfcAudit.jar" "%CONNECT_PATH%" "|" "%BACKUP_PATH%" “connectionnames=” “columnnames=” "datetime="

  • This example produces a report for the connection named ‘CONN’ with a subset of the columns:

    "%JRE_PATH%\java.exe" -jar "%UTILITIES_PATH%\mfcAudit.jar" "%CONNECT_PATH%" "|" "%BACKUP_PATH%" “connectionnames=CONN” "columnnames=starttime,sourceproject,itemid,fieldname,fieldvalue,actionvalue" "datetime="

Back to top

ResetPassword script

The ResetPassword script resets the password of the Administrator user, replacing it with the string changeme.

This script is especially useful when a customer is locked out of Micro Focus Connect.

A subsequent login through the UI requires changeme to be the specified password, and the user is prompted to provide a new password.

Back to top

See also: