2007-04-13 07:11:06 +07:00
|
|
|
@Echo ADEMPIERE Database Export $Revision: 1.2 $
|
|
|
|
|
|
|
|
@Rem $Id: DBExport.bat,v 1.2 2005/01/22 21:59:15 jjanke Exp $
|
|
|
|
|
|
|
|
@Echo Saving database %1@%ADEMPIERE_DB_NAME% to %ADEMPIERE_HOME%\data\ExpDat.dmp
|
|
|
|
|
|
|
|
@if (%ADEMPIERE_HOME%) == () goto environment
|
|
|
|
@if (%ADEMPIERE_DB_NAME%) == () goto environment
|
2008-08-23 02:57:53 +07:00
|
|
|
@if (%ADEMPIERE_DB_SERVER%) == () goto environment
|
|
|
|
@if (%ADEMPIERE_DB_PORT%) == () goto environment
|
2007-04-13 07:11:06 +07:00
|
|
|
@Rem Must have parameter: userAccount
|
|
|
|
@if (%1) == () goto usage
|
|
|
|
|
2007-09-05 15:01:55 +07:00
|
|
|
@set PGPASSWORD=%2
|
2008-08-23 02:57:53 +07:00
|
|
|
pg_dump -h %ADEMPIERE_DB_SERVER% -p %ADEMPIERE_DB_PORT% -U %1 %ADEMPIERE_DB_NAME% > %ADEMPIERE_HOME%\data\ExpDat.dmp
|
2007-09-05 15:01:55 +07:00
|
|
|
@set PGPASSWORD=
|
2007-04-13 07:11:06 +07:00
|
|
|
|
|
|
|
@cd %ADEMPIERE_HOME%\Data
|
|
|
|
@jar cvfM ExpDat.jar ExpDat.dmp
|
|
|
|
|
|
|
|
@goto end
|
|
|
|
|
|
|
|
:environment
|
|
|
|
@Echo Please make sure that the enviroment variables are set correctly:
|
|
|
|
@Echo ADEMPIERE_HOME e.g. D:\ADEMPIERE2
|
2008-08-23 02:57:53 +07:00
|
|
|
@Echo ADEMPIERE_DB_NAME e.g. adempiere or xe
|
|
|
|
@Echo ADEMPIERE_DB_SERVER e.g. dbserver.adempiere.org
|
|
|
|
@Echo ADEMPIERE_DB_PORT e.g. 5432 or 1521
|
2007-04-13 07:11:06 +07:00
|
|
|
|
|
|
|
:usage
|
|
|
|
@echo Usage: %0 <userAccount>
|
|
|
|
@echo Examples: %0 ADEMPIERE/ADEMPIERE
|
|
|
|
|
|
|
|
:end
|