Skip to content

Latest commit

 

History

History
81 lines (61 loc) · 3 KB

update.md

File metadata and controls

81 lines (61 loc) · 3 KB

update postgres and wildfly from previous version

from chouette 3.3.x or less

Old reports are not accessible with 3.4 and above versions

clean all import, export and validation results :

  • stop wildfly
  • connect on iev database with psql
delete from links;
delete from jobs;
exit;
  • clean iev repository :
rm /var/lib/chouette/iev/referentials/*

from chouette 3.0.x or 3.1.x

Postgres : install postgis 2.1+ with: sudo apt-get install postgresql-9.3-postgis-2.1

Rails (chouette2) launch the command below:

bundle exec rake db:gis:setup
bundle exec rake db:migrate

Wildfly : install and activate postgis and hibernate spatial modules : (commands are launched from wildfly deployment folder)

Step 1 : remove old modules, datasources and chouette_iev ear

sudo bin/jboss-cli.sh
connect
undeploy chouette.ear
data-source remove --name=chouette
data-source remove --name=iev
/subsystem=datasources/jdbc-driver=postgres:remove
/subsystem=datasources/jdbc-driver=postgresql:remove
module remove --name=org.postgres
exit

Step 2 : stop wildfly server

Step 3 : download jars for postgres and hibernate modules in temporary folder (/tmp for following commands)

postgis version 2.1.7.2

hibernate-spatial version 4.3

JTS model version 1.13

Step 4 : add hibernate spatial extension to hibernate module

sudo cp /tmp/hibernate-spatial-4.3.jar /tmp/jts-1.13.jar modules/system/layers/base/org/hibernate/main/.
sudo mv modules/system/layers/base/org/hibernate/main/module.xml modules/system/layers/base/org/hibernate/main/module.xml.bak
sudo sed -e '/<resources>/a         <resource-root path="hibernate-spatial-4.3.jar"/>
/<resources>/a         <resource-root path="jts-1.13.jar"/>
/<dependencies>/a        <module name="org.postgres"/>' <modules/system/layers/base/org/hibernate/main/module.xml.bak >modules/system/layers/base/org/hibernate/main/module.xml

Step 5 : reinstall postgres module and datasources

start wildfly and follow commands above

sudo bin/jboss-cli.sh
connect
module add --name=org.postgres --resources=/tmp/postgresql-9.3-1103-jdbc41.jar:/tmp/postgis-jdbc-2.1.7.2.jar --dependencies=javax.api,javax.transaction.api
/subsystem=datasources/jdbc-driver=postgresql:add(driver-name="postgresql",driver-module-name="org.postgres",driver-xa-datasource-class-name=org.postgresql.xa.PGXADataSource)
data-source add --jndi-name=java:jboss/datasources/iev --name=iev --connection-url=jdbc:postgresql://localhost:5432/iev  --driver-name=postgresql --user-name=chouette --password=chouette
data-source add --jndi-name=java:jboss/datasources/chouette --name=chouette --connection-url=jdbc:postgresql_postGIS://localhost:5432/chouette2 --driver-class=mobi.chouette.ChouettePostGisDriverWrapper --driver-name=postgresql --user-name=chouette --password=chouette --max-pool-size=30
exit