# Switch node-red to a new device: how to migrate the data?

**URL:** https://discourse.nodered.org/t/switch-node-red-to-a-new-device-how-to-migrate-the-data/80649
**Category:** General
**Created:** [18 August 2023 15:11 UTC](https://discourse.nodered.org/t/switch-node-red-to-a-new-device-how-to-migrate-the-data/80649 "2023-08-18T15:11:31Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![Mannshoch](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mannshoch/32/19477_2.png) [@Mannshoch](https://discourse.nodered.org/u/Mannshoch)
#### Post date: [18 August 2023 15:11 UTC](https://discourse.nodered.org/t/switch-node-red-to-a-new-device-how-to-migrate-the-data/80649/1 "2023-08-18T15:11:32Z")

</div>

I have a nodered on a desktop. Currently, all data is in /home/USER/.nodered  
Now I have a device where I wish another directory for node-red.

What are the steps to migrate all data with all flows,subflows and moduls and config as it is to the new server?

---

<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: [18 August 2023 15:31 UTC](https://discourse.nodered.org/t/switch-node-red-to-a-new-device-how-to-migrate-the-data/80649/2 "2023-08-18T15:31:42Z")

</div>

After installing node red on the new system and running it for the first time, copy the whole of the .node-red folder _except_ the node\_modules folder from the original system to the .node-red folder on the new system. Then in a command window go into the .node-red folder and run  
`npm install`  
which will install any extra nodes you need.  
Then restart node-red and refresh the browser window if you have one open.

---

<div class="post-metadata">

### Author: ![Mannshoch](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mannshoch/32/19477_2.png) [@Mannshoch](https://discourse.nodered.org/u/Mannshoch)
#### Post date: [20 August 2023 07:13 UTC](https://discourse.nodered.org/t/switch-node-red-to-a-new-device-how-to-migrate-the-data/80649/3 "2023-08-20T07:13:12Z")

</div>

1. Copied data witout node\_modules
2. I setup docker-compose and link /data/ to my .node\_red
3. I started docker-compose and wayt until nodered runs
  - The start screen load an Empty flow.

4. I open a shell inside docker and run npm install in /data/
5. I still have an empty flow.

---

<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: [20 August 2023 07:30 UTC](https://discourse.nodered.org/t/switch-node-red-to-a-new-device-how-to-migrate-the-data/80649/4 "2023-08-20T07:30:53Z")

</div>

What files are in /data?  
When you look at the node red startup log what flows file does it say it is using? Post the startup log here.

---

<div class="post-metadata">

### Author: ![Mannshoch](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mannshoch/32/19477_2.png) [@Mannshoch](https://discourse.nodered.org/u/Mannshoch)
#### Post date: [20 August 2023 07:58 UTC](https://discourse.nodered.org/t/switch-node-red-to-a-new-device-how-to-migrate-the-data/80649/5 "2023-08-20T07:58:03Z")

</div>

Nodered create a new flow.json. But in the same Direcory are files called flow\_nodered.json and flow\_nodered\_cred.json

---

<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: [20 August 2023 08:08 UTC](https://discourse.nodered.org/t/switch-node-red-to-a-new-device-how-to-migrate-the-data/80649/6 "2023-08-20T08:08:35Z")

</div>

> [@Mannshoch](#):
>
> in the same Direcory are files called flow\_nodered.json and flow\_nodered\_cred.json

The default flows file name changed some time ago. Are you sure the new one is not called flows.json (you posted flow.json)  
Delete the new flows and cred files and rename the old files to match the new format.

---

<div class="post-metadata">

### Author: ![Mannshoch](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mannshoch/32/19477_2.png) [@Mannshoch](https://discourse.nodered.org/u/Mannshoch)
#### Post date: [20 August 2023 08:47 UTC](https://discourse.nodered.org/t/switch-node-red-to-a-new-device-how-to-migrate-the-data/80649/7 "2023-08-20T08:47:02Z")

</div>

ok, now my Flows work! Thanks a lot!

---

<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: [3 September 2023 08:47 UTC](https://discourse.nodered.org/t/switch-node-red-to-a-new-device-how-to-migrate-the-data/80649/8 "2023-09-03T08:47:10Z")

</div>

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