USEPA / emf

Emissions Modeling Framework (EMF)
6 stars 3 forks source link

setup for 2nd EMF instance #139

Open cseppan opened 1 year ago

cseppan commented 1 year ago

Creating a new database

I suggest using the database from the CMAS all-in-one package of EMF v4.1: https://github.com/USEPA/emf/releases/download/redeploy_EPA_20220627/emf_state_install_20221106.zip

To extract just the SQL backup from the archive:

unzip emf_state_install_20221106.zip state_install/database_backup/EMF_States_Version.backup

Create the new database and load the backup (I'm using "emf_test" as the database name):

createdb -U emf -E UTF8 emf_test
psql -U emf -d emf_test -f EMF_States_Version.backup

After loading the database, update the values for the following properties in the emf.properties table to match the new installation:

Apply the database updates from the v4.2 release detailed here: https://github.com/USEPA/emf/releases/tag/redeploy_EPA_20230306

The EMF v4.2 CMDB will need to be imported once everything is up and running: https://github.com/USEPA/emf/releases/download/redeploy_EPA_20230306/CMDB_2022-05-25.-.DEV.zip. Be sure to purge all existing measures during the import step.

Updating the EMF server to use the new database

Two files need to be edited to change the name of the database:

1) EMF/web/META-INF/context.xml, line 7

url="jdbc:postgresql://localhost:5432/emf_test?autoReconnect=true"

2) EMF/src/services/gov/epa/emissions/framework/services/spring/AppConfig.java, line 71

dataSource.setUrl("jdbc:postgresql://localhost:5432/emf_test?autoReconnect=true");

Compile the EMF server and install the war file in the new Tomcat webapps directory.

Other server config

Client config

Update the EMFClient.bat file to use the correct port (9443) and enable SSL (new command-line parameter and URL update):

java -Xmx1024M -Djavax.net.ssl.trustStore=WINDOWS-ROOT ... https://server:9443/emf/services