2010-11-04 02:46:38 +07:00
|
|
|
@Echo ADEMPIERE Database Export $Revision: 1.2 $
|
|
|
|
|
|
|
|
@Rem $Id: DBExport.bat,v 1.2 2005/01/22 21:59:15 jjanke Exp $
|
|
|
|
|
2012-06-06 21:13:34 +07:00
|
|
|
@Echo Saving database %1@%ADEMPIERE_DB_NAME% to %IDEMPIERE_HOME%\data\ExpDat.dmp
|
2010-11-04 02:46:38 +07:00
|
|
|
|
2012-06-06 21:13:34 +07:00
|
|
|
@if (%IDEMPIERE_HOME%) == () goto environment
|
2010-11-04 02:46:38 +07:00
|
|
|
@if (%ADEMPIERE_DB_NAME%) == () goto environment
|
|
|
|
@if (%ADEMPIERE_DB_SERVER%) == () goto environment
|
|
|
|
@if (%ADEMPIERE_DB_PORT%) == () goto environment
|
|
|
|
@Rem Must have parameter: userAccount
|
|
|
|
@if (%1) == () goto usage
|
|
|
|
|
|
|
|
@set PGPASSWORD=%2
|
2012-06-06 21:13:34 +07:00
|
|
|
pg_dump -h %ADEMPIERE_DB_SERVER% -p %ADEMPIERE_DB_PORT% -U %1 %ADEMPIERE_DB_NAME% > %IDEMPIERE_HOME%\data\ExpDat.dmp
|
2010-11-04 02:46:38 +07:00
|
|
|
@set PGPASSWORD=
|
|
|
|
|
2012-06-06 21:13:34 +07:00
|
|
|
@cd %IDEMPIERE_HOME%\Data
|
2010-11-04 02:46:38 +07:00
|
|
|
@jar cvfM ExpDat.jar ExpDat.dmp
|
|
|
|
|
|
|
|
@goto end
|
|
|
|
|
|
|
|
:environment
|
|
|
|
@Echo Please make sure that the enviroment variables are set correctly:
|
2012-06-06 21:13:34 +07:00
|
|
|
@Echo IDEMPIERE_HOME e.g. D:\ADEMPIERE2
|
2010-11-04 02:46:38 +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
|
|
|
|
|
|
|
|
:usage
|
|
|
|
@echo Usage: %0 <userAccount>
|
|
|
|
@echo Examples: %0 ADEMPIERE/ADEMPIERE
|
|
|
|
|
|
|
|
:end
|