1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

crowi-plusサーバ移行

Last updated at Posted at 2018-07-08

volume mongoDBからexport

$ docker run --rm -v crowiplus_mongo_db:/data -v `pwd`/backup:/backup busybox sh -c 'tar -cOzf - /data' > volume-export_mongo_db.tgz

$ docker run --rm -v crowiplus_mongo_config:/data -v `pwd`/backup:/backup busybox sh -c 'tar -cOzf - /data' > volume-export_mongo_configdb.tgz

$ docker run --rm -v crowiplus_crowi_data:/data -v `pwd`/backup:/backup busybox sh -c 'tar -cOzf - /data' > volume-export_crowi_data.tgz

$ docker run --rm -v crowiplus_redis_data:/data -v `pwd`/backup:/backup busybox sh -c 'tar -cOzf - /data' > volume-export_redis_data.tgz

volume mongoDBからimport

$ docker run -v crowi-plus_mongo_db:/data -v `pwd`:/import -e TARGETFILE=volume-export_mongo_db.tgz 74th/volumerestore
$ docker run -v crowi-plus_mongo_config:/data -v `pwd`:/import -e TARGETFILE=volume-export_mongo_configdb.tgz 74th/volumerestore
$ docker run -v crowi-plus_crowi_data:/data -v `pwd`:/import -e TARGETFILE=volume-export_crowi_data.tgz 74th/volumerestore
$ docker run -v crowi-plus_redis_data:/data -v `pwd`:/import -e TARGETFILE=volume-export_redis_data.tgz 74th/volumerestore

mongoDB

mongodump --archive=/tmp/corwi.20180710.gz --gzip --db crowi
# コンテナIDを調べる
$ sudo docker ps

$ sudo docker cp <コンテナID>:/etc/my.cnf my.cnf
docker exec -it crowi-plus_mongo_1 bash 
mongorestore --gzip --archive=/tmp/crowi.20180710.gz --db crowi

mongoDB
https://qiita.com/yuji0602/items/c55e2cb75376fd565b4e

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?