You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
description: "This page walks through how to move your IPFS installation from one system to another. This process is cross-platform compatible and is especially useful for readers who are changing operating systems. However, the process is different for CLI and IPFS Desktop users."
3
4
---
4
5
5
6
# Move an IPFS installation
6
7
7
-
This page walks through how to move your IPFS installation from one system to another. This process is cross-platform compatible and is especially useful for readers who are changing operating systems. The process is to grab the `.ipfs` folder from the _home_ directory of the _donor_ system, and copy it over to _home_ directory on the receiving system.
8
+
This page walks through how to move your IPFS installation from one system to another. This process is cross-platform compatible and is especially useful for readers who are changing operating systems. However, the process is different for CLI and IPFS Desktop users.
9
+
10
+
-[Command-line](#command-line)
11
+
-[IPFS Desktop](#ipfs-desktop)
12
+
-[Symlink](#symlink)
13
+
14
+
## Command-line
15
+
16
+
The process is to grab the `.ipfs` folder from the _home_ directory of the _donor_ system, and copy it over to _home_ directory on the receiving system.
8
17
9
18
This process is not a backup procedure; do not treat it as such. Many things can go wrong with this process, most of which relate to _peer IDs_. Since we are duplicating an `.ipfs` installation folder, both IPFS peers have the same peer ID. This issue is ok as long as you delete the old _donor_ installation once the copy is complete. Never start two peers with the same peer IDs on different places, as they will misbehave.
10
19
11
-
## Move installation
20
+
###Move installation
12
21
13
22
The easiest way to move your IPFS installation is to grab the `.ipfs` folder, and move it to another destination.
14
23
15
-
### Linux and macOS
24
+
####Linux and MacOS
16
25
17
-
1. Stop any IPFS daemons, services, or applications from running.
18
-
1. In a terminal, move to where your IPFS repository is stored, likely your _home_ folder:
26
+
1. Stop any IPFS daemons, services, or applications that are currently running.
27
+
1. In a terminal, move to where your IPFS repository is stored. This is likely your _home_ folder:
The above command checks whether the current operating system supports the `cp --reflink` command. If it does, like in most Linux operating systems, then this command will use the `--reflink` argument when calling the `cp` program. If the operating system does not support the `--reflink` argument, like MacOS, then it will not use that argument.
47
+
The above command checks whether the current operating system supports the `cp --reflink` command. If it does, like in most Linux operating systems, then this command will use the `--reflink` argument when calling the `cp` program. If the operating system does not support the `--reflink` argument, like MacOS, then it will not use that argument.
35
48
1. You now have a copy of your IPFS repository within the `ipfs-backup` folder.
36
49
37
-
### Windows
50
+
#### Windows
38
51
39
-
1. Stop any IPFS daemons, services, or applications from running.
40
-
1. Open the file explorer and go to **C:** → **Users** → **Your Username**.
41
-
1. Select the **View** tab at the top of the file explorer window, and check the **Hidden items** checkbox.
42
-
1. Find the `.ipfs` within your user's _home_ folder. This is usually `C:\Users\Your Username\.ipfs`.
52
+
1. Stop any IPFS daemons, services, or applications that are currently running.
53
+
1. Open the file explorer and go to `C:\Users\YOUR USERNAME`, replacing _YOUR USERNAME_ with your current Windows username.
54
+
1. Select the **View** tab at the top of the file explorer window and check the **Hidden items** checkbox.
55
+
1. Find the `.ipfs` within your user's _home_ folder. This is usually `C:\Users\YOUR_USERNAME\.ipfs`.
43
56
1. Copy this folder to somewhere convenient like the `Desktop` and rename it to `ipfs-backup`.
44
57
45
-
## Restore installation
58
+
### Restore installation
46
59
47
-
Once you have a backup of your IPFS repository in `ipfs-backup`, you can move it to the computer you want to restore to. Once there, you can restore your IPFS repository.
60
+
Once you have a backup of your IPFS repository in `ipfs-backup`, you can move it to the location you want to restore to. Once there, you can restore your IPFS repository.
48
61
49
-
### Linux and macOS
62
+
#### Linux and macOS
50
63
51
-
1. Stop any IPFS daemons, services, or applications from running.
52
-
1. In a terminal, move to where your IPFS repository is stored, likely your _home_ folder:
64
+
1. Stop any IPFS daemons, services, or applications that are currently running.
65
+
1. In a terminal, move to where your IPFS repository is stored. This is likely your _home_ `~` folder:
53
66
54
-
```bash
55
-
cd~/
56
-
```
67
+
```shell
68
+
cd ~/
69
+
```
57
70
58
71
1. Move your current IPFS repository to another folder. If something goes wrong you can restore your installation from here:
59
72
60
-
```bash
61
-
mv .ipfs ipfs-old
62
-
```
73
+
```shell
74
+
mv .ipfs ~/ipfs-old
75
+
```
63
76
64
77
1. Move your backup IPFS repository to `.ipfs`:
65
78
66
-
```bash
67
-
mv ipfs-backup .ipfs
68
-
```
79
+
```shell
80
+
mv ipfs-backup ~/.ipfs
81
+
```
69
82
70
83
1. Start an IPFS daemon:
71
84
72
-
```bash
73
-
ipfs daemon
74
-
75
-
> Initializing daemon...
76
-
> go-ipfs version: 0.5.0-dev-a22dc826c
77
-
> Repo version: 7
78
-
> ...
79
-
> Daemon is ready
80
-
```
85
+
```shell
86
+
ipfs daemon
87
+
```
81
88
82
-
1. If everything is working fine, you can delete your old IPFS repository:
89
+
1. Your IPFS daemon should continue where it left off.
90
+
1. Once you have confirmed that everything is working as normal, you can delete your temporary `ipfs-old` backup:
83
91
84
-
```bash
85
-
rm -rf .ipfs-old
86
-
```
92
+
```shell
93
+
rm -rf .ipfs-old
94
+
```
87
95
88
-
### Windows
96
+
#### Windows
89
97
90
98
1. If restoring to the IPFS Desktop application, open the application at least once before attempting to restore anything.
91
-
1. Stop any IPFS daemons, services, or applications from running.
92
-
1. Open the file explorer and go to `C:\Users\Your Username`.
99
+
1. Stop any IPFS daemons, services, or applications that are currently running.
100
+
1. Open the file explorer and go to `C:\Users\YOUR_USERNAME`.
93
101
1. Select the **View** tab at the top of the file explorer window, and check the **Hidden items** checkbox.
94
-
1. Find the `.ipfs` within your user's _home_ folder. The full address is usually something like `C:\Users\Your Username\.ipfs`.
102
+
1. Find the `.ipfs` within your user's _home_ folder. The full address is usually something like `C:\Users\YOUR_USERNAME\.ipfs`.
95
103
1. Rename the `.ipfs` folder to `ipfs-old`. We can restore from `ipfs-old`if anything goes wrong.
96
104
1. Copy your `ipfs-backup` IPFS repository into your user's _home_ folder and rename it to `.ipfs`.
97
105
1. Open the IPFS Desktop application or run `ipfs daemon` with Powershell. Everything should start, and your IPFS repository should restore normally.
98
106
99
-
## Windows Subsystem for Linux
107
+
### Windows Subsystem for Linux
100
108
101
109
If you have IPFS installed in the Windows Subsystem for Linux, you can move your IPFS repository from Linux into your Windows environment. This process overwrites the IPFS repository in Windows.
102
110
103
111
1. On Windows, open the IPFS Desktop application or run an `ipfs daemon`. Do this at least once.
104
112
1. Stop any IPFS daemons, services, or applications from running in your Linux and Windows environments.
105
113
1. Copy your Linux IPFS repository to Windows. This process overwrites the IPFS repository in Windows:
|  |  |  |
136
+
137
+
1. Choose your new IPFS location within the file browser.
138
+
1. IPFS will stop, move your repository to the new location, and the start up again. If you have a repository larger than 1 GiB it may take a few moments to move it to the new location.
139
+
140
+
## Symlink
141
+
142
+
A different approach to moving your IPFS repository is to simply create a symlink in the original location that points to the new location. This way, no configuration has to be changed, so tools and apps like IPFS Desktop will work normally.
143
+
144
+
### Linux and MacOS
145
+
146
+
### Windows
147
+
113
148
## Troubleshooting
114
149
115
150
Here are some common issues you might run into when moving your IPFS installation.
@@ -120,7 +155,7 @@ Here are some common issues you might run into when moving your IPFS installatio
120
155
121
156
If `ipfs daemon` doesn't run successfully then you can restore your old IPFS repository, assuming you made a copy:
122
157
123
-
```bash
158
+
```shell
124
159
mv .ipfs ipfs-backup-broken
125
160
mv .ipfs-old .ipfs
126
161
```
@@ -137,7 +172,7 @@ If you want to consolidate the two repositories, you can export the IPFS objects
137
172
138
173
Below is a small bash snippet to export all local IPFS objects to a set of files in a directory called `car_export`. These commands should be run as the user who owns the repository you want to export, and the ipfs daemon should be running.
139
174
140
-
```bash
175
+
```shell
141
176
mkdir -p car_export
142
177
cd car_export
143
178
cids=$(ipfs refs local)
@@ -149,7 +184,7 @@ done
149
184
150
185
You should then be able to import those files into a new IPFS installation using a command like this:
151
186
152
-
```bash
187
+
```shell
153
188
cd car_export
154
189
ipfs dag import *.car
155
190
```
@@ -163,3 +198,4 @@ Make sure to open the IPFS Desktop application at least once before attempting t
163
198
#### IPFS Desktop won't open
164
199
165
200
In your user's _home_ folder, rename `.ipfs` and `.ipfs-desktop` to `ipfs-broken` and `ipfs-desktop-broken` respectively. Open the IPFS Desktop application; this creates new `.ipfs` and `.ipfs-desktop` folders. Close the IPFS desktop application and replace `.ipfs` with `ipfs-broken`. If the IPFS desktop application opens, then you now know that the original `.ipfs-desktop` folder was the issue. If the IPFS desktop application doesn't open, then the original `.ipfs` folder may be the issue. If both original folders are causing issues, you may have a corrupted database. If this is the case, post your issue on the [IPFS forums](https://discuss.ipfs.io/).
0 commit comments