Support Support Downloads Knowledge Base Juniper Support Portal Community

Knowledge Base

Search our Knowledge Base sites to find answers to your questions.

Ask All Knowledge Base Sites All Knowledge Base Sites JunosE Defect (KA)Knowledge BaseSecurity AdvisoriesTechnical BulletinsTechnotes Sign in to display secure content and recently viewed articles

[Upgrade EX Switch] Stage 2 - Backup configuration



Article ID: KB20350 KB Last Updated: 08 Nov 2021Version: 6.0

This article documents Stage 2 – Proactively Planning a Juniper EX Switch Upgrade. This involves foresight to prevent losing the current configuration on the switch while performing a Junos OS Software Upgrade. The discussion here centers on multiple methods of backing up the configuration on Juniper EX Switches.

To go directly to other stages of Junos OS upgrade on an EX switch, consult the Resolution Guide -- Upgrading EX Series.


  • Best practices for backing up EX switch configurations

  • Methods for backing-up configurations on devices running Junos OS



The second stage of a Junos OS Software Upgrade is to back up the configuration.

Perform the following steps:

  1. Confirm whether there are any uncommitted changes.

This step is performed to see if there are any uncommitted changes on the device that is running Junos OS before a configuration backup is performed. It is recommended that customers should confirm that there are no uncommitted changes before an upgrade because candidate changes are usually lost on reboot. Perform this step via J-Web or the CLI.


Select Commit Options > Commit.

Changes are committed after the system validates your configuration and the commit is acknowledged. For more information, refer to Using the J-Web Interface.


root@ex# top
root@ex# show | compare

If the above command contains configuration information that you want to keep, then perform a commit:

root@ex# commit
  1. Confirm that the "active" configuration is the configuration that you want to back up.

The current committed configuration on the device that is running Junos OS is called the "active" configuration. This is the configuration recommended for backup. If the current running configuration is what you want to back up (which is usually the case since it is the most updated version of the configuration), then continue to Step 3

If you are not sure, refer to the frequent questions and answers below:

  • If you want more information about the Junos OS configuration filenames and configuration directories, refer to Managing Configurations | CLI User Guide. The current "active" configuration is named juniper.conf.gz in /var/config, and candidate configurations from 4 till 49 can be found in the /var/db/config/ directory.

  • If you prefer to back up a different configuration than the "active" configuration, use the rollback command to load the desired configuration, or note the configuration name by using any of the given methods in Step 3 to back up the desired configuration.

  • If you want to compare the existing configuration with the previous configuration, refer to Managing Configuration Files Through the Configuration History (J-Web Procedure).

  • If you are new to Junos OS, you can refer to the SRX Jumpstation article - KB16693 - SRX Getting Started - Junos CLI Basics, because the SRX and EX CLI basics are the same.

  1. Back up the configuration by using any of the following methods:


Perform the following:

  1. Log in to the device or switch that is running Junos OS via the console. The console port is the data terminal equipment (DTE) interface, which provides a direct and continuous interface with the switch. It is important to connect to the console during installation / configuration backup procedures so that you can capture and see any errors during the upgrade and for any required troubleshooting after. For more information about making a console connection, refer to Connecting a Device to a Management Console

  2. Log the console session before performing the following steps in order to capture the command-line output. You could also perform a simple Copy – Paste function.

  3. Display the "active" configuration on the device or switch that is running Junos OS:

root@ex> show configuration | no-more


root@ex> show configuration | display set | no-more

By default, if the output is longer than the length of the terminal screen, you are provided with a --- (more) --- message to display the remaining output. To display the remaining output, press the Spacebar. To prevent the output from being paginated, enter no-more after the pipe symbol ( | ). For more information about the pipe symbol, refer to Pipe ( | ) Filter Functions in the Junos OS Command-Line Interface.

If you want to save a local copy of the current configuration file in the device, you can also do it with the following command. Remember to move this file to the desired destination from the switch because the local storage will be formatted upon upgrade.

root@ex> show configuration | display set | save /var/tmp/CONFIG-date.txt


Download the current/active configuration (juniper.conf.gz) on the device or switch that is running Junos OS by performing the following:

  1. Prerequisite: FTP services must be enabled on the Junos device or switch. These services are not enabled by default. 

root@ex# set system service ftp
root@ex# commit 
  1. From the FTP client, log in to the switch as root.

  2. On the FTP client, change directory from "/root" to "/config".

  3. Select the juniper.conf.gz file.  (Note that a list of current and previous 0 to 3 configurations will be displayed, and the 4 to 49 configurations will be stored in /var/db/config.)

  4. Copy the juniper.conf.gz file to the desired location by clicking Transfer.


Perform the following:

  1. Click the Maintain tab.

  2. Click Config Management.

  3. Click History.

    • Select the Current configuration check box and click Download.

A list of current and previous 49 configurations is displayed as Configuration History in the main pane.

Refer to the attached screenshot for clarification:

image showing jweb steps


  1. [Optional] Capture System Snapshot.

The System Snapshot feature is NOT typically captured before performing an upgrade. For more information about this command, refer to the following:

  1. After backing up the configuration, refer to Installing Software on EX Series Switches.


Modification History:

2020-02-28: Article checked for accuracy; article found to be relevant and accurate; no changes made.

2021-11-08: Article updated, images and updated links


Comment on this article > Affected Products Browse the Knowledge Base for more articles related to these product categories. Select a category to begin.

Getting Up and Running with Junos

Getting Up and Running with Junos Security Alerts and Vulnerabilities Product Alerts and Software Release Notices Problem Report (PR) Search Tool EOL Notices and Bulletins JTAC User Guide Customer Care User Guide Pathfinder SRX High Availability Configurator SRX VPN Configurator Training Courses and Videos End User Licence Agreement Global Search