Did you ever needed to login on a Cisco Switch and change the configuration? The responsible person is on vacation or out of the office; you forgot the password of the switch and you want to login, and do your job to make the configuration working.
Some months ago I had a problem with a failing network segment and I needed to act quickly for this production area. I found a spare switch but was not able to login.
How to reset a Cisco switch and maintain the configuration?
Type rename flash:config.text flash:config.backup to rename current configuration file to backup. Type boot to reload the switch.
Choose no for the initial configuration.
Rename flash:config.backup config.text and copy flash:config.text system:running-config You are done now and can add or change the usernames or enable secret. Doing these steps I was able to act quickly and in 15 minutes up and running with the spare switch.