The opFlow CLI provides methods to reset the database.
Stop the relevant services:
Code Block | ||
---|---|---|
| ||
service opflowd stop service omkd stop |
Drop and Prime the Database
By default, all opFlow data is stored in a database named 'flows', this is configurable and opCommon.nmis has this setting which defines the dbname used 'opflow_db_name' => "flows".
...
Remove all data, start from scratch. (See note above regarding db size)
# drop and re-create with correct size
/usr/local/omk/bin/opflow-cli
.pl act=setup-db drop=
true
# add auth to new db
/usr/local/omk/bin/setup_mongodb
.pl
Drop flow/conversation data, keep all other data.
First Back up data to keep
Code Block language bash # Replace the username and password appropriately mongodump -u opUserRW -p op42flow42 -d flows -c customapps -o . mongodump -u opUserRW -p op42flow42 -d flows -c endpoints -o . mongodump -u opUserRW -p op42flow42 -d flows -c filters -o . mongodump -u opUserRW -p op42flow42 -d flows -c iana -o . mongodump -u opUserRW -p op42flow42 -d flows -c report_data -o .
Drop the database and re-create it. (See note above regarding db size)
Code Block language bash # drop and re-create with correct size /usr/local/omk/bin/opflow-cli.pl act=setup-db drop=true # add auth to new db /usr/local/omk/bin/setup_mongodb.pl
Restore data
Code Block language bash /usr/local/mongodb/bin/mongorestore -u opUserRW -p op42flow42 -d flows -c customapps customapps.bson /usr/local/mongodb/bin/mongorestore -u opUserRW -p op42flow42 -d flows -c endpoints endpoints.bson /usr/local/mongodb/bin/mongorestore -u opUserRW -p op42flow42 -d flows -c filters filters.bson /usr/local/mongodb/bin/mongorestore -u opUserRW -p op42flow42 -d flows -c iana iana.bson /usr/local/mongodb/bin/mongorestore -u opUserRW -p op42flow42 -d flows -c report_data report_data.bson
Last step
Start all daemons back up.
...