insomnia icon indicating copy to clipboard operation
insomnia copied to clipboard

Only first collection is importing.

Open Marc477 opened this issue 1 year ago • 6 comments

Expected Behavior

I wanted to export all my collections to a file, so i went to Preferences -> Data -> Export All. And it generated a file. I have no document in my project (default insomnia project), around 10 different request collections.

Now i want to import it after reinstalling my computer. When I do, only the first collection is imported. I tried importing from different places (within a collection, or preferences-data)

When I reimport, it should have all the collections. Not just the first one.

Actual Behavior

Only 1 out of 10 collection is importing.

It shows me 410 request will be imported, but then after that only around 7 appear, which is the first collection i ever created, all the other collections aren't there. I checked the exportfile in a text editor and i can see the request from other collections are there, but i cant import them.

I tried different ways, either in the main menu, create - Import, or by creating a collection request and then import within that collection. None work.

Please how to import all my collections? File is in yaml format.

Reproduction Steps

Start with fresh insomnia install 2023.2.0 Create multiple collections, each with requests inside (no need to create new documents or projects) Export with Preferences - Data - Export All - to yaml file Delete insomnia from your computer and all saves Reinstall Insomnia 2023.2.0 Try to import your collections (any way you want).

Is there an existing issue for this?

Additional Information

No response

Insomnia Version

2023.2.0

What operating system are you using?

Windows

Operating System Version

Windows 11 Home

Installation method

Downloaded from website

Last Known Working Insomnia version

No response

Marc477 avatar May 13 '23 17:05 Marc477

+1 Can confirm that I can replicate the issue. I have some older collections (created in insomnia v3) mixed with documents. Also there is no way to export a collection with credentials (envs).

Inspecting the .json or .yaml file (v4) I can see all requests but just first collection is imported.

Issues

  • Only 1 collection is imported, even if you export multiple collections
  • When collection is imported, it's imported as a document (which I personally don't like since it's inconsistent)
  • There is no way to export a single collection and include environments (this can be selected only if you want to export a whole workspace)
  • UX issue: when you click import button in some workspace, it should default the import to that workspace, instead it defaults to the first workspace available

IMO those are super important things, it's hard/impossible to migrate my collections to another computer.

To reproduce

Here's a sample export that contains 2 collections called Group 1 and Group 2, with one request (1 to google, 2 to yahoo). If you try to import it it will import only Group 1. Also, I exported collections, but those are imported as documents 😮‍💨

The JSON file is created with Insomnia 2023.2.2 (and collections are created with the same version).

