Skip to content

Commit

Permalink
*: remove migration related stuff from 2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
xiang90 committed Aug 1, 2015
1 parent eee1c8b commit 2b8abeb
Show file tree
Hide file tree
Showing 19 changed files with 2 additions and 2,302 deletions.
43 changes: 0 additions & 43 deletions Documentation/backward_compatibility.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,49 +24,6 @@ https://github.com/coreos/etcd/blob/master/Documentation/configuration.md.

The default data dir location has changed from {$hostname}.etcd to {name}.etcd.

## Data Directory Migration

The disk format within the data directory changed with etcd 2.0.
If you run etcd 2.0 on an etcd 0.4 data directory it will automatically migrate the data and start.
You will want to coordinate this upgrade by walking through each of your machines in the cluster, stopping etcd 0.4 and then starting etcd 2.0.
If you would rather manually do the migration, to test it out first in another environment, you can use the [migration tool doc][migrationtooldoc].

[migrationtooldoc]: https://github.com/coreos/etcd/blob/master/tools/etcd-migrate/README.md

## Snapshot Migration

If you are only interested in the data in etcd you can migrate a snapshot of your data from a v0.4.9+ cluster into a new etcd 2.0 cluster using a snapshot migration.
The advantage of this method is that you are directly dumping only the etcd data so you can run your old and new cluster side-by-side, snapshot the data, import it and then point your applications at this cluster.
The disadvantage is that the etcd indexes of your data will change which may confuse applications that use etcd.

To get started get the newest data snapshot from the 0.4.9+ cluster:

```
curl http://cluster.example.com:4001/v2/migration/snapshot > backup.snap
```

Now, import the snapshot into your new cluster:

```
etcdctl -C new_cluster.example.com import --snap backup.snap
```

If you have a large amount of data, you can specify more concurrent works to copy data in parallel by using `-c` flag.
If you have hidden keys to copy, you can use `--hidden` flag to specify.

And the data will quickly copy into the new cluster:

```
entering dir: /
entering dir: /foo
entering dir: /foo/bar
copying key: /foo/bar/1 1
entering dir: /
entering dir: /foo2
entering dir: /foo2/bar2
copying key: /foo2/bar2/2 2
```

## Key-Value API

### Read consistency flag
Expand Down
9 changes: 0 additions & 9 deletions etcdserver/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import (
"path"

pb "github.com/coreos/etcd/etcdserver/etcdserverpb"
"github.com/coreos/etcd/migrate"
"github.com/coreos/etcd/pkg/pbutil"
"github.com/coreos/etcd/pkg/types"
"github.com/coreos/etcd/raft/raftpb"
Expand Down Expand Up @@ -109,14 +108,6 @@ func readWAL(waldir string, snap walpb.Snapshot) (w *wal.WAL, id, cid types.ID,
// It must ensure that, after upgrading, the most recent version is present.
func upgradeDataDir(baseDataDir string, name string, ver version.DataDirVersion) error {
switch ver {
case version.DataDir0_4:
plog.Infof("converting v0.4 log to v2.0")
err := migrate.Migrate4To2(baseDataDir, name)
if err != nil {
plog.Fatalf("failed to migrate data-dir (%v)", err)
return err
}
fallthrough
case version.DataDir2_0:
err := makeMemberDir(baseDataDir)
if err != nil {
Expand Down
112 changes: 0 additions & 112 deletions migrate/cmd/etcd-dump-logs/main.go

This file was deleted.

53 changes: 0 additions & 53 deletions migrate/config.go

This file was deleted.

Loading

0 comments on commit 2b8abeb

Please sign in to comment.