@echo off

set DBMT_HOME=..

set PATH=%PATH%;%DBMT_HOME%\java\lib\i386
set LOCALCLASSPATH=%CLASSPATH%
for %%i in ("%DBMT_HOME%\lib\*.jar") do call "%DBMT_HOME%\bin\lcp.bat" %%i
for %%j in ("%DBMT_HOME%\java\lib\*.jar") do call "%DBMT_HOME%\bin\lcp.bat" %%j

net stop "AppServer"
echo PubwinEP Service stopped

net stop "MySQL"
net stop "SQLSERVERAGENT"
net stop "MSSQLSERVER"
echo Pubwin Database stopped

net start "MySQL"
net start "MSSQLSERVER"
echo Pubwin Database restarted


rem -Xms512M -Xmx512M -cp %DBMT_HOME%;%LOCALCLASSPATH% com.hintsoft.dbmt.MigrationRunner ../conf/migration.xml
..\java\bin\javaw -Dcatalina.home=%DBMT_HOME% -Xms512M -Xmx512M -cp %DBMT_HOME%;%LOCALCLASSPATH% com.hintsoft.tools.exportReport.gui.ReportExportGui ../conf/migration.xml


echo data exported!

net stop "MySQL"
echo Pubwin Database stopped
