EdgeRouter - Backing Up the Config Directory
Overview
Readers will learn how to backup the config directory on an EdgeRouter. This directory is often used as persistent storage for various files.
- Applicable to the latest EdgeOS firmware on all EdgeRouter models.
- More information on the Ubiquiti Network Management System can be found on the UNMS website.
Table of Contents
- The EdgeOS Config Directory
- Backup using UNMS
- Backup using the Web UI
- Backup using the Command Line
- Related Articles
The EdgeOS Config Directory
The EdgeRouter config directory is located at /config and is used to store various system files such as:
-
Boot/startup configuration file
See the Backup and Restore Configuration article for more information. -
OpenVPN certificates and key files
See the OpenVPN Server and OpenVPN Site-to-Site articles for more information. -
VPN RSA keys
See the Dynamic Site-to-Site IPsec VPN using FQDNs article for more information. -
Custom (boot/startup) scripts
See the Run Operational Mode Command from Scripts article for more information. -
Commit archive
See the Archiving and Managing the Configuration Files article for more information.
Files stored in the config directory persist between reboots and firmware upgrades. The directory is only cleared when the device is reset to factory defaults. The contents of the config directory can either be downloaded through UNMS, the local Web UI (contained in the configuration backup archive) or transferred/copied from the Command Line. Each method is demonstrated below.
Backup using UNMS
Extracting the config directory from the EdgeRouter.
1. Navigate to the Devices and select the EdgeRouter.
2. Navigate to the Backups section.
3. Manually create a new backup or select one of automatically created backup files.
4. Download the backup archive and select the For This Device option.
5. Open the backup file using archival program such as 7-Zip and navigate to the config directory.
- VPN RSA keys are stored in /config/ipsec.d/rsa-keys/
- OpenVPN certificates and key files are stored in /config/auth/
- Scripts are stored in /config/scripts/
- Commit revisions are stored in /config/archive/
- The boot/startup configuration (config.boot) is stored in /config/
Backup using the Web UI
1. Navigate to the System tab in the bottom-left of the Web UI to download the backup configuration archive.
System > Configuration Management & Device Maintenance > Back Up Config
2. Download the backup config file by clicking on the Download button.
3. The EdgeRouter will prompt you to save the archive on your computer.
4. Open the backup file using archival program such as 7-Zip and navigate to the config directory.
- VPN RSA keys are stored in /config/ipsec.d/rsa-keys/
- OpenVPN certificates and key files are stored in /config/auth/
- Scripts are stored in /config/scripts/
- Commit revisions are stored in /config/archive/
- The boot/startup configuration (config.boot) is stored in /config/
Backup using the Command Line
Backing up the config directory using the command line requires some additional steps because some of the files are owned by the root user. In this example, the files in the /config directory are manually added to an archive that is later transferred using SCP.
1. Access the root user shell and add the files in the /config directory to an archive.
sudo tar -czvf /tmp/backupconfig.tar.gz /config
2. On the workstation, run the following command to transfer the archive using SCP.
scp ubnt@192.168.1.1:/tmp/backupconfig.tar.gz ./
3. Open the backup file using archival program such as 7-Zip and navigate to the config directory.
- VPN RSA keys are stored in /config/ipsec.d/rsa-keys/
- OpenVPN certificates and key files are stored in /config/auth/
- Scripts are stored in /config/scripts/
- Commit revisions are stored in /config/archive/
- The boot/startup configuration (config.boot) is stored in /config/