Differences

This shows you the differences between two versions of the page.

Link to this comparison view

switches:procurve_backup_config [2019/03/15 17:10] (current)
ericclaus created
Line 1: Line 1:
 +====== How to Backup and Restore HP Procurve Switches ======
 +These steps will guide you through using SSH to access the switch, backing up the current configuration,​ and then also restoring a switch to a saved configuration.
 +
 +A few things you will need before doing this: 
 +  * TFTP Server: http://​www.solarwinds.com/​products/​freetools/​free_tftp_server.aspx (make sure after installing it and setting it up you allow UDP Port 69 through your firewall settings in a firewall rule named "​TFTP"​)
 +  * PuTTY (if manually backing up): http://​www.chiark.greenend.org.uk/​~sgtatham/​putty/​download.html
 +
 +Once all these are downloaded and installed, you're ready to begin. ​
 +=====Backing Up=====
 +====The Powershell Way====
 +Powershell is used to automatically backup the switches'​ configuration files. The config files are only backed up if there has been a change since the time the config was last backed up. In the root of the switch backup directory, there is a log file which logs which switches were backed up, and which ones were not, each time the script runs. Each switch has its own folder inside of the switch backup directory, and the config files are stored in these. The backup script logs any changes to the switch configs in a change log inside of each switches'​ folder. ​
 +
 +The Posh-SSH module must be installed on the computer the script is running on: ''​Install-Module -Name Posh-SSH''​.
 +
 +The Compare-Files.ps1,​ Get-SecurePassword.ps1,​ and StartStop-SolarwindsTftpServer.ps1 scripts must be located in the relative path ''​.\Other\''​ (inside of a folder called **Other** in the same directory as this backup script).
 +
 +This script is part of the Cyrus Backup Solution and is called from Cyrus-Backup-Client.ps1
 +
 +Backup-SwitchConfig.ps1
 +
 +====The Manual Way====
 +  - Start Solarwinds TFTP Server and make sure the TFTP firewall rule is enabled.
 +  - Run PuTTY and SSH into the switch using its proper IP and port 22. You can save these connections for later with a common name that's easier to remember.
 +  - Log in with administrative credentials.
 +  - Use the CLI <​code>​ copy startup-config tftp <​IP-ADDRESS OF TFTP> <​FILENAME.cfg>​ </​code>​ and hit enter. It should download to the root of your TFTP server folder.
 +  - Then, move the config file to the switch backup directory (see the Google Sheets file).
 +
 +=====Restoring From a Backup=====
 +(You should already have a .cfg file saved on the root of your TFTP server folder before attempting this.)
 +
 +  - SSH into the switch with Putty and log in.
 +  - Use the CLI <​code>​ restore startup-configuration from <​IP-ADDRESS OF TFTP> <​FILENAME.cfg>​ </​code>​ and hit enter.
 +  - It should upload from the root of your TFTP server folder. The switch may need a reboot after this.
  
  • switches/procurve_backup_config.txt
  • Last modified: 2019/03/15 17:10
  • by ericclaus