Skip to content

Commit 2efcb09

Browse files
Adds Desktop section to 'move your installation.'
1 parent 375409e commit 2efcb09

File tree

5 files changed

+3509
-17036
lines changed

5 files changed

+3509
-17036
lines changed

docs/.vuepress/config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ module.exports = {
193193
'/how-to/take-snapshot',
194194
'/how-to/store-play-videos',
195195
'/how-to/host-git-style-repo',
196-
'/how-to/move-ipfs-installation'
196+
'/how-to/move-ipfs-installation/move-ipfs-installation'
197197
]
198198
},
199199
{

docs/how-to/move-ipfs-installation.md renamed to docs/how-to/move-ipfs-installation/move-ipfs-installation.md

Lines changed: 94 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,115 +1,150 @@
11
---
22
title: Move an IPFS installation
3+
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."
34
---
45

56
# Move an IPFS installation
67

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.
817

918
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.
1019

11-
## Move installation
20+
### Move installation
1221

1322
The easiest way to move your IPFS installation is to grab the `.ipfs` folder, and move it to another destination.
1423

15-
### Linux and macOS
24+
#### Linux and MacOS
1625

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:
1928

20-
```bash
21-
cd ~/
22-
```
29+
```shell
30+
cd ~/
31+
```
2332

2433
1. Make a copy of the `.ipfs` directory:
2534

26-
```bash
27-
cp --recursive --verbose $([[ -z $(cp --help | grep "\-\-reflink" | head -n1) ]] || echo -n "--reflink=auto") .ipfs ipfs-backup
35+
```shell
36+
cp --recursive --verbose $([[ -z $(cp --help | grep "\-\-reflink" | head -n1) ]] || echo -n "--reflink=auto") .ipfs ipfs-backup
37+
```
38+
39+
This will output something like:
2840

29-
> '.ipfs' -> 'ipfs-backup'
30-
> '.ipfs/datastore_spec' -> 'ipfs-backup/data'
31-
> ...
32-
```
41+
```plaintext
42+
'.ipfs' -> 'ipfs-backup'
43+
'.ipfs/datastore_spec' -> 'ipfs-backup/data'
44+
...
45+
```
3346

34-
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.
3548
1. You now have a copy of your IPFS repository within the `ipfs-backup` folder.
3649

37-
### Windows
50+
#### Windows
3851

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`.
4356
1. Copy this folder to somewhere convenient like the `Desktop` and rename it to `ipfs-backup`.
4457
45-
## Restore installation
58+
### Restore installation
4659
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.
4861
49-
### Linux and macOS
62+
#### Linux and macOS
5063
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:
5366
54-
```bash
55-
cd ~/
56-
```
67+
```shell
68+
cd ~/
69+
```
5770
5871
1. Move your current IPFS repository to another folder. If something goes wrong you can restore your installation from here:
5972
60-
```bash
61-
mv .ipfs ipfs-old
62-
```
73+
```shell
74+
mv .ipfs ~/ipfs-old
75+
```
6376
6477
1. Move your backup IPFS repository to `.ipfs`:
6578
66-
```bash
67-
mv ipfs-backup .ipfs
68-
```
79+
```shell
80+
mv ipfs-backup ~/.ipfs
81+
```
6982
7083
1. Start an IPFS daemon:
7184
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+
```
8188
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:
8391
84-
```bash
85-
rm -rf .ipfs-old
86-
```
92+
```shell
93+
rm -rf .ipfs-old
94+
```
8795
88-
### Windows
96+
#### Windows
8997
9098
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`.
93101
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`.
95103
1. Rename the `.ipfs` folder to `ipfs-old`. We can restore from `ipfs-old` if anything goes wrong.
96104
1. Copy your `ipfs-backup` IPFS repository into your user's _home_ folder and rename it to `.ipfs`.
97105
1. Open the IPFS Desktop application or run `ipfs daemon` with Powershell. Everything should start, and your IPFS repository should restore normally.
98106
99-
## Windows Subsystem for Linux
107+
### Windows Subsystem for Linux
100108
101109
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.
102110
103111
1. On Windows, open the IPFS Desktop application or run an `ipfs daemon`. Do this at least once.
104112
1. Stop any IPFS daemons, services, or applications from running in your Linux and Windows environments.
105113
1. Copy your Linux IPFS repository to Windows. This process overwrites the IPFS repository in Windows:
106114
107-
```bash
108-
cp --recursive --verbose ~/.ipfs /mnt/c/Users/Your Username/
109-
```
115+
```shell
116+
cp --recursive --verbose ~/.ipfs /mnt/c/Users/Your Username/
117+
```
110118
111119
1. On Windows, open the IPFS Desktop application or run an `ipfs daemon`. Everything should open successfully.
112120
121+
## IPFS Desktop
122+
123+
Follow these steps to move your IPFS installation using the IPFS Desktop application.
124+
125+
1. Select the IPFS Desktop tray menu.
126+
127+
| Linux | MacOS | Windows |
128+
|---|---|---|
129+
| ![The IPFS tray icon in Ubuntu Linux.](./linux-ipfs-tray-icon.png) | ![The IPFS tray icon in MacOS.](./macos-ipfs-tray-icon.png) | ![The IPFS tray icon in Windows.](./windows-ipfs-tray-icon.png) |
130+
131+
1. Select **Advanced** → **Move Repository Location**.
132+
133+
| MacOS | Ubuntu | Windows |
134+
|---|---|---|
135+
| ![The advanced options IPFS tray menu in Ubuntu Linux.](./linux-advanced-options.png) | ![The advanced options IPFS tray menu in MacOS.](./macos-advanced-options.png) | ![The advanced options IPFS tray menu in Windows.](./windows-advanced-options.png) |
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+
113148
## Troubleshooting
114149
115150
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
120155

121156
If `ipfs daemon` doesn't run successfully then you can restore your old IPFS repository, assuming you made a copy:
122157
123-
```bash
158+
```shell
124159
mv .ipfs ipfs-backup-broken
125160
mv .ipfs-old .ipfs
126161
```
@@ -137,7 +172,7 @@ If you want to consolidate the two repositories, you can export the IPFS objects
137172

138173
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.
139174

140-
```bash
175+
```shell
141176
mkdir -p car_export
142177
cd car_export
143178
cids=$(ipfs refs local)
@@ -149,7 +184,7 @@ done
149184

150185
You should then be able to import those files into a new IPFS installation using a command like this:
151186

152-
```bash
187+
```shell
153188
cd car_export
154189
ipfs dag import *.car
155190
```
@@ -163,3 +198,4 @@ Make sure to open the IPFS Desktop application at least once before attempting t
163198
#### IPFS Desktop won't open
164199

165200
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/).
201+
79.7 KB
Loading
19.8 KB
Loading

0 commit comments

Comments
 (0)