Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setup for 2nd EMF instance #139

Open
cseppan opened this issue Aug 16, 2023 · 0 comments
Open

setup for 2nd EMF instance #139

cseppan opened this issue Aug 16, 2023 · 0 comments
Assignees

Comments

@cseppan
Copy link
Collaborator

cseppan commented Aug 16, 2023

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:

  • COST_CMDB_BACKUP_FOLDER
  • DOWNLOAD_EXPORT_FOLDER
  • DOWNLOAD_EXPORT_ROOT_URL
  • ImportExportTempDir
  • postgres-backup-dir-for-emissions-schema
  • postgres-bin-dir

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"
  1. 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

  • Create the "exports" folder in the new Tomcat webapps directory
  • Check if the postgres jar file needs to be copied into the new Tomcat lib directory

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
@ddelvecchio ddelvecchio self-assigned this Sep 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants