# Upgrading Petro.ai

When regular updates become available they should be downloaded from Petro.ai Portal. Administrators are notified via email as updates are made available.

# Regular Maintenance

Ruths.ai recommends first running the update process in a test environment, verifying the success of the update, and then running the same update for the production environment.

Server Maintenance

If regular server maintenance is needed on the deployed Petro.ai machines, all Petro.ai resources should be gracefully shutdown to ensure data and software are not corrupted. For PetroManager and PetroWorker instances, simply stop the Windows service. For PetroDatabase follow the MongoDB documentation for shutdown.

# Summary

Feature Steps
Petro.ai Server 1. Install new .zip
2. Configure serve-config.json
3. Create new service (different executable, new location)
Comments Service 1. Install new .zip
2. Configure serve-config.json
3. Create new service (different executable, new location)
Portal 1. Give administrator the role "Organizational Administrator"

# Step-by-step

The update process requires the following steps to be followed in order on the PetroManager and PetroWorker machines:

  1. Download the new Petro.ai package

    • Navigate to the Petro.ai Portal and search petro or,
    • go directly here and download Petro.ai.
  2. Turn off Petro.ai Services

    • Press the Windows key then search ‘services’ and press Enter.
    • Navigate to the Manager or Worker service.
    • Right-click and select ‘Stop’ to stop the service.
  3. Replace files

    • Navigate to %ProgramFiles%\Petro.ai to find the manager or worker directory.
    • Extract the downloaded files from step one, copy them into the directory, and select the replace all option. This will update all the necessary files except the config.json file.
  4. Turn on Services

    • Press the Windows key then search ‘services’ and press Enter.
    • Navigate to the Manager or Worker service.
    • Right-click and select ‘Start’ to start the service.
  5. Check for Database Migration

    • After the update, navigate to PetroSuite > Info to check if a database migration needs to be performed.
    • If a migration is needed, create a new migration job in PetroSuite > Jobs Manager > Create New Job and run immediately.
  6. Update Spotfire Extensions to match versions

  7. Verify that the changes are satisfactory

# Specific Upgrade Paths

There have been some significant architectural changes in the transition from 3.4.1 to 4.x versions. Our authentication system has been simplified to use the Petro Portal which is tied to either an Office365 account or a standalone Petro.ai account. This is also the same licensing that is used for the Spotfire Extensions.

TLS/SSL Security for MongoDB

At this time we are strongly encouraging the use of TLS for Mongo instances. You can find the instructions for configuring these settings at Configure mongod and mongos for TLS/SSL

# Upgrading from Petro.ai 4.x to 5.x

In the newest upgrade for Petro.ai, we'll need to modifying existing Petro Managers to the new architecture:

# Install Python

The required Python distribution can be found here: https://www.python.org/downloads/release/python-368/. After the installation, ensure that pip is installed.

Then execute the following steps:

  1. Download Windows x86-64 executable installer
  2. Run the install
  3. After the install completes run the executable again and install PIP
  4. Navigate to AppData/Local/Programs/Python/Python36
cd %APPDATA%/Local/Programs/Python/Python36
  1. Execute the following in the folder
python.exe -m pip install bokeh==2.0.0
  1. Copy the path for this folder to the manager config

# Email Settings

The client should provide their own SMTP server. This information is not contained in this documentation.

Steps:

  1. Create SES user in AWS. This should take the format of <environment_name>_ses_user
  2. Set smtpServer to: "email-smtp.us-west-2.amazonaws.com"
  3. Add credentials to manager config

# Petro-Webserver installation

Now to setup the Petro-Webserver! We'll need to download the latest package from the Portal and move around the components.

  1. Download Petro.ai (Latest) from the Portal
  2. Extract the petro-core folder to a folder of your choice, we recommend /Program Files/Petro.ai/petro-webserver
  3. Create a folder /Program Files/Petro.ai/petro-webserver/config
  4. Add manager-config.json to /Program Files/Petro.ai/petro-webserver/config
  5. Extract the Plugins to /Program Files/Petro.ai/plugins
  6. Each plugin that you would like to be loaded into Petro Manager needs to have its base folder path added to the manager config.Azure App Service Deploy

# Upgrading from Legacy PetroDB Standalone to Petro.ai 4.x

This upgrade path only pertains to users coming from the legacy deployment of the DCA Wrangler-generated Petro.ai database.

  1. Run the PAI Command-line Migration on localhost DB
RAI.PetroCore.CommandLine.exe --migrate
  1. Upload the new .spks on the Spotfire Server
  2. Ensure that your organization has an account on the new portal.petro.ai. If using Office365 for login, your Azure administrator must consent to the Petro.ai application. An administrator can use this link to initialize that integration.
  3. The organization administrators assigns users to subscriptions.
  4. Remove the Spotfire license keys from the Administration Manager.
  5. Update any required security protocols:
    • If standalone, self-sign (with option for their certificate).
    • Update relevant connection strings in the Spotfire Administration Manager.

# Upgrading from Petro.ai 3.4.1 to Petro.ai 4.x

This is the most common upgrade path. The following is a summary of the migration, please contact Petro.ai Support to perform this upgrade.

# Database

Run the Petro CLI migration on localhost DB

RAI.PetroCore.CommandLine.exe --migrate

# Manager/Worker

  1. Extract the new zips into the original directories of Petro.ai
  2. Update the manager-config
    • New connection string from the database
    • New portal block
    • New logging block
    • Remove the license in the manager-config

New portal block

"Portal": {
    "Uri": "https://portal.petro.ai/",
    "AppId": "ac7b8a9b78ea9c8ba798baec789",
    "SecretKey": "aec7a87ce9b8a7ec9b8aeba9ec8b7",
    "EnvironmentId": "yKHwF3uBfpsJk4JFG",
    "HeartbeatMsInterval": 5000
  },

New logging block

"Logging": {
    "LogLevel": {
      "Default": "Information"
    }
  },
  1. Update Windows Service to reflect the new paths of the applications.

# Portal

  1. Upgrade .spks on Spotfire
  2. For the organization on portal.petro.ai
    • Create an administrator for your organization, ensure that this user account has the "organization admin" role.
    • Create all the users
    • If using Office365 for login, your Azure administrator must consent to the Petro.ai application. An administrator can use this link to initialize that integration.
    • The organization administrator must assign users to a subscription.
  3. Remove the Spotfire license keys from the Administration Manager.
  4. Update any required security protocols:
    • If standalone, self-sign (with option for their certificate).
    • Update relevant connection strings in the Spotfire Administration Manager.