Dump or load with CouchDB - aegif/NemakiWare GitHub Wiki
-
<INSTALL_PATH>/setup/couchdb/bjornloka
is an maven project for dump/load of CouchDB. - In this project, there are simple Java applications with main method for dump/load.
##Initial Data
Official dump files for initialization are in <INSTALL_PATH>/setup/couchdb/initial_import
.
##Procedure
###Dump
Run jp.aegif.nemaki.bjornloka.Dump
with the following arguments.
Parameters(in this order):
Argument | Description |
---|---|
host | CouchDB host ex. 127.0.0.1 |
port | CouchDB port ex. 5984 |
repositoryId | Target CouchDB database name ex. bedroom |
filePath | Full path of dump destination file By default, timestamp will be attached to this filePath. |
omitTimestamp (optional) |
If this boolean flag is true, a dump file name has no attached timestamp. |
###Load
Run jp.aegif.nemaki.bjornloka.Load
with the following arguments.
Parameters(in this order):
Argument | Description |
---|---|
host | CouchDB host ex. 127.0.0.1 |
port | CouchDB port ex. 5984 |
repositoryId | Target CouchDB database name ex. bedroom |
filePath | Full path of a file to be loaded |
force (optional) |
When the target repository already exists, if this boolean flag is true, delete and recreate the repository with loaded data. |
###Interactive Setup
You can also all load dump files required for NemakiWare at the same time in the interactive mode on the terminal.
Run jp.aegif.nemaki.bjornloka.Setup
.
Of course it works with no arguments, it can also take the following arguments in this order.
Argument | Description |
---|---|
host | CouchDB host ex. 127.0.0.1 |
port | CouchDB port ex. 5984 |
mainRepositoryId | Target CouchDB database name(main) ex. bedroom |
archvieRepositoryId | Target CouchDB database name(main) ex. archive |
mainFilePath | Full path of a file to be loaded in the main repository |
archiveFilePath | Full path of a file to be loaded in the archive repository |
##Example
java -cp <path>/bjornloka.jar jp.aegif.nemaki.bjornloka.Load 127.0.0.1 5984 bedroom <path>/bedroom_init.dump true