Skip to content

Commit 6893114

Browse files
Merge pull request #1143 from ipfs/add/cli-vs-desktop-difference
Add/cli vs desktop difference ciskip
2 parents 68eb0eb + 44cce07 commit 6893114

File tree

9 files changed

+3523
-17036
lines changed

9 files changed

+3523
-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
{
140 KB
Loading
95.9 KB
Loading

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

Lines changed: 108 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,115 +1,164 @@
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+
```
2838

29-
> '.ipfs' -> 'ipfs-backup'
30-
> '.ipfs/datastore_spec' -> 'ipfs-backup/data'
31-
> ...
32-
```
39+
This will output something like:
3340

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.
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.
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
85+
```shell
86+
ipfs daemon
87+
```
7488
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:
8191
82-
1. If everything is working fine, you can delete your old IPFS repository:
92+
```shell
93+
rm -rf .ipfs-old
94+
```
8395
84-
```bash
85-
rm -rf .ipfs-old
86-
```
87-
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.](./ubuntu-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+
| Linux | MacOS | Windows |
134+
|---|---|---|
135+
| ![The advanced options IPFS tray menu in Ubuntu Linux.](./ubuntu-advanced-options-menu.png) | ![The advanced options IPFS tray menu in MacOS.](./macos-advanced-options-menu.png) | ![The advanced options IPFS tray menu in Windows.](./windows-advanced-options-menu.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+
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:
155+
156+
```powershell
157+
mklink "C:\New IPFS Repo" "C:\Windows\Users\YOUR_USERNAME\.ipfs\"
158+
```
159+
160+
Make sure to replace `YOUR_USERNAME` with the name of the user you are currently logged in as.
161+
113162
## Troubleshooting
114163
115164
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
120169

121170
If `ipfs daemon` doesn't run successfully then you can restore your old IPFS repository, assuming you made a copy:
122171
123-
```bash
172+
```shell
124173
mv .ipfs ipfs-backup-broken
125174
mv .ipfs-old .ipfs
126175
```
@@ -137,7 +186,7 @@ If you want to consolidate the two repositories, you can export the IPFS objects
137186

138187
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.
139188

140-
```bash
189+
```shell
141190
mkdir -p car_export
142191
cd car_export
143192
cids=$(ipfs refs local)
@@ -149,7 +198,7 @@ done
149198

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

152-
```bash
201+
```shell
153202
cd car_export
154203
ipfs dag import *.car
155204
```
@@ -163,3 +212,4 @@ Make sure to open the IPFS Desktop application at least once before attempting t
163212
#### IPFS Desktop won't open
164213

165214
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/).
215+
59.6 KB
Loading
14.1 KB
Loading
40 KB
Loading
27.3 KB
Loading

0 commit comments

Comments
 (0)