Upgrading FlexDeploy - WebLogic
This chapter covers the process to upgrade a WebLogic FlexDeploy installation.
Startup Parameters for WebLogic
Revisit startup parameters (JVM Arguments) for WebLogic server as defined in Installation for Weblogic.
Also, make sure that you are using JDK 1.8 for application server.
Step 1. Identify location of artifact repository
Launch the WebLogic console and navigate to Environment / Servers under the domain structure. Click on Flex_Server1 (or whatever the name of your FlexDeploy server is) under the configuration tab. Select the server start tab and look at the flexagon.fd.repository.root argument to identify the location of the artifact repository.
Step 2. Stop FlexDeploy application
Before shutting down the application, make a determination of which Patch Release files to run by saving the Build Time on the About window of your FlexDeploy installation.
From the WebLogic console, navigate to Environment / Servers and click on the Control tab. Check the box in front of Flex_Server1 (or whatever the name of your FlexDeploy server is) and select one of the shutdown options to stop the application.
Step 3. Backup Oracle schemas
For back-out purposes, it is recommended that a database backup of the Oracle database be taken using standard tools like RMAN. 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.
Backup Oracle Database
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.
Step 4. Backup artifact repository
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 was identified in the first step of this document. Standard file backup procedures can be followed. Optionally, the following command (unix only) can be used to create a tar file backup of the entire directory.
Backup artifact repository
cd <artifact repository location>
tar –cvzf artifact.tar.gz <artifact repository location>
Step 5. Upgrade Oracle schemas
Locate upgrade scripts folder in distribution zip file. For example, /database/oracle/upgrade, /database/postgres/upgrade, /database/mysql/upgrade. This folder(s) includes a number of folders containing migration.sql, which upgrade the FlexDeploy schemas.
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;
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.
See some examples below to help you understand database upgrade process.
v5.2.0.0-to-5.2.0.1/migration.sql v5.2.0.1-to-5.3.0.0/migration.sql v5.3.0.0-to-v5.3.0.2/migration.sql v5.3.0.2-to-v5.3.0.3/migration.sql v5.3.0.3-to-v5.3.0.4/migration.sql v5.3.0.4-to-v5.4.0.0/migration.sql
v5.3.0.0-to-v5.3.0.2/migration.sql v5.3.0.2-to-v5.3.0.3/migration.sql v5.3.0.3-to-v5.3.0.4/migration.sql v5.3.0.4-to-v5.4.0.0/migration.sql
v5.3.0.2-to-v5.3.0.3/migration.sql v5.3.0.3-to-v5.3.0.4/migration.sql v5.3.0.4-to-v5.4.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.
sqlplus
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 6. Copy FlexDeployAPI.jar
From the FlexDeploy WebLogic distribution, copy WebLogic/FlexDeployAPI.jar into <WebLogic Domain Home>/lib (overwrite existing file if present). If you want to take backup of existing file, please copy it outside of WebLogic domain home folder to avoid confusion later.
Step 7. Uninstall Old EAR
At this point, we have already stopped FlexDeploy managed server, so we can uninstall old EAR file. From the WebLogic console, select Deployments under the Domain Structure tree on the left. Check the box in front of the FlexDeploy application and click Delete.
If your domain is using Production Mode, perform Lock and Edit and once Delete is completed, Activate Changes.
Step 8. Deploy JAX-RS 2.0 Library
FlexDeploy 5.4 and higher requires the JAX-RS 2.0 weblogic deployable-library to be available on the Managed Server running FlexDeploy. The library ships with Weblogic and simply needs to be deployed. Instructions to do so can be found here.
Step 9. Deploy New EAR
From the WebLogic console, select Deployments under the Domain Structure tree.
If your domain is using Production Mode, perform Lock and Edit and once Deploy is completed, Activate Changes.
Click Install button to begin process of installing new EAR file. You can either Upload EAR file using console or place it on AdminServer host in <Domain Home>/applications folder.
To upload EAR file, click the upload your file(s) link, then select Choose File under Deployment Archive & select downloaded EAR file from your computer, then Select the application to deploy and click Next (EAR name will match the file upload instead of what is shown in the example).
Alternatively you can keep file in <Domain Home>/applications folder and select using links in Recently Used Paths.
Select Install this deployment as an application and click Next.
Select the FlexDeploy_Server1 (may be different name for Managed Server in your environment) to deploy this EAR to and click next.
The EAR must be targeted to either a single managed server or a cluster containing only a single managed server.
Click Finish.
Make sure the EAR deploys successfully by verifying the health of the FlexDeploy deployment. If FlexDeploy-WLS is not active, make sure to start it.
Step 10. Copy Plugins for Auto Upload
FlexDeploy download zip contains plugin jar files. You just need to 1) copy plugin jars from download zip to plugins folder in your installation (details explained below) and 2) all files will be automatically uploaded and 3) activated on the server startup.
- Plugin files to copy are in following location in download zip.
- Tomcat Download - application/plugins
- WebLogic Download - plugins
- 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.
- For Tomcat, you can look for this information in setenv.bat or setenv.sh file depending whether using Windows or Unix.
- For Weblogic, find it in the managed server startup settings.
- 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 11. Start FlexDeploy application
From the WebLogic console, navigate to Environment / Servers under the Domain Structure tree. On the control tab, select Flex_Server1 (or whatever your server is named) and click on Start.
Verify that the state of the application is Active / OK when the start completes.
If the FlexDeploy application on the Deployments page does not show Active / OK, Start it as well.
Step 12. Launch FlexDeploy
Verify that the application launches. Verify the version by selecting "About" from the drop-down which appears next to the name of the logged in user in the FlexDeploy header. Validate that the build version matches the expected version.
- style