This process should only be followed to perform a clone of FlexDeploy Production environment to the Test environment. Make sure that Test environment is restricted for use by very few members of your team to avoid confusion, as the purpose of the Test environment is only for validating FlexDeploy itself and is not used for actual build/deploy activities. You will do some build/deploy activities, but strictly for validation purposes.The Source and Target version of FlexDeploy must be same, although you can clone and then upgrade to validate a FlexDeploy Release.
Make sure Target FlexDeploy is Ready
- Make sure target environment is ready.
- Keep target FlexDeploy down for this process.
- Prefer a cold export from Production (stop Production FlexDeploy briefly, or use a consistent backup / Flashback if available) so database and file-system copies align.
Export Import Database & Copy Artifacts, Plugins, and InfluxDB data
FlexDeploy uses Database tables to track all activities & configurations, and Artifact Repository folder to store build artifacts. So you must copy both items to target for successful clone.
-
Export data from Production FlexDeploy database.
- You should export FD,FF and FD_ADMIN.
-
Use your DBA-standard tooling. Examples:
Oracle (Data Pump)
PostgreSQL
-
Take backup of artifact repository folder using tar/zip commands on Production FlexDeploy server. (Optional if you won’t be deploying any old artifacts, they are not needed) For example,
- cd /flexdeploy/artifacts
- tar -czvf /app/backup/flexdeploy_artifacts_prod.tar.gz *
-
Take backup of plugins folder using tar/zip commands on Production FlexDeploy server. Plugins folder is under server working directory. You can determine working folder by looking at flexagon.fd.application.root system property on server command line. For example,
- cd /flexdeploy/application/plugins
- tar -czvf /app/backup/flexdeploy_plugins.tar.gz *
-
Take backup of vsm folder (InfluxDB)
- cd /flexdeploy/application/vsm
- tar -czvf /app/backup/flexdeploy_vsm_prod.tar.gz *
- Make sure Test FlexDeploy is now stopped for import process.
-
Import data in to target FlexDeploy database. Make sure to run this on Test environment only.
-
Run the following sql command for the appropriate database that will generate many drop table, view and procedure statements as output. Once this sql is complete, copy all of the output and execute that against the test database. This method will drop all of the data but maintain table spaces, quotas and passwords for the given schemas. This will also maintain the same password that is stored in the context.xml file.
Oracle DB: Drop tables, views and procedures without dropping user
If recycle bin is enabled, also run:You can verify remaining object types with:PostgreSQL DB: Drop tables and views without dropping userImport the Production dump into Test. Examples: Oracle (Data Pump)PostgreSQL
-
Run the following sql command for the appropriate database that will generate many drop table, view and procedure statements as output. Once this sql is complete, copy all of the output and execute that against the test database. This method will drop all of the data but maintain table spaces, quotas and passwords for the given schemas. This will also maintain the same password that is stored in the context.xml file.
Oracle DB: Drop tables, views and procedures without dropping user
- Make sure there are no errors in import process. If there are errors, make corrections appropriately and restart import process.
- At this point, the Test FlexDeploy database should be copy of Production database.
-
Copy artifacts zip file to Test FlexDeploy server and extract it in the artifact repository folder. You can determine Artifact Repository folder by looking at flexagon.fd.repository.root system property on server command line. Make sure to run this on Test environment only.
- cd /flexdeploy/artifacts
- tar -czvf /app/backup/flexdeploy_artifacts_test.tar.gz *
- rm -rf *
- tar -xzvf /app/backup/flexdeploy_artifacts_prod.tar.gz
- Now FlexDeploy artifact repository is also copied.
-
Copy plugins tar/zip file to Test FlexDeploy server and extract it in the plugins directory under working directory. You can determine working folder by looking at flexagon.fd.application.root system property on server command line.
- cd /flexdeploy/application/plugins
- rm -rf ./*
- tar -xzvf /app/backup/flexdeploy_plugins.tar.gz
- Now FlexDeploy plugins are also copied.
Copy Influx DB
To sync your influx db between prod and test, follow these steps: In TEST (Target)- cd /flexdeploy/application/vsm
- tar -czvf /app/backup/flexdeploy_vsm_test.tar.gz *
- rm -rf ./*
- tar -xzvf /app/backup/flexdeploy_vsm_prod.tar.gz
- Now FlexDeploy InfluxDB data is also copied.
- If after startup you see an InfluxDB unauthorized notification, see InfluxDB in FlexDeploy.
Update Target Database as Necessary
-
Now make various updates to make sure to limit access to the FlexDeploy Test environment and limit what FlexDeploy Test can do against various endpoints. You can customize any of these steps as per your needs. Make sure to run this on Test environment only.
-
Disable external realm and users, so access to FlexDeploy is very limited. Update SQL as appropriate for your setup. For example,
Inactivate Security Setup to restrict access
-
Disable endpoints so Test FlexDeploy cannot run executions until an Administrator explicitly enables selected endpoints. Also update base directory so enabled endpoints do not conflict with Production paths. For example,
Update Endpoints for Test environment
If you prefer to disable only remote SSH endpoints and leave localhost endpoints alone:
-
If you have workflows that perform tags on Source Control Systems, make sure to update the workflows before running builds, so you do not conflict with tags created by Production FlexDeploy. You can do this by simply running this SQL also. Adjust according to your requirements.
Update version syntax
-
Delete all Continuous Integration triggers.
Delete CI Triggers
-
Disable production environment. so Test FlexDeploy can not run any executions even for testing against Production environment. For example,
Disable Production environment
- Consider whether you should change or remove outgoing webhooks, incoming webhook/listener configuration, scheduled tasks/blackouts that would fire against real systems, and Integration Instance connection details that still point at Production systems.
-
Disable external realm and users, so access to FlexDeploy is very limited. Update SQL as appropriate for your setup. For example,
Inactivate Security Setup to restrict access
-
Now start Test FlexDeploy and validate it.
- You can make necessary adjustments to Realm, User, Groups to validate setup and perform tests as necessary. This is necessary as we disabled user and realms in previous steps.
- You can activate specific Endpoints that you want to be included in Test environment validations.
-
Update System Settings as appropriate.
- Change FD_SERVER_BASE_URL.
- Change SMTP_FROM_ADDRESS (and review SMTP host/credentials if Test should not use the Production mail path).
- Review Integration Instances, OAuth apps/tokens, and any other credentials copied from Production.