2006-12-28 15:33:33 +07:00
|
|
|
# $Id: ImportAdempiere.sh,v 1.10 2005/12/20 07:12:17 jjanke Exp $
|
|
|
|
echo Adempiere Database Import $Revision: 1.10 $
|
2006-11-17 10:14:43 +07:00
|
|
|
|
|
|
|
echo Importing Adempiere DB from $ADEMPIERE_HOME/data/Adempiere.dmp
|
|
|
|
|
|
|
|
if [ $# -le 2 ]
|
|
|
|
then
|
|
|
|
echo "Usage: $0 <systemAccount> <AdempiereID> <AdempierePWD>"
|
|
|
|
echo "Example: $0 system/manager adempiere adempiere"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
if [ "$ADEMPIERE_HOME" = "" -o "$ADEMPIERE_DB_NAME" = "" ]
|
|
|
|
then
|
|
|
|
echo "Please make sure that the environment variables are set correctly:"
|
|
|
|
echo " ADEMPIERE_HOME e.g. /Adempiere"
|
|
|
|
echo " ADEMPIERE_DB_NAME e.g. adempiere.adempiere.org"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
echo -------------------------------------
|
2006-12-28 15:33:33 +07:00
|
|
|
echo Recreate user and database
|
2006-11-17 10:14:43 +07:00
|
|
|
echo -------------------------------------
|
2006-12-28 15:33:33 +07:00
|
|
|
dropdb -U postgres $ADEMPIERE_DB_NAME
|
|
|
|
|
|
|
|
dropuser -U postgres $ADEMPIERE_DB_USER
|
|
|
|
|
2007-04-13 07:11:06 +07:00
|
|
|
createuser -U postgres -a -d $ADEMPIERE_DB_USER -P
|
2006-12-28 15:33:33 +07:00
|
|
|
|
|
|
|
createdb $ADEMPIERE_DB_NAME -E UNICODE -O $ADEMPIERE_DB_USER -U $ADEMPIERE_DB_USER
|
2006-11-17 10:14:43 +07:00
|
|
|
|
|
|
|
echo -------------------------------------
|
2006-12-28 15:33:33 +07:00
|
|
|
echo Import Adempiere_pg.dmp
|
2006-11-17 10:14:43 +07:00
|
|
|
echo -------------------------------------
|
2006-12-28 15:33:33 +07:00
|
|
|
psql -d $ADEMPIERE_DB_NAME -U $ADEMPIERE_DB_USER -f $ADEMPIERE_HOME/data/Adempiere_pg.dmp
|
2006-11-17 10:14:43 +07:00
|
|
|
|
|
|
|
echo -------------------------------------
|
2006-12-28 15:33:33 +07:00
|
|
|
echo Create SQLJ
|
2006-11-17 10:14:43 +07:00
|
|
|
echo -------------------------------------
|
2006-12-28 15:33:33 +07:00
|
|
|
# $ADEMPIERE_HOME/utils/$ADEMPIERE_DB_PATH/create.sh $ADEMPIERE_DB_USER/$ADEMPIERE_DB_PASSWORD
|