Maintenance(Database) - aegif/NemakiWare GitHub Wiki
English/日本語
<INSTALL_PATH>/setup/couchdb/bjornloka.jar
This tool dumps all data from CouchDB in JSON format and loads such data to the database.
java -cp bjornloka.jar jp.aegif.nemaki.bjornloka.Dump <host_address> <db_port> <repository_id> <dump_file_path> <time_stamp_flag>
host_address: for example, 127.0.0.1
db_port: for example, 5984
repository_id: for example, bedroom
dump_file_path: the path to a target file
time_stamp_flag: (optional) defaults to true. If it's false, time stamp suffix is not attached to the dump file.
So, the command will be like:
java -cp bjornloka.jar jp.aegif.nemaki.bjornloka.Dump 127.0.0.1 5984 bedroom ~/Desktop/dump
java -cp bjornloka/target/bjornloka.jar jp.aegif.nemaki.bjornloka.Load <host_address> <db_port> <repository_id> <dump_file_path> <overwrite_flag>
host_address: for example, 127.0.0.1
db_port: for example, 5984
repository_id: for example, bedroom
dump_file_path: the path of a source file to load
overwrite_flag: (optional) defaults to false. If it's true, overwrite CouchDB database which has the same name as <repository_id>
So, the command will be like:
java -cp bjornloka/target/bjornloka.jar jp.aegif.nemaki.bjornloka.Load 127.0.0.1 5984 bedroom ~/Desktop/dump true
Load initialization data using the dump/load tool.
Initialization data are:
<INSTALL_PATH>/setup/couchdb/initial_import/bedroom_init.dump
<INSTALL_PATH>/setup/couchdb/initial_import/archive_init.dump
java -cp bjornloka/target/bjornloka.jar jp.aegif.nemaki.bjornloka.Load <host_address> <db_port> <repository_id> bedroom_init.dump true
- repository_id is by default
bedroom
.
java -cp bjornloka/target/bjornloka.jar jp.aegif.nemaki.bjornloka.Load <host_address> <db_port> <repository_id> archive_init.dump true
- repository_id is by default
archive
.
If you ever need to remove all data and come back to the state that existed after installing NemakiWare for the first time, do the following:
cd setup/couchdb
java -jar bjornloka.jar
[Answer the questions about your server, default values are good for a default install]
Import file(main):]: initial_import/bedroom_init.dump
Import file(archive):]: initial_import/archive_init.dump
Inline example: java -jar bjornloka.jar http://127.0.0.1:5984 bedroom bedroom_closet initial_import/bedroom_init.dump initial_import/archive_init.dump
Then restart NemakiWare.
http://localhost:5984/_utils/