This describes the steps I performed for my Migration from Postman to Insomnia which I did for several reasons (open vs. closed source, UI and handling, usage of proxies in corporate environments...)
- You need to export each collection / environemnt on its onw. Please select a version that is supported by Insomnia (currently v2). Currently there is no tool for batch-conversion of the dumps so you need to perform this step.
- Postman exports enviroments with quite some metadata - e.g.:
{
"id": "90a3836c-b039-41b0-8f3d-2606edc4328d",
"name": "Docker (localhost)",
"values": [
{
"key": "CP_SR_API",
"value": "http://localhost:8081",
"type": "default",
"enabled": true
},
...
- Insomnia will only accept a JSON object with key-value-pairs, so simply use jq to convert:
jq '.values | from_entries' Test.postman_environment.json
- example output:
{
"CP_SR_API": "http://localhost:8081",
"CP_CONNECT_API": "http://localhost:8083",
"CP_SR_USER": "sr-user",
"CP_SR_PASS": "sr-user",
"CP_CONNECT_USER": "",
"CP_CONNECT_PASS": "",
"CP_MDS_API": "http://localhost:8090",
"CP_MDS_USER": "",
"CP_MDS_PASS": "",
"CP_KSQL_API": "http://localhost:8088"
}
- One-liner to convert all environments:
for i in *_environment.json; do jq '.values | from_entries' $i >${i}_insomnia.json; done
- Insomnia, go to
Preferences / Data / Import
, select each file and start the import. - Copy & Paste the converted environment files where needed (no auto-import possible).
- Once import is done, you're read to go!