01-30-2018 04:59 PM
Hi guys,
Good Morning.
Just want to hear your unique ways about how to backup your configuration in the dashboard to your local drive.
In my situation i had an MX65W with configurations already and then i will have a new MX65W coming to be use in another organization.
My question first is how can i backup my configuration from my existing MX65W so that i can use it to my new MX65W? (But this is answered already by meraki support so they provide me a link : https://documentation.meraki.com/zGeneral_Administration/Templates_and_Config_Sync/Cloning_Network_Settings_with_Configuration_Sync ).
In this link i just saw how to clone from network to another network in one organization.
Now, i want to hear from you guys if you experience this already and how you tried to backup from one organization to another organization.
Thanks in advance.
Solved! Go to Solution.
03-31-2020 12:22 AM
What's the output if you execute the following function from within python:
help("modules")
09-06-2020 01:58 AM
Hi Phillip,
I'm facing this issue when starting the script:
----------------python3 meraki-backup.py "My Network"
Traceback (most recent call last):
File "meraki-backup.py", line 209, in <module>
orgid=get_org_id(meraki,args.orgName)
File "meraki-backup.py", line 33, in get_org_id
result = meraki.organizations.get_organizations()
File "/usr/local/lib/python3.6/dist-packages/meraki_sdk/controllers/organizations_controller.py", line 50, in get_organizations
self.validate_response(_context)
File "/usr/local/lib/python3.6/dist-packages/meraki_sdk/controllers/base_controller.py", line 94, in validate_response
raise APIException('HTTP response not OK.', context)
meraki_sdk.exceptions.api_exception.APIException: HTTP response not OK.
09-06-2020 12:02 PM
HI @Alex07 .
I'm not sure what is causing that. Perhaps try update your modules:
pip install -U requests
pip install -U meraki-sdk
pip install -U python-dotenv
Double-check your API key is correct.
02-17-2021 05:55 AM
@Philip D'Ath - am I right to think that your script does not save switch configuration?
Great work on this btw.
02-17-2021 10:24 AM
Correct @bdosen . At the time I wrote it, there wasn't an API available to get switch configuration.
One day I'll re-write it to use the V1 API and will be able to add more stuff in.
05-18-2021 07:43 AM
Hello @Philip D'Ath @ I've tried your new script for backup and i got the following error also here I'm using the Meraki Sanbox as testing purpose, post successful test will go for production unit.
Also please correct me if I'm wrong I'm using .env.meraki file for storing my API key.
x_cisco_meraki_api_key=bfddXXXXXXXXXXXXXXXXXXXXXXXXXXX0d88
I'm getting following error while execution
C:\Program Files\Python>python meraki-backup.py "Adecco_UAT"
Traceback (most recent call last):
File "C:\Program Files\Python\meraki-backup.py", line 209, in <module>
orgid=get_org_id(meraki,args.orgName)
File "C:\Program Files\Python\meraki-backup.py", line 33, in get_org_id
result = meraki.organizations.get_organizations()
File "C:\Users\p\AppData\Roaming\Python\Python39\site-packages\meraki_sdk\controllers\organizations_controller.py", line 50, in get_organizations
self.validate_response(_context)
File "C:\Users\p\AppData\Roaming\Python\Python39\site-packages\meraki_sdk\controllers\base_controller.py", line 94, in validate_response
raise APIException('HTTP response not OK.', context)
meraki_sdk.exceptions.api_exception.APIException: HTTP response not OK.
Also I've tested my all packages which are completely fine.
C:\Program Files\Python>pip install -U requests
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: requests in c:\users\p\appdata\roaming\python\python39\site-packages (2.25.1)
Requirement already satisfied: chardet<5,>=3.0.2 in c:\users\p\appdata\roaming\python\python39\site-packages (from requests) (4.0.0)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in c:\users\p\appdata\roaming\python\python39\site-packages (from requests) (1.26.4)
Requirement already satisfied: certifi>=2017.4.17 in c:\users\p\appdata\roaming\python\python39\site-packages (from requests) (2020.12.5)
Requirement already satisfied: idna<3,>=2.5 in c:\users\p\appdata\roaming\python\python39\site-packages (from requests) (2.10)
C:\Program Files\Python>pip install -U meraki-sdk
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: meraki-sdk in c:\users\p\appdata\roaming\python\python39\site-packages (1.5.0)
Requirement already satisfied: cachecontrol<1.0,>=0.11.7 in c:\users\p\appdata\roaming\python\python39\site-packages (from meraki-sdk) (0.12.6)
Requirement already satisfied: python-dateutil<3.0,>=2.5.3 in c:\users\p\appdata\roaming\python\python39\site-packages (from meraki-sdk) (2.8.1)
Requirement already satisfied: requests<3.0,>=2.9.1 in c:\users\p\appdata\roaming\python\python39\site-packages (from meraki-sdk) (2.25.1)
Requirement already satisfied: jsonpickle<1.0,>=0.7.1 in c:\users\p\appdata\roaming\python\python39\site-packages (from meraki-sdk) (0.9.6)
Requirement already satisfied: msgpack>=0.5.2 in c:\users\p\appdata\roaming\python\python39\site-packages (from cachecontrol<1.0,>=0.11.7->meraki-sdk) (1.0.2)
Requirement already satisfied: six>=1.5 in c:\users\p\appdata\roaming\python\python39\site-packages (from python-dateutil<3.0,>=2.5.3->meraki-sdk) (1.16.0)
Requirement already satisfied: idna<3,>=2.5 in c:\users\p\appdata\roaming\python\python39\site-packages (from requests<3.0,>=2.9.1->meraki-sdk) (2.10)
Requirement already satisfied: certifi>=2017.4.17 in c:\users\p\appdata\roaming\python\python39\site-packages (from requests<3.0,>=2.9.1->meraki-sdk) (2020.12.5)
Requirement already satisfied: chardet<5,>=3.0.2 in c:\users\p\appdata\roaming\python\python39\site-packages (from requests<3.0,>=2.9.1->meraki-sdk) (4.0.0)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in c:\users\p\appdata\roaming\python\python39\site-packages (from requests<3.0,>=2.9.1->meraki-sdk) (1.26.4)
C:\Program Files\Python>pip install -U python-dotenv
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: python-dotenv in c:\users\p\appdata\roaming\python\python39\site-packages (0.17.1)
05-18-2021 05:24 PM
It is not spitting out any useful error. The SDK is having trouble getting the list of orgs.
Have you got API access enabled on the org?
05-24-2021 08:24 AM
I was able to fetched all details using Postman APIs in Sand Box, but while connecting given script getting the same this.
C:\Program Files\Python38>python meraki-backup.py "DevNet Sandbox"
Traceback (most recent call last):
File "meraki-backup.py", line 209, in <module>
orgid=get_org_id(meraki,args.orgName)
File "meraki-backup.py", line 33, in get_org_id
result = meraki.organizations.get_organizations()
File "C:\Users\rahul.dhawan\AppData\Roaming\Python\Python38\site-packages\meraki_sdk\controllers\organizations_controller.py", line 50, in get_organizations
self.validate_response(_context)
File "C:\Users\rahul.dhawan\AppData\Roaming\Python\Python38\site-packages\meraki_sdk\controllers\base_controller.py", line 94, in validate_response
raise APIException('HTTP response not OK.', context)
meraki_sdk.exceptions.api_exception.APIException: HTTP response not OK.
Is that anything related to Python installation ?
05-24-2021 01:51 PM
>meraki_sdk.exceptions.api_exception.APIException: HTTP response not OK.
This is the most puzzling bit. It doesn't give any kind of specific error. Are you using Python 3.x?
Try checking that the modules are up to date.
pip install -U requests
pip install -U meraki-sdk
pip install -U python-dotenv
09-24-2021 08:30 AM
I have found the solution, its work from me .
1st check your API key is working.
by using below python temple.
07-15-2021 12:15 AM
Hi Philip,
is there any course you would recommend for network engineers to get familiar with Python? at least to be able to read and understand a code, and do minor fixes if the code through some errors.
Many thanks. @Philip D'Ath
07-15-2021 01:59 PM
You could give the Cisco Meraki Python tutorial a try.
09-28-2024 07:10 PM
hey phillip , hoping you could help me out with this error ( latest 3.12 python installed )
c:\Python\Scripts>meraki-backup.py "SYDNIC Computer Systems"
Traceback (most recent call last):
File "C:\Python\Scripts\meraki-backup.py", line 213, in <module>
orgid=get_org_id(meraki,args.orgName)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python\Scripts\meraki-backup.py", line 37, in get_org_id
result = meraki.organizations.get_organizations()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\Python312\Lib\site-packages\meraki_sdk\controllers\organizations_controller.py", line 50, in get_organizations
self.validate_response(_context)
File "C:\Program Files\Python312\Lib\site-packages\meraki_sdk\controllers\base_controller.py", line 94, in validate_response
raise APIException('HTTP response not OK.', context)
meraki_sdk.exceptions.api_exception.APIException: HTTP response not OK.
c:\Python\Scripts>python3 meraki-backup.py "SYDNIC Computer Systems"
Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases.
c:\Python\Scripts>python3 meraki-backup.py "SYDNIC Computer Systems"
Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases.
c:\Python\Scripts>
09-28-2024 11:53 PM
This script is based on the V0 API, which is now deprecated.
Check out this back system provided in the sample Meraki automation scripts.
https://github.com/meraki/automation-scripts/tree/master/backup_configs
07-01-2024 07:43 AM
Not sure about local drive but there are out of the box solutions that fill this gap. They also protect from malicious data deletion with SLA coverage. I have found this on Meraki marketplace
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide