Skip to content

Instantly share code, notes, and snippets.

@Schm1tz1
Last active August 10, 2023 12:41
Show Gist options
  • Save Schm1tz1/bc497c829af2d51b6403dc241a68331f to your computer and use it in GitHub Desktop.
Save Schm1tz1/bc497c829af2d51b6403dc241a68331f to your computer and use it in GitHub Desktop.
Migrating from Postman to Insomnia

Migration from Postman to Insomnia

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...)

Postman Export

  • 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.

Conversion of Environment Exports

  • 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 Import

  • 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!

Sources

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment