Backing Up the Configuration File
Context
If the device is damaged unexpectedly, the configuration file cannot be recovered. You can back up the configuration file in advance using one of the following methods:
- Copy the content displayed on the screen.
- Back up the configuration file to the storage device.
- Back up the configuration file using FTP, TFTP, FTPS, SFTP, or SCP.
- Run a command to back up the configuration file.
- Run a command to back up the current running configuration in real time.
Procedure
- Copy the content displayed on the screen.
Run the display current-configuration command and copy all command outputs to a .txt file. This backs up the configuration file on the hard disk of the maintenance terminal.
If a configuration file is too long, it may be displayed in two lines on the terminal screen, depending on the terminal software. When copying a two-line configuration from the screen to a .txt file, ensure that the configuration is displayed in only one line. Otherwise, configuration restoration may fail.
- Back up the configuration file to the storage device.
The current configuration file can be backed up immediately to the flash memory of the device. After the device starts, run the following commands to back up the configuration file to the flash memory of the device:
<HUAWEI> save config.cfg
<HUAWEI> copy config.cfg backup.cfg
- Back up the configuration file using FTP, TFTP, FTPS, SFTP, or SCP.
The device supports configuration file backup using FTP, TFTP, FTPS, SFTP, or SCP. Configuration file backup using FTP or TFTP is simple, but there are security risks. In scenarios with high security requirements, configuration file backup using FTPS, SFTP, or SCP is recommended. The following describes the configuration file backup process using FTP as an example. For details about TFTP, FTPS, SFTP, and SCP, see File Management.
- Run a command to back up the configuration file.
Run configuration copy startup to file file-name
The startup configuration file is backed up to a specified file.
The file name extension of the specified destination file must be .cfg or .zip. The extensions of the destination and backup files must be the same.
If a file with the same name already exists, the system asks whether to replace the previous file. Press Y to replace the file or N not to do so.
- Run a command to back up the current running configuration in real time.
In the system view, run undo configuration backup local disable.
The function of backing up the current running configuration is enabled.
If the configuration changes, the device will automatically back up the current running configuration to the device after two hours.
By default, the function of backing up the current running configuration to the device is enabled. To disable this function, run the configuration backup local disable command.