Migrations for the filesystem repository of ipfs nodes
These are migrations for the filesystem repository of ipfs nodes. Each migration builds a separate binary that converts a repository to the next version. The fs-repo-migrations
is a tool that downloads individual migrations from the ipfs distribution site and applies them in sequence to migrate the ipfs repository to the target version. This tool is written in Go, and developed alongside go-ipfs.
make install
When you want to upgrade go-ipfs to a new version, you may need to migrate.
Here is the table showing which repo version corresponds to which go-ipfs version:
ipfs repo version | go-ipfs versions |
---|---|
1 | 0.0.0 - 0.2.3. |
2 | 0.3.0 - 0.3.11 |
3 | 0.4.0 - 0.4.2 |
4 | 0.4.3 - 0.4.5 |
5 | 0.4.6 - 0.4.10 |
6 | 0.4.11 - 0.4.15 |
7 | 0.4.16 - 0.4.23 |
8 | 0.5.0 - 0.6.0 |
9 | 0.5.0 - 0.6.0 |
10 | 0.6.0 - 0.7.0 |
11 | 0.8.0 - current |
Please see the migration run guide here.
Migrations are one of those things that can be extremely painful on users. At the end of the day, we want users never to have to think about it. The process should be:
- SAFE. No data lost. Ever.
- Revertible. Tools must implement forward and backward migrations.
- Frozen. After the tool is written, all code must be frozen and vendored.
- To Spec. The tools must conform to the spec.
To create a new migration, create a go module in a directory named fs-repo-X-to-Y
, where X
is the repo "from" version and Y
the repo "to" version. Vendor the module's dependencies. The build tooling will find this module and build the migration binary.
If the migration directory contains a subdirectory named sharness
, tests contained in it are run using the sharness test tool. Tests must be named tNNNN-*.sh
, where NNNN is a 4-digit sequence number.
Dependencies must be vendored independently for each migration. Each migration is a separate go module with its own vendor
directory (created with go mod vendor
for that migration). All migrations are built using go build -mod=vendor
to ensure dependencies come from the module's vendor
directory.
Feel free to join in. All welcome. Open an issue!
This repository falls under the IPFS Code of Conduct.
MIT