Alien
Alien

Reputation: 109

How to clear Module database in MarkLogic

What is the gradle task to clear all modules in a MarkLogic database?

I have tried mlClearDatabase, but it didn't work.

Upvotes: 1

Views: 214

Answers (2)

Mads Hansen
Mads Hansen

Reputation: 66783

mlClearDatabase will clear the content database.

The task that you are looking for to clear the modules database is:

mlClearModulesDatabase - if the application exists, clear its modules database; otherwise do nothing

If you are clearing the modules in order to ensure that you are deploying to a fresh modules database, then you might want to use mlReloadModules, which will invoke mlClearModules and then mlLoadModules.

https://github.com/marklogic-community/ml-gradle/wiki/Task-reference#modules

Upvotes: 1

Fiona Chen
Fiona Chen

Reputation: 1368

mlClearModulesDatabase

gradle doesn't gurantee complete Modules database cleanup if other App server has dependency on that Modules database

mlClearDatabase -Pdatabase={db-name} -Pconfirm=true

gradle will clear the said database in force mode, for that reason, -Pconfirm=true is used. If other App servers have dependency on the cleared Modules database, your application will fail.

It is very true that mlReloadModules is the right way to deploy/redeploy modules.

Upvotes: 0

Related Questions