This is a basic script that will copy the port settings on one Meraki MS switch to the corresponding ports on a another switch.

Simple instructions for Windows users:

  1. Install Python 3.9 from the windows app store
  2. At command prompt type: ‘pip3 install meraki’
  3. Copy the attached python script to a directory on your PC
  4. Edit the file and put your API key in between the single quotes’
  5. At command prompt cd to the directory where you have the python script, type ‘python3.9 clone.py’
  6. Enter old SN
  7. Enter new SN
  8. Script will run. If the switch you are cloning has less than 48 ports, you will get errors at the end. That is fine since the script is set up for 48 ports, once it runs out of ports to look at, it stops. You can edit line 14 for the exact port count if this annoys you ;)

Use Case

This is a basic script that will copy the port settings on one Meraki MS switch to the corresponding ports on a another switch. Simple instructions for Windows users: 1. Install Python 3.9 from the windows app store 2. At command prompt type: ‘pip3 install meraki’ 3. Copy the attached python script to a directory on your PC 4. Edit the file and put your API key in between the single quotes’ 5. At command prompt cd to the directory where you have the python script, type ‘python3.9 clone.py’ 6. Enter old SN 7. Enter new SN 8. Script will run. If the switch you are cloning has less than 48 ports, you will get errors at the end. That is fine since the script is set up for 48 ports, once it runs out of ports to look at, it stops. You can edit line 14 for the exact port count if this annoys you ;)
View code on GitHub
  • Owner

  • Contributors

    +1Github contributor
  • Categories

  • Products

    Meraki
  • Programming Languages

    Python
  • License

    GNU General Public License v3.0

Code Exchange Community

Get help, share code, and collaborate with other developers in the Code Exchange community.View Community
Disclaimer:
Cisco provides Code Exchange for convenience and informational purposes only, with no support of any kind. This page contains information and links from third-party websites that are governed by their own separate terms. Reference to a project or contributor on this page does not imply any affiliation with or endorsement by Cisco.