Generate Update

This document provides guidance and steps to upgrade Generate to a new release.

Audience

Technical staff that will be performing the Generate system upgrade.

It is strongly recommended that this document be read in full before attempting the upgrade.

System Requirements

Web Server:

Database Server:

Getting Started

If the current version of Generate is 3.1 or higher, updates should be performed using the Automatic Update functionality of Generate. This can be found in the Settings menu under the menu item named “Update”. This feature is available to users with the Admin role.

Update Steps (Manual Steps)

Database Server

There are two options for upgrading the database server:

  1. Using a PowerShell script

  2. Running SQL scripts manually

The PowerShell method is quicker but requires some basic knowledge of PowerShell. The SQL script method will take longer but only requires knowledge of running SQL scripts.

We strongly recommend using the PowerShell method as it is much quicker and less prone to manual error.

PowerShell Method

  1. Create a backup of your database in case the update fails, and you need to revert the changes.

  2. In the web application directory on the Web Server, copy the “DatabaseScripts” directory to the database server.

  3. Open the RunDatabaseScripts.ps1 file in a text editor.

  4. If needed, modify the $sqlCmdPath value to suit your environment. This should be the path of your sqlcmd.exe executable.

  5. Save the file and open a PowerShell session.

  6. Change the path to the directory where the RunDatabaseScripts.ps1 file is located.

  7. Execute the PowerShell script with the following parameters relevant to your environment:

    • Version

    • Server

    • Database

    • User

    • Password

  8. Confirm that the script executes successfully.

  9. If the script fails, you may revert the update by restoring the backup created in the first step.

Example:

./RunDatabaseScripts.ps1 "11.0" "192.168.51.53" "generate " "generate" "password"

SQL Scripts Method

  1. Create a backup of your database in case the update fails, and you need to revert the changes.

  2. In the web application directory on the Web Server, copy the “DatabaseScripts” directory to the database server.

  3. Open the “VersionScripts.csv” file in the “VersionUpdates\x.x” directory for the relevant version.

  4. Execute each script listed in that file against the Generate database in the exact order they are listed in the file. The first column specifies the relative path of the file and the second column specifies the file name. You can ignore the third column.

  5. It is important that every script is executed in order and runs successfully.

  6. If any script fails, you may revert the update by restoring the backup created in the first step.

Web Application

  1. Only perform these steps if the database update was successful.

  2. Ensure the web server has the proper version of the .NET Core Runtime and Hosting Bundle referenced in the System Requirements. Keep in mind this may have changed since the last version of Generate.

  3. In IIS, stop the generate.web website.

  4. Make a backup of the generate.web website folder.

  5. Delete all files within the generate.web website folder, except for the “appSettings.json” file located in the “Config” directory.

  6. Extract contents of “generate.web_x.x.zip” into a temporary directory.

  7. Copy all files from the just extracted “generate.web_x.x” folder, except for the “appSettings.json” file located in the “Config” directory, into the website folder

  8. Start up the web application in IIS.

  9. Open the website in a browser to confirm that it loads properly.

Only perform the following steps if the database and web updates were successful.

Background Application (update)

  1. In IIS, stop the generate.background website.

  2. Make a backup of the generate.background website folder.

  3. Delete all files within the generate.background website folder, except for the “appSettings.json” file located in the “Config” directory.

  4. Extract contents of “generate.background_x.x.zip” into a temporary directory.

  5. Copy all files from the just extracted “generate.background _x.x” folder, except for the “appSettings.json” file located in the “Config” directory, into the website folder.

  6. Start up the web application in IIS.

Permission Changes

For the Auto-Update functionality of Generate to work properly, you must ensure that the following permissions are set on the generate.web and generate.backgound directories:

  • The Application Pool Identity user account used by the generate.background site, must have Create and Modify permissions on the entire generate.web application directory.

  • The Application Pool Identity user account used by the generate.web site, must have Create and Modify permissions on the entire generate.background application directory.

Active Directory (AD)

Generate makes use of Active Directory (AD) for authentication and authorization. If an existing installation of AD is not available, Active Directory Lightweight Directory Services (AD LDS) may be installed. For those instructions, please see the AD LDS instructions in the Optional Installations section. The AD settings for Generate are configured in the “appsettings.json” file located in the “Config” folder of the web application directory. Please see the following for the configuration settings.

{
"AppSettings": {
"Environment": "production",
"ProvisionJobs": false,
"ADDomain": "ETSS.local",
"ADLoginDomain": "ETSS",
"ADPort": "389",
"ADContainer": "CN=Builtin,DC=ETSS,DC=local",
"UserContainer": "CN=Users,DC=ETSS,DC=local",
"ReviewerGroupName": "CN=Users,CN=Builtin,DC=ETSS,DC=local",
"AdminGroupName": "CN=Administrators,CN=Builtin,DC=ETSS,DC=local",
"BackgroundUrl": "http://192.168.1.2",
"BackgroundAppPath": "D:\\Apps\\generate.background"
},
"Data": {
"AppDbContextConnection": "Server=192.168.01.01;Database=generate;User ID=generate;Password=xxxxxxxxxxx;MultipleActiveResultSets=true;",
"ODSDbContextConnection": "Server=192.168.01.01;Database=generate;User ID=generate;Password=xxxxxxxxxxx;MultipleActiveResultSets=true;",
"RDSDbContextConnection": "Server=192.168.01.01;Database=generate;User ID=generate;Password=xxxxxxxxxxx;MultipleActiveResultSets=true;Connect Timeout=300;"
}
}

Generate makes use of two groups within Active Directory:

  • Administrators

  • Reviewers

Both AD roles must be configured in the AD instance and accessible by Generate. User access is provisioned via normal AD tools by adding or removing these roles to or from the desired users.

Final Steps

  1. Start the web application in IIS.

  2. Open the website in a web browser to confirm that it loads properly.

Last updated