2010-11-04 02:46:38 +07:00
|
|
|
#!/bin/sh
|
|
|
|
|
2020-09-09 00:37:00 +07:00
|
|
|
echo iDempiere PostgreSQL Database Export
|
2010-11-04 02:46:38 +07:00
|
|
|
|
|
|
|
# $Id: DBExport.sh,v 1.3 2005/01/22 21:59:15 jjanke Exp $
|
|
|
|
|
2020-09-09 00:37:00 +07:00
|
|
|
echo Saving database reference@"$ADEMPIERE_DB_NAME" to "$IDEMPIERE_HOME"/data/Adempiere_pg.dmp
|
2010-11-04 02:46:38 +07:00
|
|
|
|
2020-09-09 00:37:00 +07:00
|
|
|
if [ "$IDEMPIERE_HOME" = "" ] || [ "$ADEMPIERE_DB_NAME" = "" ] || [ "$ADEMPIERE_DB_SERVER" = "" ] || [ "$ADEMPIERE_DB_PORT" = "" ]
|
2010-11-04 02:46:38 +07:00
|
|
|
then
|
|
|
|
echo "Please make sure that the environment variables are set correctly:"
|
2012-06-06 21:13:34 +07:00
|
|
|
echo " IDEMPIERE_HOME e.g. /idempiere"
|
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"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
PGPASSWORD=reference
|
|
|
|
export PGPASSWORD
|
2020-09-09 00:37:00 +07:00
|
|
|
pg_dump -h "$ADEMPIERE_DB_SERVER" -p "$ADEMPIERE_DB_PORT" --no-owner -U reference "$ADEMPIERE_DB_NAME" > "$IDEMPIERE_HOME"/data/Adempiere_pg.dmp
|
2010-11-04 02:46:38 +07:00
|
|
|
PGPASSWORD=
|
|
|
|
export PGPASSWORD
|
|
|
|
|
2020-09-09 00:37:00 +07:00
|
|
|
cd "$IDEMPIERE_HOME"/data || exit
|
2010-11-04 02:46:38 +07:00
|
|
|
jar cvfM Adempiere_pg.jar Adempiere_pg.dmp
|