Configuration Versioning

The Configuration Versioning feature allows you to maintain and manage backup copies of the Cisco running configuration on or off the device. The Configuration Replace feature uses the Configuration Versioning feature to provide a rollback to a saved copy of the running configuration.

Finding Feature Information

Your software release may not support all the features documented in this module. For the latest caveats and feature information, see Bug Search Tool and the release notes for your platform and software release. To find information about the features documented in this module, and to see a list of the releases in which each feature is supported, see the feature information table.

Use Cisco Feature Navigator to find information about platform support and Cisco software image support. To access Cisco Feature Navigator, go to www.cisco.com/​go/​cfn. An account on Cisco.com is not required.

Information About Configuration Versioning

Configuration Archive

The Cisco configuration archive provides a mechanism to store, organize, and manage an archive of Cisco configuration files to enhance the configuration rollback capability provided by the configure replace command. Before this feature was introduced, you could save copies of the running configuration using the copy running-config destination-url command, storing the replacement file either locally or remotely. However, this method lacked any automated file management. With the Configuration Replace and Configuration Rollback feature, you can automatically save copies of the running configuration to the configuration archive. These archived files serve as checkpoint configuration references and can be used by the configure replace command to revert the configuration to a previous state.

The archive config command allows you to save Cisco configurations in the configuration archive using a standard location and filename prefix that is automatically appended with an incremental version number (and optional time stamp) as each consecutive file is saved. This functionality provides consistent identification of saved configuration files. You can specify how many versions of the running configuration are kept in the archive. After the maximum number of files are saved in the archive, the oldest file is automatically deleted when the next, most recent file is saved. The show archive command displays information for all configuration files saved in the configuration archive.

The configuration archive, in which the configuration files are stored and available for use with the configure replace command, can be located on the following file systems depending on your platform:

  • If your platform has disk0:—disk0:, disk1:, ftp:, pram:, rcp:, slavedisk0:, slavedisk1:, or tftp:

  • If your platform does not have disk0:—bootflash:, ftp:, harddisk:, http:, pram:, rcp:, tftp:, usb0:, or usb1:

How to Configure Configuration Versioning

Configuring the Characteristics of the Configuration Archive

Before using the archive config command, the configuration archive must be configured. Perform this task to configure the characteristics of the configuration archive.

SUMMARY STEPS

    1.    enable

    2.    configure terminal

    3.    archive

    4.    path url

    5.    maximum number

    6.    time-period minutes

    7.    end

    8.    archive config


