ipfs / ipfs/kubo

`ipfs repo copy`: a way to move everything to different repo (config, pins, mfs, all blocks)

Open
#10,938 0 comments 0 reactions 0 assignees View on GitHub
kind/feature P2
Dominant language
Go
Stars
17.1k
Forks
3.2k
Avg merge
3d 18h
Merged PRs (30d)
11

Description

### Checklist

- [x] My issue is specific & actionable.
- [x] I am not suggesting a protocol enhancement.
- [x] I have searched on the [issue tracker](https://github.com/ipfs/kubo/issues?q=is%3Aissue) for my issue.

### Description

Right now, moving to new repo is tedious, user needs to manually:
- move pins
- move mfs
- preload local blocks to other node
- (optionally) move identity, config

Example:
- user is running legacy badgerv1 datastore, and they would like to move all their data to a fresh node
- user is running ipfs-cluster without GC, and would like manually do a spring cleaning and drop unpinned blocks by moving only the currently pinned data to the new repo.

## Solution

Would be good to have CLI for this that that takes target repo path or RPC port and performs export/import between two Kubo instances.

Copy to repote RPC (online, over HTTP)
```console
$ ipfs repo copy /ip4/127.0.0.1/tcp/5002
```

Copy to local repo (offline, direct filesystem access)
```console
$ ipfs repo copy /path/to/new/repo
```

And ability to specify what to include/exclude (by default we don't migrate config):

```console
$ ipfs repo copy --pins=true --mfs=true --config=false --identity=false --all-blocks=true
```

- `pins` migrates `ipfs pin ls --names -t recursive` (migrate pins and their name/type + preload)
- `mfs` migrates `ipfs files ls / -l` (lazy, no preload, or walk and only preload things that were already preloaded on old node)
- `all-blocks` migrates (preloads) all blocks from blockstore `ipfs refs local`
- `ipns` (false by default) ipns keys and last verisons of published records
- `config` (false by default) config TBD (all? only peering/routing/remote pinnignservices
- `identity` (false by default) warn that its dangerous

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.