Skip to main content

Publishing the DWD API

Create the Publish

  1. Open the VS Solution
  2. Right click on the DwdApiAspnet project and select Publish
  3. Configure based on these settings: DWD API Publish Settings
  4. And make sure you know the location to which the publish is written: DWD API Publish Location
  5. Click the Publish button
  6. Open a File Explorer at the publish location
  7. Delete the appsettings.json, so that we don't overwrite the published destination's existing appsettings later. If there are appsettings changes, then you should make sure to make those changes manually to the existing appsettings.
  8. Zip the published dwd-api-aspnet directory and append the following to the file name: _vX.X.X_MMDDYYYY. Here's an example from Jake's publish directory showing the zipped file name and the publish folder that gets zipped: Jake's publish directory
  9. Upload the zip file to Sharepoint at Documents > OH > HydroTrek > DWD > publishes > API

Deploy the Publish to Windows Server

  1. Connect to the server with RealVNC or directly with mouse and keyboard.
    • The device is the HP laptop in the small office.
    • It's IP address (to use RealVNC) is 192.168.50.166.
    • User is Administrator
    • Password is HP-ai2@24
  2. Download the zip file from sharepoint.
  3. Open IIS and navigate to the Application Pools section, then Stop each of the API instances, as seen in this screenshot: IIS Application Pools to Stop
  4. Open a File Explorer and navigate to the code directory:
    • MTW: C:\dwd-api-aspnet
    • DNV: C:\dwd-api-aspnet-dnv-nrw
    • IITD: C:\dwd-api-aspnet-iitd
  5. Make backups of the appsettings.json files just in case you forgot to delete it from the publish directory.
  6. Replace all content in the code directory with the content of the zip file. Make sure you don't overwrite the existing appsettings.json
  7. Once the files have successfully been written, you can go back to IIS and start the Application Pools.

Create a DB Dump

If you need to update the database on the server, you simply need to create a dump, upload it to sharepoint, download it on the server, and restore it.

  1. Make sure the API's appsettings.json file is pointing at the correct database.
  2. Open a CLI on your development machine in the API solution directory, i.e. C:\git\gqc\hydrotrek-dwd-suite\dwd-api-aspnet
  3. Run Scripts\dump_db.cmd
  4. Navigate to the User's Downloads folder (where the dump is written)
  5. Upload the dump to Sharepoint at Documents > OH > HydroTrek > DWD > db_dumps > {network}, where {network} is dnv, iitd, lwc, or mtw.
  6. Connect to the server and download the dump from Sharepoint.
  7. Create a new empty database matching the name of the dump, i.e. mtw_8_22_2025
  8. Restore the dump into the database.