Helper linux scripts to generate iDempiere seed - just useful for release, not for backup

This commit is contained in:
Carlos Ruiz 2018-11-14 14:45:40 -02:00
parent 19fed8e7fd
commit 4ef7c629f4
2 changed files with 26 additions and 9 deletions

View File

@ -1,10 +1,13 @@
#!/bin/sh
#
# $Id: RUN_ImportReference.sh,v 1.11 2005/12/13 00:17:54 jjanke Exp $
# Author + Copyright 1999-2005 Jorg Janke
# $Id: RUN_DBExport.sh,v 1.10 2005/05/31 18:45:33 jjanke Exp $
if [ $IDEMPIERE_HOME ]; then
cd $IDEMPIERE_HOME/utils
fi
. ./myEnvironment.sh Server
echo Export Reference - $IDEMPIERE_HOME \($ADEMPIERE_DB_NAME\)
sh $ADEMPIERE_DB_PATH/ExportReference.sh
echo Export idempiere Database - $IDEMPIERE_HOME \($ADEMPIERE_DB_NAME\)
# Parameter: <adempiereDBuser>/<adempiereDBpassword>
sh $ADEMPIERE_DB_PATH/ExportReference.sh $ADEMPIERE_DB_USER $ADEMPIERE_DB_PASSWORD system/$ADEMPIERE_DB_SYSTEM

View File

@ -1,21 +1,35 @@
#!/bin/sh
echo Adempiere Database Export $Revision: 1.5 $
echo Adempiere Database Export $Revision: 1.5 $
# $Id: DBExport.sh,v 1.5 2005/12/20 07:12:17 jjanke Exp $
# $Id: ExportReference.sh,v 1.5 2005/12/20 07:12:17 jjanke Exp $
echo Saving reference database reference@$ADEMPIERE_DB_NAME to $IDEMPIERE_HOME/data/Adempiere.dmp
if [ "$IDEMPIERE_HOME" = "" -o "$ADEMPIERE_DB_NAME" = "" ]
then
echo "Please make sure that the environment variables are set correctly:"
echo " IDEMPIERE_HOME e.g. /idempiere"
echo " ADEMPIERE_DB_NAME e.g. adempiere.adempiere.org"
echo " IDEMPIERE_HOME e.g. /idempiere"
echo " ADEMPIERE_DB_NAME e.g. adempiere.adempiere.org"
exit 1
fi
sqlplus $3@$ADEMPIERE_DB_SERVER:$ADEMPIERE_DB_PORT/$ADEMPIERE_DB_NAME <<!
alter session set "_enable_rename_user"=true;
alter system enable restricted session;
ALTER USER $1 RENAME TO REFERENCE IDENTIFIED BY "$2";
alter system disable restricted session;
!
# Export
exp reference/reference@$ADEMPIERE_DB_SERVER:$ADEMPIERE_DB_PORT/$ADEMPIERE_DB_NAME FILE=$IDEMPIERE_HOME/data/Adempiere.dmp Log=$IDEMPIERE_HOME/data/Adempiere.log CONSISTENT=Y OWNER=reference
expdp REFERENCE/$2@$ADEMPIERE_DB_SERVER:$ADEMPIERE_DB_PORT/$ADEMPIERE_DB_NAME DIRECTORY=ADEMPIERE_DATA_PUMP_DIR DUMPFILE=Adempiere.dmp LOGFILE=Adempiere.log EXCLUDE=STATISTICS SCHEMAS=REFERENCE
sqlplus $3@$ADEMPIERE_DB_SERVER:$ADEMPIERE_DB_PORT/$ADEMPIERE_DB_NAME <<!
alter session set "_enable_rename_user"=true;
alter system enable restricted session;
ALTER USER REFERENCE RENAME TO $1 IDENTIFIED BY "$2";
alter system disable restricted session;
!
cd $IDEMPIERE_HOME/data
jar cvfM Adempiere.jar Adempiere.dmp Adempiere.log