{"_type":"export","__export_format":4,"__export_date":"2023-05-31T10:58:28.651Z","__export_source":"insomnia.desktop.app:v2023.2.2","resources":[{"_id":"req_bcef656bbe2d4871a0ea63aa409da02a","parentId":"wrk_d711b7b2efc54129b5cfc0e1e05c41e6","modified":1685530641370,"created":1685530635290,"url":"https://google.com","name":"Google","description":"","method":"GET","body":{},"parameters":[],"headers":[],"authentication":{},"metaSortKey":-1685530635290,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"wrk_d711b7b2efc54129b5cfc0e1e05c41e6","parentId":null,"modified":1685530632860,"created":1685530632860,"name":"Group 1","description":"","scope":"collection","_type":"workspace"},{"_id":"req_956c08f291724aadae643af8a0d9e52d","parentId":"wrk_efd3f75e15a14c92ab63e47d680ebe22","modified":1685530661114,"created":1685530654549,"url":"https://yahoo.com","name":"Yahoo","description":"","method":"GET","body":{},"parameters":[],"headers":[],"authentication":{},"metaSortKey":-1685530654549,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"wrk_efd3f75e15a14c92ab63e47d680ebe22","parentId":null,"modified":1685530651898,"created":1685530651898,"name":"Group 2","description":"","scope":"collection","_type":"workspace"},{"_id":"env_3b32f43ba4ee03abe4329fc3086d9f4fe2c913fd","parentId":"wrk_d711b7b2efc54129b5cfc0e1e05c41e6","modified":1685530632863,"created":1685530632863,"name":"Base Environment","data":{},"dataPropertyOrder":null,"color":null,"isPrivate":false,"metaSortKey":1685530632863,"_type":"environment"},{"_id":"jar_3b32f43ba4ee03abe4329fc3086d9f4fe2c913fd","parentId":"wrk_d711b7b2efc54129b5cfc0e1e05c41e6","modified":1685530643942,"created":1685530632864,"name":"Default Jar","cookies":[{"key":"1P_JAR","value":"2023-05-31-10","expires":"2023-06-30T10:57:23.000Z","domain":"google.com","path":"/","secure":true,"hostOnly":false,"creation":"2023-05-31T10:57:23.941Z","lastAccessed":"2023-05-31T10:57:23.941Z","id":"1011442344511202"},{"key":"AEC","value":"AUEFqZdLp1TbKb16hlAA7IQ4LO6IGWCliTwUDHRrqvaEMnoFwfMjJHjgCg","expires":"2023-11-27T10:57:23.000Z","domain":"google.com","path":"/","secure":true,"httpOnly":true,"extensions":["SameSite=lax"],"hostOnly":false,"creation":"2023-05-31T10:57:23.941Z","lastAccessed":"2023-05-31T10:57:23.941Z","id":"8387965983134862"},{"key":"NID","value":"511=Lq5xgew1q7RHczodgZswW6XK9t-gG0TgDzCBP2TC2CeXtLymKX1GTQAgJ_NstS1TPxRMA9mJfYL88urUWaK67Jv_UbgXmpcLU_F0LlTnyMsfESmQkTwSCmApbFlLzknLuJ7U0O6sINUsWKZrl7pvM82l5rg0fBDYmz_UYWWoQ4g","expires":"2023-11-30T10:57:23.000Z","domain":"google.com","path":"/","httpOnly":true,"hostOnly":false,"creation":"2023-05-31T10:57:23.941Z","lastAccessed":"2023-05-31T10:57:23.941Z","id":"9093468373564149"}],"_type":"cookie_jar"},{"_id":"spc_1977e0540a494deda3eb179c40753dbf","parentId":"wrk_d711b7b2efc54129b5cfc0e1e05c41e6","modified":1685530632860,"created":1685530632860,"fileName":"Group 1","contents":"","contentType":"yaml","_type":"api_spec"},{"_id":"env_04439c6f524bd4a388ff303c4216b7f0821f015a","parentId":"wrk_efd3f75e15a14c92ab63e47d680ebe22","modified":1685530691926,"created":1685530651900,"name":"Base Environment","data":{"url":"yahoo.com"},"dataPropertyOrder":{"&":["url"]},"color":null,"isPrivate":false,"metaSortKey":1685530651900,"_type":"environment"},{"_id":"jar_04439c6f524bd4a388ff303c4216b7f0821f015a","parentId":"wrk_efd3f75e15a14c92ab63e47d680ebe22","modified":1685530651901,"created":1685530651901,"name":"Default Jar","cookies":[],"_type":"cookie_jar"},{"_id":"spc_90455d88724e4761bcc4a96b79dd24d7","parentId":"wrk_efd3f75e15a14c92ab63e47d680ebe22","modified":1685530651898,"created":1685530651898,"fileName":"Group 2","contents":"","contentType":"yaml","_type":"api_spec"}]}

After scanning you can see in the UI that it found 2 requests, and some environments, but imports only the first collection and no envs. image

radenkovic avatar May 31 '23 10:05 radenkovic

Have you found a way to export a request collection (with environments) and import it as a request collection (with environments) ? I'm only able to import as the "Design Document" which is really not what I want.

As far as I can tell, this feature is completely not existant right now. There isn't even a workaround with exporting/importing them 1 at a time.

gumarm avatar Jun 14 '23 20:06 gumarm

I ended up reverting to 2023.1.0 and it imports properly.

gumarm avatar Jun 14 '23 20:06 gumarm

This is still not fixed. Need a fix for this.

Meanwhile if you have this issue, you can open a copy of the yaml file in notepad, and remove all parts except for the collection you want to import. Each request start with the _id tag so you can remove the lines from one _id to the next _id that aren't part of the collection you want to import.

Repeat this for each collection until you import them all.

Marc477 avatar Jun 15 '23 00:06 Marc477

Looks like I'm having the same issue, per https://twitter.com/tommygeorge/status/1669747831643549713?s=20

tcg avatar Jun 16 '23 16:06 tcg

I ended up reverting to 2023.1.0 and it imports properly.

Indeed. I went to the release page for 2023.1.0 @ https://github.com/Kong/insomnia/releases/tag/core%402023.1.0 , downloaded the package for my machine/OS, and importing appears to have correctly brought in all my Collections and environments and requests. 👍🏻

tcg avatar Jun 16 '23 16:06 tcg

Hi folks, this should be fixed now in latest beta releases, when importing into a new project it will detect the Workspaces (Collections and Design Documents) of the whole export file.

image

filfreire avatar Jul 19 '23 15:07 filfreire

Thanks for suggesting 2023.1.0. That version still needs no login and I see I have all my workspaces imported correctly.

image

WesleyBlancoYuan avatar Mar 04 '24 08:03 WesleyBlancoYuan