Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagebash
titleExample for Exporting
linenumberstrue
# export database to .zip archive file that holds the script.sql file
./operate-h2.sh export --url="/var/sos-berlin.com/js7/joc/resources/joc/h2/joc" --user=joc --file=/tmp/database-export.zip --zip

# export database to .zipsql archivetext file with up to 3 versions
./operate-h2.sh export --url="/var/sos-berlin.com/js7/joc/resources/joc/h2/joc" --user=joc --file=/tmp/database-export.zip sql--file-versions=3

# export database from a docker container to a .zip archive stored on a volume
docker exec -ti js7-saas-2-7-2 /bin/bash \
    /opt/sos-berlin.com/js7/script/operate-h2.sh export \
    --classpath=/var/sos-berlin.com/js7/joc/lib/ext/joc/h2-2.3.232.jar \
    --url="/var/sos-berlin.com/js7/joc/resources/joc/h2/joc;AUTO_SERVER=TRUE" \
    --user=joc \
    --file=/var/sos-berlin.com/js7/joc/resources/joc/database-export.zip \
    --file-versions=3 --zip



Code Block
languagebash
titleExample for Importing
linenumberstrue
 # step 1: shutdown JOC Cockpit
/opt/sos-berlin.com/js7/joc/jetty/bin/jetty.sh stop

 # step 2: (re)move existing database
cd /var/sos-berlin.com/js7/joc/resources/joc
mv h2 h2.backup
mkdir h2

# step 3: unzipimport archivedatabase filefrom to.zip extract the resulting script.sql file
unzip -d /tmp archive file
./operate-h2.sh import --url="/var/sos-berlin.com/js7/joc/resources/joc/h2/joc" --user=joc --file=/tmp/database-export.zip --zip

# step 43: perform import, thedatabase databasefrom is.sql automaticallytext createdfile
./operate-h2.sh import --url="/var/sos-berlin.com/js7/joc/resources/joc/h2/joc" --user=joc --file=/tmp/scriptdatabase-export.sql

# step 54: start JOC Cockpit
/opt/sos-berlin.com/js7/joc/jetty/bin/jetty.sh start

...