DETAILED STEPS
     Command or ActionPurpose
    Step 1 enable


    Example:
    Device> enable
     

    Enables privileged EXEC mode.

    • Enter your password if prompted.

     
    Step 2 configure terminal


    Example:
    Device# configure terminal
     

    Enters global configuration mode.

     
    Step 3 archive


    Example:
    Device(config)# archive
     

    Enters archive configuration mode.

     
    Step 4 path url


    Example:
    Device(config-archive)# path bootflash:myconfig
     

    Specifies the location and filename prefix for the files in the configuration archive.

    • Depending on your hardware platform, the name of your file system might be different than shown in the example.

    Note   

    If a directory is specified in the path instead of file, the directory name must be followed by a forward slash as follows: path flash:/directory/. The forward slash is not necessary after a filename; it is necessary only when specifying a directory.

     
    Step 5 maximum number


    Example:
    Device(config-archive)# maximum 14
     

    (Optional) Sets the maximum number of archive files of the running configuration to be saved in the configuration archive.

    • The number argument is the maximum number of archive files of the running configuration to be saved in the configuration archive. The range is 1 to 14. The default is 10.

    Note   

    Before using this command, you must configure the path command to specify the location and filename prefix for the files in the configuration archive.

     
    Step 6 time-period minutes


    Example:
    Device(config-archive)# time-period 10
     

    (Optional) Sets the time increment for automatically saving an archive file of the current running configuration in the configuration archive.

    • The minutes argument specifies how often, in minutes, to automatically save an archive file of the current running configuration in the configuration archive.

    Note   

    Before using this command, you must configure the path command to specify the location and filename prefix for the files in the configuration archive.

     
    Step 7 end


    Example:
    Device(config-archive)# end
     

    Exits to privileged EXEC mode.

     
    Step 8 archive config


    Example:
    Device# archive config
     

    Saves the current running configuration file to the configuration archive.

    Note   

    You must configure the path command before using the archive config command.

     

    Monitoring and Troubleshooting the Configuration

    SUMMARY STEPS

      1.    enable

      2.    show archive

      3.    debug archive versioning

      4.    debug archive config timestamp

      5.    exit


    DETAILED STEPS
      Step 1   enable

      Use this command to enable privileged EXEC mode. Enter your password if prompted. For example:



      Example:
      Device> enable
      Device#
      
      Step 2   show archive

      Use this command to display information about the files saved in the configuration archive. For example:



      Example:
      Device# show archive
      
      There are currently 1 archive configurations saved.
      The next archive file will be named bootflash:myconfig-2
       Archive #  Name
         0 
         1       bootflash:myconfig-1 <- Most Recent
         2 
         3 
         4 
         5 
         6 
         7 
         8 
         9 
         10 
         11 
         12 
         13 
         14 
      

      The following is sample output from the show archive command after several archive files of the running configuration have been saved. In this example, the maximum number of archive files to be saved is set to three.



      Example:
      Device# show archive
      
      There are currently 3 archive configurations saved.
      The next archive file will be named bootflash:myconfig-8
       Archive #  Name
         0        
         1       :Deleted
         2       :Deleted
         3       :Deleted
         4       :Deleted
         5       bootflash:myconfig-5
         6       bootflash:myconfig-6
         7       bootflash:myconfig-7 <- Most Recent
         8
         9
         10
         11
         12
         13
         14
      
      Step 3   debug archive versioning

      Use this command to enable debugging of the configuration archive activities to help monitor and troubleshoot configuration replace and rollback. For example:



      Example:
      Device# debug archive versioning
      Jan  9 06:46:28.419:backup_running_config
      Jan  9 06:46:28.419:Current = 7
      Jan  9 06:46:28.443:Writing backup file bootflash:myconfig-7
      Jan  9 06:46:29.547: backup worked
      
      Step 4   debug archive config timestamp

      Use this command to enable debugging of the processing time for each integral step of a configuration replace operation and the size of the configuration files being handled. For example:



      Example:
      Device# debug archive config timestamp
      Device# configure replace bootflash:myconfig force
      Timing Debug Statistics for IOS Config Replace operation:
             Time to read file slot0:sample_2.cfg = 0 msec (0 sec)
             Number of lines read:55
             Size of file        :1054
      Starting Pass 1
             Time to read file system:running-config = 0 msec (0 sec)
             Number of lines read:93
             Size of file        :2539
             Time taken for positive rollback pass = 320 msec (0 sec)
             Time taken for negative rollback pass = 0 msec (0 sec)
             Time taken for negative incremental diffs pass = 59 msec (0 sec)
             Time taken by PI to apply changes = 0 msec (0 sec)
             Time taken for Pass 1 = 380 msec (0 sec)
      Starting Pass 2
             Time to read file system:running-config = 0 msec (0 sec)
             Number of lines read:55
             Size of file        :1054
             Time taken for positive rollback pass = 0 msec (0 sec)
             Time taken for negative rollback pass = 0 msec (0 sec)
             Time taken for Pass 2 = 0 msec (0 sec)
      Total number of passes:1
      Rollback Done
      
      Step 5   exit

      Use this command to exit to user EXEC mode. For example:



      Example:
      Device# exit
      Device>

      Configuration Examples for Configuration Versioning

      Example: Creating a Configuration Archive

      The following example shows how to perform the initial configuration of the configuration archive. In this example, bootflash:myconfig is specified as the location and filename prefix for the files in the configuration archive and a value of 10 is set as the maximum number of archive files to be saved. Depending on your hardware platform, the name of your file system might be different than shown in the example.

      configure terminal
      !
      archive
       path bootflash:myconfig
       maximum 10
       end

      Additional References

      Related Documents

      Related Topic

      Document Title

      Cisco IOS commands

      Cisco IOS Master Command List, All Releases

      Information about managing configuration files

      “Managing Configuration Files” module in the Managing Configuration Files Configuration Guide

      Commands for managing configuration files

      Cisco IOS Configuration Fundamentals Command Reference

      Technical Assistance

      Description

      Link

      The Cisco Support and Documentation website provides online resources to download documentation, software, and tools. Use these resources to install and configure the software and to troubleshoot and resolve technical issues with Cisco products and technologies. Access to most tools on the Cisco Support and Documentation website requires a Cisco.com user ID and password.

      http:/​/​www.cisco.com/​cisco/​web/​support/​index.html

      Feature Information for Configuration Versioning

      The following table provides release information about the feature or features described in this module. This table lists only the software release that introduced support for a given feature in a given software release train. Unless noted otherwise, subsequent releases of that software release train also support that feature.

      Use Cisco Feature Navigator to find information about platform support and Cisco software image support. To access Cisco Feature Navigator, go to www.cisco.com/​go/​cfn. An account on Cisco.com is not required.
      Table 1 Feature Information for Configuration Versioning

      Feature Name

      Releases

      Feature Information

      Configuration Versioning

      12.2(25)S

      12.2(33)SRA

      12.3(7)T

      Cisco IOS XE Release 2.1

      The Configuration Versioning feature allows you to maintain and manage backup copies of the Cisco running configuration on or off the device. The Configuration Replace feature uses the Configuration Versioning feature to provide a rollback to a saved copy of the running configuration.

      The following commands were introduced or modified: archive config, debug archive versioning, log config, maximum, path (archive configuration), show archive, time-period, write-memory.