Multiple issues for export / import: REST api error 400, Tree in left hand pane is broken, Draw.io
Asked by Chris Cilino:

Hello

I continue to face issues when exporting and importing a space. For reference, previous issues are

* <https://community.atlassian.com/t5/Confluence-questions/Space-Export-Import-Issues/qaq-p/1441483>
* <https://jira.atlassian.com/browse/CONFCLOUD-70555>
* The above are resolved as of cloud version **Confluence 1000.0.0-ea8824db2a3f**

**Cloud Version: 1000.0.0-ea8824db2a3f**

**Symptoms:**

**Issue 1:**Odd Parent item with home icon, can't expand it.

1. After import, the Pages tree in the left hand pane won't expand for 24 hours (I think). When I attempt to expand the top-level item I see a spinning progress wheel (shown below):
2. ![2020-08-13_16h38_37.png](/t5/image/serverpage/image-id/106632iDF25C91AC02B4656/image-size/large?v=v2&px=999 "2020-08-13_16h38_37.png")
3. I'm unsure why this tree item with a home icon is even appearing in my pages tree in the left hand pane. A top level tree item with the home icon does NOT appear in my exported space.

**Issue 2:**Some custom content of type Draw.io can't be found

1. Some ccustom content like draw.io diagrams can't be found. When I select the "draw.io Diagrams" from the left hand pane and then select some of the diagrams, I get a page saying "Diagram not found". This **does not happen** with all of the draw.io diagrams. However when I export and import, the issue always appears with the same diagrams.

![2020-08-13_16h44_14.png](/t5/image/serverpage/image-id/106633i1F8CB7FEDD6F022D/image-size/large?v=v2&px=999 "2020-08-13_16h44_14.png")After Selecting System Diagram - Test Cell 1.0 I see:

![2020-08-13_16h44_47.png](/t5/image/serverpage/image-id/106634i196D6BF876663BAB/image-size/large?v=v2&px=999 "2020-08-13_16h44_47.png")

**Issue 3:** REST API returns Error 400 when attempting to update some pages.

3 out of 172 pages return this error when I attempt to use the REST API PUT on /rest/api/content and pass in the JSON for the update page. The exact error is:

{"statusCode":400,"data":{"authorized":false,"valid":true,"errors":\[\],"successful":false},"message":"com.atlassian.confluence.api.service.exceptions.BadRequestException: Content body cannot be converted to new editor format"}

One two of the pages, I use the new link feature (I don't know what it's called). If you copy and paste a full url to a page, confluence renders it as the page name. So I have three of those "Display As Link" links in the source page. When I export that page, import it and then try to use the REST API to update the page, I get error 400. If, in the exported page, I delete the "Display as Link", save, add the Display as link back, then I can use the rest API.

On another page my link doesn't include the base address. It just starts off with "/wiki/spaces\<rest of the url\>". I'm guessing confluence assumes the current base url... but for whatever reason, that kind of url also breaks the rest api.

To the Atlassian support team, I have a space exported that should easily reproduce the problem if you're interested in seeing it. In the meantime, I'm going to act like the "display as link" breaks the rest api and avoid it.


Answers:
author: Chris Cilino
body: Updating the community on my progress

**Issue 3** is a known bug: <https://jira.atlassian.com/browse/CONFCLOUD-69902>

**Issue 1** has "magically" disappeared

**Issue 2:**This is "kinda" my fault. Before I export a space I'm deleting all history of pages and attachments for various reasons. When using the "pageIDs" import, draw.io is looking for a specific version of a diagram... that I had deleted. So the solution was for me to write a small algorithm that changes the "revision" parameter in the draw.io xml of the storage format to to"1". Then I run the reindexing and pageIDs import. Draw.io said they will look into making the page ids import functionality more robust to handle this case.

While changing "revision" back to 1 solves the problem for the source draw.io diagrams, it does not fix the embedded draw.io diagrams. So I'll need to also write a script to adjust the "baseURL" and "pageId' xml of the embedded draw.io in the page storage format. I'm hoping I won't have to change the "imgPageId" as well... because I have no idea how to get that number.


author: Chris Cilino
body: Update to issue 1. As of cloud version 1000.0.0-7311b18208cf there is no longer a delay or odd behavior with the left hand pane tree.


author: Chris Cilino
body: **update for Issue 2 above.**

If I wait a few hours and then run the draw.io re-indexing (beta) utility, the missing diagrams symptom is alleviated. Unfortunately, Page ID's export \\ import doesn't seem to fix links in the draw.io diagrams though. I've contacted draw.io for help with regarding the links.


Tags: cloud