Repo ninja command line tool was removed from MidPoint 3.7. It's replaced by new tool called just ninja. See this for details.
Repo Ninja is a tool designated to help MidPoint administrators with repository initialization and validation. It also allows to export and import repository data as XML objects even when the application is not running.
The midPoint binary distribution packages (
midpoint-X.X-dist.tar.bz2) contain the binary distribution of "Repo Ninja" utility. Just unzip/untar the file and edit the "
bin/repo-ninja.bat") script and fix the "
MIDPOINT_HOME" variable to point to your "
midpoint.home" location. Save the script and run it.
When extracting repo-ninja-3.1-SNAPSHOT-bin.zip file in */midpoint-home/bin, check repo-ninja.bat file, which content has to be following (please set your own path for midpoint-home):
rem Change the following line!
rem Sets the basedir to the directory where libraries are located
java -classpath "%BASEDIR%\lib\*" -Dmidpoint.home=%MIDPOINT_HOME% com.evolveum.midpoint.tools.ninja.Main %*
and also check repo-ninja file which content should be following:
exec java -classpath "$BASEDIR/lib/*" -Dmidpoint.home=$MIDPOINT_HOME com.evolveum.midpoint.tools.ninja.Main $*
Also verify up to date repo-ninja driver version in *\midpoint-home\lib such as repo-ninja-3.1-SNAPSHOT.jar (has to be only one version in lib file because of mismatch risk).
The script is provided mainly for restoring your previously-backed up repository (execute script when tomcat is turned off):
Linux: ./repo-ninja -i /var/tmp/backup.xml Windows: *\midpoint-home\bin>repo-ninja.bat -i *\Downloads\export.xml
If for whatever reason you don't want to run Repo Ninja from distribution package, you can also run it as a runnable JAR archive. After build from sources the jar is located it
tools/repo-ninja/target/release/repo-ninja-*.jar. Use a command similar to the following to run it:
java -jar tools/repo-ninja/target/release/repo-ninja-2.2-SNAPSHOT.jar
lib directory with all of its content is also needed to run the ninja. If you are transferring ninja to another machine be sure to get the main
jar and also the
lib directory and all the jars inside.
Tip: there is a execution script located in
Repo Ninja is still an experimental tool. It needs a lot of knowledge about the system and lot of trickery to use. Use it carefully.
The following options and examples document the usage of Repo Ninja.
-v -Dmidpoint.home=<midpoint configuration folder>
<hibernateHbm2ddl> option in config.xml in MidPoint configuration should be set to validate.
Ninja tries to load spring contexts with Repository service. This operation finishes with SUCCESS (if connection to database and database schema looks right) or FAILURE.
-c <file> to execute create database schema DDL script which you can find on [midPoint:Repository Configuration] page. -d <driver class name> -P <jdbc password prompt> -p <jdbc password> -U <jdbc username> -u <jdbc url>
-e <file> -Dmidpoint.home=<midpoint configuration folder>
-i <file> -Dmidpoint.home=<midpoint configuration folder>
Escape semicolon ';' in option jdbc url, for example: