Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 9 Next »

This page provides instructions for upgrading a FlexDeploy to use newer version of FlexDeploy Docker image. You will need to download appropriate version of FlexDeploy Tomcat distribution for database scripts and plugins. 

Upgrade Instructions

Step 1. Stop the Docker container using name. docker stop <name>


Step 2. Backup the FlexDeploy schemas and Artifact Repository. In case you need to back out FlexDeploy, you can use these backup data.

For back-out purposes, it is highly recommended that a database backup of the database be taken using standard tools like RMAN for Oracle. Another option would be to export the FD, FD_ADMIN, and FF schemas using data pump. The schemas can be exported using the following data pump command for Oracle as shown below. Follow standard procedures for PostgreSQL for database backup.

Recommendation for Oracle database backup

You will need to setup environment variables before running expdp. For example,

export ORACLE_HOME=/u01/app/oracle/product/12.1.0/dbhome_1
export ORACLE_SID=fd01

export statements above are for example only as values will be different for your installation.

expdp system directory=DATA_PUMP_DIR dumpfile=fd_bkup.dmp schemas=FD,FF,FD_ADMIN

If this database is exclusively used for just FlexDeploy application, you can rely on Database backup and recovery processes (RMAN)
instead of export data procedure.

It is recommended that a backup of the artifact repository file system be taken in case a back-out is required. The location of the artifact repository will be wherever you mounted the /home/oracle directory in the container the inside the repository folder. Standard file backup procedures can be followed. Optionally, the following command can be used to create a tar file backup of the entire directory.

cd <mounted directory>
tar –cvzf artifact.tar.gz repository

Step 3. Upgrade the FlexDeploy schemas

Locate upgrade scripts folder in distribution zip file. For example, /database/oracle/upgrade, /database/postgres/upgrade. This folder(s) includes a number of folders containing migration.sql, which upgrade the FlexDeploy schemas.

Checks prior to running Migration SQLs

  • As part of FlexDeploy 5.4 upgrade, missing UK constraint was added for REL_METADATA_VALUE table. Please check that there are no duplicate rows by running following SQL prior to upgrade. If you find duplicates then contact us via support portal.

SELECT * FROM (SELECT REL_DEFINITION_ID, PIPELINE_METADATA_ID, COUNT(1) NUMROWS
FROM FD.REL_METADATA_VALUE
GROUP BY REL_DEFINITION_ID, PIPELINE_METADATA_ID)
WHERE NUMROWS>1;
  • If you are upgrading from version prior to FlexDeploy 5.2, run following SQL prior to running upgrade scripts and make sure no rows are returned. If there are any row returned, it is possible that migration may not work correctly, in which case contact us via support portal.

SELECT
    kd.property_key_name, k.*
FROM
    fd.property_key k,
    fd.property_key_definition kd,
    fd.property_value pv
WHERE
    k.property_definition_id = kd.property_definition_id
    AND pv.sequence_number = 0
    AND k.property_key_id = pv.property_key_id
    AND kd.is_encrypted = 'Y'
    AND k.is_encrypted = 'N'
    AND pv.property_value not in ('<NOT CONFIGURED>', '<OPTIONAL>');
  • FlexDeploy 5.1 migration includes updates to Unique Constraint for FF.DB_PROPERTIES_DATA. If you are upgrading from version prior to 5.1, then run following SQL before running upgrade scripts. If you have duplicates then it needs to be fixed up prior to starting migration. If there are duplicates, work with Flexagon support team to resolve prior to migration.

SELECT * FROM (SELECT DB_PROPERTIES_ID, SEQUENCE_NUMBER, COUNT(1) NUMROWS
FROM FF.DB_PROPERTIES_DATA 
GROUP BY DB_PROPERTIES_ID, SEQUENCE_NUMBER) 
WHERE NUMROWS>1;

Running Migration SQL(s)

You will need to execute one or more SQL script(s) from the version of FlexDeploy you currently have, up to the latest version. And they must be executed in that order.

There is not an upgrade script for every version. For instance there is no upgrade script for upgrading FlexDeploy 5.6.0.6 to FlexDeploy 5.7.0.0. Simply skip to the next one needed, or stop if there aren't anymore.

See some examples below to help you understand database upgrade process.

Upgrading 5.6.0.0 to 6.0.0.0

v5.6.0.0-to-v5.6.0.2/migration.sql
v5.6.0.2-to-v5.6.0.5/migration.sql
v5.6.0.5-to-v5.6.0.6/migration.sql
v5.7.0.0-to-v5.7.0.1/migration.sql
v5.7.0.1-to-v5.7.0.2/migration.sql
v5.7.0.2-to-v6.0.0.0/migration.sql

Executing migration files

Once you have decided which migration scripts to execute, you need to run them against your database using database specific tools in proper sequence.

Oracle

These scripts should be executed as system, sys, or another user which has privileges to create objects in other schemas, performs grants, etc.  You can load and execute these scripts using other tools such as Toad or SQL Developer. Instructions below are for using the sqlplus client.

Oracle SQL*Plus is part of the Oracle Client, and may be executed on any host which has it installed. If the Oracle Client is not installed on the same host as where you are installing FlexDeploy, you can copy the scripts to another host which has it installed.

