|
1
|
ssh source.server.com tar c sourceDirectory | tar x
|
|
1
|
mongodump --db country
|
|
1
2
3
4
5
6
7
8
9
|
dump/
└── [4.3M] country
├── [2.1M] austria.bson
├── [ 87] austria.metadata.json
├── [2.1M] nigeria.bson
├── [ 87] nigeria.metadata.json
└── [ 140] system.indexes.bson
1 directory, 5 files
|
|
1
|
mongodump
|
|
1
2
3
4
5
6
7
8
9
10
11
12
|
├── [5.4M] dump
│ ├── [4.03M] country
│ │ ├── [2.1M] austria.bson
│ │ ├── [ 87] austria.metadata.json
│ │ ├── [2.1M] nigeria.bson
│ │ ├── [ 87] nigeria.metadata.json
│ │ └── [ 140] system.indexes.bson
│ └── [1.1M] product
│ ├── [1.0M] mongodump.bson
│ ├── [ 89] mongodump.metadata.json
│ └── [ 72] system.indexes.bson
2 directories, 8 files
|
|
1
|
mongodump --db country --collection nigeria --out -
|
|
1
|
mongodump --db country --archive=country.archive
|
|
1
|
-rw-rw-r-- 1 wisdom wisdom 4.2M Jun 29 11:12 country.archive
|
|
1
|
mongodump --db country --collection nigeria --archive=nga.archive
|
|
1
|
-rw-rw-r-- 1 wisdom wisdom 2.1M Jun 29 11:15 nga.archive
|
|
1
|
mongodump --archive=server.archive
|
|
1
|
-rw-rw-r-- 1 wisdom wisdom 5.3M Jun 29 11:26 server.archive
|
|
1
|
ssh wisdom@proxy.server.com mongodump --host source.server.com --archive | ssh wisdom@target.server.com mongorestore --archive
|
|
1
|
mongodump --db country --gzip
|
|
1
2
3
4
5
6
7
8
9
|
dump/
└── [568K] country
├── [254K] austria.bson.gz
├── [ 100] austria.metadata.json.gz
├── [254K] nigeria.bson.gz
├── [ 100] nigeria.metadata.json.gz
└── [ 91] system.indexes.bson.gz
1 directory, 5 files
|
|
1
|
mongodump --db country --gzip --archive=country.archive
|
|
1
|
-rw-rw-r-- 1 wisdom wisdom 509K Jun 29 11:23 country.archive
|
|
1
|
mongorestore --gzip
|
|
1
|
ssh wisdom@proxy.server.com mongodump --host source.server.com --archive --gzip | ssh wisdom@target.server.com mongorestore --archive --gzip
|