Using restorative SVN commands

Restorative SVN commands allow you to restore Impact Server configuration files that have become corrupted. File corruption can occur if there was a server failure during a write or save operation.

You can use SVN commands to revert to a previous revision of the following types of configuration files on the Impact Server:
  • Services (.props files)
  • Data Sources (.ds files)
  • Data Types (.type files)
  • Projects (.proj files)
  • Policies (.ipl and .js files)

Restoring configuration files using IBM Subversion (SVN) is discussed in the following Support document: https://www.ibm.com/support/pages/node/1114935

Viewing previous revisions of a configuration

To view a list of all available revisions of a configuration file, use the following command:

svn log --verbose <config_filename>

Where <config_filename> is the name of the configuration file whose revisions you want to list.

This command returns a list of the available revisions. For each revision, the following details will be displayed:

  • Revision number
  • Name
  • Date and time at which the revision was created
  • Path of the configuration file

Viewing details of a specific revision of a configuration file

To view details of a specific configuration file revision, use the following command:

svn cat -r <revision_number> <config_filename>

Where <revision_number> is the number of one of the available revisions of the configuration file, and <config_filename> is the name of the configuration file whose details you want to display.

This command returns the full contents of the specified revision of the configuration file.

Viewing the differences between versions of a configuration file

To view the differences between versions of a configuration file, use the following steps:

  1. Display the history of the versions of the configuration file of interest:

    svn log  <config_filename>

    Where <config_filename> is the name of the configuration file whose versions you want to compare.

    For example:

    svn log BVT_DefaultExceptionHandler.ipl

    Sample output from the command:

    ------------------------------------------------------------------------
    r734 | tivoli | 2022-10-05 06:49:12 -0700 (Wed, 05 Oct 2022) | 1 line
    
     
    Done by impactadmin [Checked+in+policy%3A+DefaultExceptionHandler]
    ------------------------------------------------------------------------
    r152 | tivoli | 2022-10-03 21:11:28 -0700 (Mon, 03 Oct 2022) | 1 line
    
     
    Initial Version
    ------------------------------------------------------------------------
    vacuum1:/opt/IBM/tivoli/impact_server/policy #

    From this example history you can see that there are two version of the file that can be compared: r152 and r734.

  2. Display the differences between two versions of the configuration file:

    svn diff  -r <xxx>:<yyy> <config_filename>

    Where:

    <xxx> and <yyy> are the versions of the configuration file that you want to compare.

    <config_filename> is the name of the configuration file whose versions you want to compare.

    For example:

    svn diff  -r 152:734 BVT_DefaultExceptionHandler.ipl

    Sample output from the command:

    Index: BVT_DefaultExceptionHandler.ipl
    ===================================================================
    --- BVT_DefaultExceptionHandler.ipl (revision 152)
    +++ BVT_DefaultExceptionHandler.ipl (revision 734)
    @@ -3,7 +3,7 @@
      * "Restricted Materials of IBM"
      * 5724-S43
      *
    -* (C) Copyright IBM Corporation 2003, 2014. All Rights Reserved.
    +* (C) Copyright IBM Corporation 2003, 2022. All Rights Reserved.
      *
      * US Government Users Restricted Rights - Use, duplication, or
      * disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
    @@ -10,3 +10,4 @@
     ******************************************************** {COPYRIGHT-END-RM} **/
     
      log("DefaultExceptionHandler got the event: " + EventContainer);
    +log("DefaultExceptionHandler - Oskar made a change to this - ErrorMessage: "+ErrorMessage); 
    
    vacuum1:/opt/IBM/tivoli/impact_server/policy # 

Reverting to a previous revision of a configuration file

To revert to a previous revision of a configuration file, use the following command:

svn update -r <revision_number> <config_filename>

Where <revision_number> is the number of one of the available revisions of the configuration file, and <config_filename> is the name of the configuration file that you want to update back to.

This command reverts the configuration file back to a previous revision.

CAUTION:
Before performing any SVN commands that involve update, you should back up your entire $IMPACT_HOME/ directory because after updating to a previous revision, you will not be able to recover to any revisions that may have occurred after the revision you have chosen to update back to. Only older revisions will be available to you.