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.
41
+
```plaintext
42
+
'.ipfs' ->'ipfs-backup'
43
+
'.ipfs/datastore_spec' ->'ipfs-backup/data'
44
+
...
45
+
```
46
+
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
85
+
```shell
86
+
ipfs daemon
87
+
```
74
88
75
-
> Initializing daemon...
76
-
> go-ipfs version: 0.5.0-dev-a22dc826c
77
-
> Repo version: 7
78
-
> ...
79
-
> Daemon is ready
80
-
```
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:
81
91
82
-
1. If everything is working fine, you can delete your old IPFS repository:
92
+
```shell
93
+
rm -rf .ipfs-old
94
+
```
83
95
84
-
```bash
85
-
rm -rf .ipfs-old
86
-
```
87
-
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
+
Unix-based operating systems can use the `ln -s` command to create a symbolic link:
147
+
148
+
```shell
149
+
ln -s ~/.ipfs ~/new-ipfs-repo
150
+
```
151
+
152
+
### Windows
153
+
154
+
Windows users can use the `mklink` command to create a symbolic link. This command is available within command-prompt or PowerShell:
Make sure to replace `YOUR_USERNAME` with the name of the user you are currently logged in as.
161
+
113
162
## Troubleshooting
114
163
115
164
Here are some common issues you might run into when moving your IPFS installation.
@@ -120,7 +169,7 @@ Here are some common issues you might run into when moving your IPFS installatio
120
169
121
170
If `ipfs daemon` doesn't run successfully then you can restore your old IPFS repository, assuming you made a copy:
122
171
123
-
```bash
172
+
```shell
124
173
mv .ipfs ipfs-backup-broken
125
174
mv .ipfs-old .ipfs
126
175
```
@@ -137,7 +186,7 @@ If you want to consolidate the two repositories, you can export the IPFS objects
137
186
138
187
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
188
140
-
```bash
189
+
```shell
141
190
mkdir -p car_export
142
191
cd car_export
143
192
cids=$(ipfs refs local)
@@ -149,7 +198,7 @@ done
149
198
150
199
You should then be able to import those files into a new IPFS installation using a command like this:
151
200
152
-
```bash
201
+
```shell
153
202
cd car_export
154
203
ipfs dag import *.car
155
204
```
@@ -163,3 +212,4 @@ Make sure to open the IPFS Desktop application at least once before attempting t
163
212
#### IPFS Desktop won't open
164
213
165
214
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