# Corrupt flow export?

**URL:** <https://discourse.nodered.org/t/corrupt-flow-export/83368>\
**Category:** General\
**Created:** [2 December 2023 00:25 UTC](https://discourse.nodered.org/t/corrupt-flow-export/83368 "2023-12-02T00:25:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![WillPickering](https://avatars.discourse-cdn.com/v4/letter/w/58956e/32.png) [@WillPickering](https://discourse.nodered.org/u/WillPickering)\
**Post date:** [2 December 2023 00:25 UTC](https://discourse.nodered.org/t/corrupt-flow-export/83368/1 "2023-12-02T00:25:12Z")

</div>

Hi,

I had a pi die, and was attempting to restore my last node-red export. It seems that the export didn't format correctly and is missing the delimiters.

Anyone have an easy fix, or should I start creating a macro to help expand out correctly.

Here is a snippet of what I ended up with:

`[{id9cae0ae2.ed48a8,typetab,labelMain Control},{ide1868fe3.26484,typetab,labelAWS IOT},{ide30e5d05.38c8,typetab,labelUNIFI Clients},{id3a1d15d5.7b70da,typetab,label1wire & weather test},{ide6f8ec79.77b28,typetab,labelAudio Test},{id30d8bee8.bd67c2,typetab,labelFlow 1},{ide8acb282.bd776,typetab,labelE-Ink},{idc9f6c470.525a78,typesubflow,nameSubflow 1,info,in[],out[]},{idec0d1ecc.71321,typeui_tab,z,nameHome,icondashboard,order1},{idf50c77cb.f84c98,typeui_group,z,nameMain Display`

Compared to the nomal formatting below. It seems to be missing the "quotes" and "colons."

```auto
[{"id":"b9884d5c.5211e","type":"inject","z":"2a15e348.a7c6dc",
"name":"","topic":"","payload":"hi","payloadType":"str","repeat"
:"","crontab":"","once":false,"x":294,"y":123,"wires":[["cb6af
000.5a3e6"]]},{"id":"cb6af000.5a3e6","type":"debug","z":"2a15e
348.a7c6dc","name":"","active":true,"console":"false","complet
e":"false","x":447,"y":123,"wires":[]}]

```

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [2 December 2023 04:42 UTC](https://discourse.nodered.org/t/corrupt-flow-export/83368/2 "2023-12-02T04:42:35Z")

</div>

How did you do your export to end up with such a mess?

In principle it's possible to come up with a script to try and improve matters.  
For example here is a sed file to partially fix your snippet

```auto
s/{id/\{\"id\":\"/g;
s/\,type/\",\"type\":\"/g;
s/\,label/\"\,\"label\":\"/g;
s/\,name/\"\,\"name\":\"/g;
s/\,icon/\"\,\"icon\":\"/g;
s/\}\,/\"\}\,/g

```

Each line of the script reformats a single key in the json and there are a lot of possible keys. (My simple flow file has 190)  
Running it gives something like this. I've ringed a couple of problems.

- What format data can occur within square brackets in a flows file?
- Numeric values might get quoted.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/6/c65a5fc103962a76f9aa4dc0149f0c1e23b6afef.jpeg)

So I imagine you will be better off rebuilding from scratch.

Edit - SD cards sometimes go read-only before actually dying. Are you sure you can't extract the undamaged flows file from the card?

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [2 December 2023 09:28 UTC](https://discourse.nodered.org/t/corrupt-flow-export/83368/3 "2023-12-02T09:28:07Z")

</div>

Have you got a backup of the .node-red folder on the pi? That will contain the full flows file.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [31 January 2024 09:28 UTC](https://discourse.nodered.org/t/corrupt-flow-export/83368/4 "2024-01-31T09:28:52Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
