Skip to main content

DWD Suite Publishing Notes

Publish EpanetConsoleCore

Create and Upload the EpanetConsoleCore Publish

  1. Open the EpanetConsoleCore solution in Visual Studio Professional (2022 or later)
  2. Right click on the solution and select "Publish"
  3. Make note of the publish output directory and confirm the publish
  4. Open a file explorer in the output directory
  5. cd ..
  6. Zip the publish directory
  7. Tag the zip with the version (if you've incremented the version, i.e. 1.0.2) and with the date in the format _mmddyyy, i.e. : epanetconsolecore_v1.8.3_10302025.zip
  8. Upload the zip to sharepoint at Documents/OH/HydroTrek/DWD/publishes/EPANETConsoleCore

Deploy the EpanetConsoleCore Publish

  1. Connect to GQC's VPN
  2. Connect to the Windows Server with Real VNC
  3. Download the zipped publish from sharepoint
  4. Replace the local published files with the new version from sharepoint
  5. Right click on the epanetconsolecore.exe, go to properties, and select unblock
  6. Open the IIS Manager and right click to stop each application pool for each hosted API
  7. Also in IIS Manager, right click to stop each of the hosted API sites
  8. Right click to start each of the application pools and sites.

Publish DwdApiAspnet

Create and Upload the DwdApiAspnet Publish

  1. Open the DwdApiAspnet solution in Visual Studio Professional (2022 or later)
  2. Right click on the solution and select "Publish"
  3. Make note of the publish output directory and confirm the publish
  4. Open a file explorer in the output directory
  5. Delete the appsettings.json file BEFORE zipping so that you don't overwrite the published server's settings.
  6. cd ..
  7. Zip the publish directory
  8. Tag the zip with the version (if you've incremented the version, i.e. 1.0.2) and with the date in the format _mmddyyy, i.e. : dwd-api-aspnet_v1.8.3_10302025.zip
  9. Upload the zip to sharepoint at Documents/OH/HydroTrek/DWD/publishes/API

Deploy the DwdApiAspnet Publish

  1. Connect to GQC's VPN
  2. Connect to the Windows Server with Real VNC
  3. Download the zipped publish from sharepoint
  4. Open the IIS Manager and right click to stop each application pool for each hosted API
  5. Also in IIS Manager, right click to stop each of the hosted API sites
  6. Replace the local published files with the new version from sharepoint
    1. NOTE: you will need to do this for each published instance, i.e. mtw, iitd, dnv.
  7. Update appsettings.json if necessary, for example to point at newly restored databases.
  8. Right click to start each of the application pools and sites.

Publish Database

Create DB Dump

The easiest way to create a DB dump for DWD is to utilize the script found under hydrotrek-dwd-suite/dwd-api-aspnet/Scripts/dump_db.cmd

  1. Open hydrotrek-dwd-suite/dwd-api-aspnet/DwdApiAspnet/appsettings.json with a text editor such as Notepad++ or VS Code.
  2. Make sure you're referencing the database that you want to dump, i.e. mtw, iitd, or dnv.
  3. In a terminal, run the hydrotrek-dwd-suite/dwd-api-aspnet/Scripts/dump_db.cmd script which will automatically create a named db dump file in your ~/Downloads directory.
  4. If you need to dump other databases, repeat the previous two steps to point at the new database and create its dump
  5. Upload all DB dumps to sharepoint at Documents/OH/HydroTrek/DWD/db_dumps/NETWORK

Create DB Dump with PSQL

If you want to use PSQL instead, or if you don't have the API source code available (such as if you want to dump the currently published database on the Windows Server), you can do so from PG Admin or the command line:

  1. Open a Terminal
  2. cd Downloads
  3. psql -U postgres mtw_5_7_2025 > mtw_5_7_2025.backup

Then, after transferring the database to your local machine, you can restore it with PG Admin or with the pg_restore command, as described in the following section.

Restore DB Dump

  1. Download the DB dump(s) from Sharepoint
  2. Create a new empty database matching the name of the dump file, i.e. mtw_5_7_2025
  3. Restore the dump into the database with either
    1. PG Admin
    2. or PSQL with the command pg_restore -U postgres -d mtw_5_7_2025 mtw_5_7_2025.backup