Make sure to spool output to a file, so it can be analyzed later if necessary.

To launch sqlplus:

export ORACLE_HOME=<your Oracle Home directory>
export ORACLE_SID=<the SID of your database>
spool migration5.2.0.out #(change for each script execution so logs are preserved)
$ORACLE_HOME/bin/sqlplus #(login as sys or system when prompted)
SQL> <<execute scripts as shown above>>

If running on another host other than the database server, you must update your tnsnames file and and launch sqlplus as follows:

export ORACLE_HOME=<your Oracle Home directory>
export ORACLE_SID=<the SID of your database>
spool migration5.2.0.out #(change for each script execution so logs are preserved)
$ORACLE_HOME/bin/sqlplus system@<tnsname>
SQL> <<execute scripts as shown above>>

For example,

PostgreSQL

These scripts should be executed as postgres or another super user which has privileges to create objects in other schemas, performs grants, etc. Change the bold text as needed in your environment.

Linux
  • Run FlexDeploy migration scripts. Type the password when asked. PostgresDDL.txt records the output of the script so that you can refer back to it later.

cd <Flexdeploy Unzip Folder>\database\postgres\upgrade\vx.y.0.z-v.a.b.0.c
/path/to/psql -U postgres -h hostname -p 5432 -d flexdeploy -a -b -e -f migration.sql > PostgresDDL.txt
Windows
  • Run FlexDeploy scripts. Type the password when asked. PostgresDDL.txt records the output of the script so that you can refer back to it later. 

cd <Unzip Folder>/database/postgres/upgrade/vx.y.0.z-v.a.b.0.c
C:\path\to\psql -U postgres -h hostname -p 5432 -d flexdeploy -a -b -e -f migration.sql > PostgresDDL.txt


Step 4. Copy plugins from download zip for auto upload. This would be inside of volume that you had configured during installation process.

FlexDeploy download zip contains plugin jar files. You just need to copy plugin jars from download zip to plugins folder in your installation (details explained below), and all plugins will be automatically uploaded and activated on the server startup.

  1. Plugin files to copy are in /application/plugins in the downloaded Tomcat Complete zip fie.

  2. Let's determine where to copy files in your installation now. Locate flexagon.fd.install.root folder for your FlexDeploy installation, which is FlexDeploy working directory. This is specified on the Java command line. For example, -Dflexagon.fd.install.root=/u01/flexdeploy/application.

    • You can look for this information in setenvoverride.bat or setenvoverride.sh file depending whether using Windows or Unix. 

  3. Create plugins folder if it does not exist under flexagon.fd.install.root folder. Copy files from download zip (#1 above) to this plugins folder.


Step 5 . Pull and start new docker image for FlexDeploy.

docker pull flexdeploy/fd_tcat:VERSION

User same values as used for previous version of FlexDeploy when starting new version of image, other than the version. Here is a refresher of what the values are:

  1. p - in this example 8000 is the port which FlexDeploy will be accessed on mapping to port 8080 in the container

  2. FLEX_DB_URL - jdbc URL for accessing the database. See below for syntax

  3. FD_ADMIN_PWD - Password for the fdadmin user in the database

  4. TZ - Time zone for the container. Given example is America/Chicago.

  5. dbtype - if you are using postgres or oracle database.

  6. INFLUX_DB_USER - Username for the built in influxdb

  7. INFLUX_DB_PASSWORD - Password for the built in influxdb. Username and password are only used upon first initialization. After that token is used to connect to the database.

  8. INFLUX_DB_TOKEN - Token used to connect to the built in influxdb.

  9. v - This will set where your application, repository, vsm and logs folders will go on the docker host. Everything before the colon is on the local machine, after is inside the container. Leave that as /home/oracle

  10. Last is the image which will be flexdeploy/fd_tcat: and the version you want to run.

docker run --name flexdeploy -p 8000:8080 -e FLEX_DB_URL="jdbc:oracle:thin:@URL:PORT:xe" -e FD_ADMIN_PWD=DATABASEPASSWORD -e TZ=America/Chicago -e dbtype=oracle|postgres -e INFLUX_DB_USER=flexdeploy -e INFLUX_DB_PASSWORD=INFLUXDBPASSWORD -e INFLUX_DB_TOKEN=INFLXUDBTOKENHERE -v /scratch/DockerVolume/flexdeploy:/home/oracle flexdeploy/fd_tcat:VERSION

Example JDBC URL (FLEX_DB_URL)

  • Oracle

    • Localhost XE connection will look like this. jdbc:oracle:thin:@localhost:1521:XE

    • SID based JDBC URL Syntax - jdbc:oracle:thin:@HOSTNAME:PORT:SID

    • Service Name based JDBC URL Syntax - jdbc:oracle:thin:@//HOSTNAME:PORT/SERVICENAME

  • PostgreSQL


Step 6. Launch FlexDeploy in your browser - http://<hostname>:<port>/flexdeploy


Step 7. There is no need to activate plugins manually. FlexDeploy will automatically upload and activate new versions of plugins once they are copied to plugins folder. You will notice that plugins that you copied in Step 8 will eventually be uploaded automatically and folder will not have any jar files left. You can also look at Administration - Plugins in UI and see newer versions of plugins.

  • No labels