How to back up configuration in Enterprise SONiC Distribution by Broadcom?

Table of Contents

Introduction

Backing up Broadcom SONiC is crucial to prevent data loss and minimize downtime due to failures, misconfigurations, or updates. A proper backup ensures you can quickly restore configurations, databases, and system files when needed.

Making backup

STEP 1: If you are not already logged in, connect via SSH or console:

STEP 2: save configuration

admin@sonic:~$ sonic-cli
sonic# write memory

STEP 3: Copy your startup configuration with way You prefer

 sonic# copy startup-configuration
  config:                Copy to configuration directory (config://filename)
  ftp:                   Copy to remote FTP server (ftp://userid:passwd@hostip/filepath)
  home:                  Copy to home directory (home://filename)
  http:                  Copy to remote HTTP server (http://hostip/filepath)
  running-configuration  Copy to running-configuration
  scp:                   Copy to remote SCP server (scp://userid:passwd@hostip/filepath)
  usb:                   Copy to usb media directory (usb://filename)

sonic# copy startup-configuration scp://user@1.1.1.1/your/destination/path/backup_config.json

Restore backup

STEP 1: transfer your backup to device via SCP:

scp user@remote-server:</your/destination/path/My_backup.json> <your/destination/path>

STEP 2: Copy backup to config_db.json file

sudo cp <your/destination/path/My_backup.json> /etc/sonic/config_db.json

STEP 3: Reload the Configuration Without Restarting (Optional)

If you want to apply the new configuration without restarting the system:

sudo config reload -y

The system will load the configuration from config_db.json and apply the changes.

STEP 4: Restart SONiC (If Required)

To ensure that all changes take effect properly, restart the system:

sudo reboot

By following these steps, you can successfully restore your SONiC system from a backup configuration.

Congratulations!

Well done! You’ve successfully backed up and restored the configuration on your BROADCOM SONiC switch. Regular backups help protect your network setup from unexpected issues and simplify disaster recovery.

Happy Networking!

If you want to explore more topics, be sure to check out our other guides, including:

How to configure the port breakout in Broadcom SONiC?

Broadcom SONiC tech-support logs guide

 

For more free resources, visit: https://stordis.com/free-resources/

Comments 0

Articles in this section