Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Export Import Database & Copy Artifact Repository

Info

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 will be prompted to enter password for system user.
    • This step will create fd_bkup.dmp file with all details from FD,FF and FD_ADMIN schemas. File should be in data pump directory, for example - C:\oraclexe\app\oracle\admin\XE\dpdump.
    • If your database is only used for FlexDeploy application, you may be able to perform backup and recovery operations using other Database tools.

...

  • 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.

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,

      Code Block
      update fd.fd_realm set is_active='N';
      update fd.fd_user set is_active='N' where local_user='N'; -- update as appropriate
      commit;


    • Disable all endpoints, so Test FlexDeploy can not run any executions until Administrator explicitly enables some endpoints. Update base directory to not conflict in case when one of these Endpoints is enabled in Test FlexDeploy. For example,

      Code Block
      update fd.endpoint set is_active='N' where connection_type='SSH';
      update fd.endpoint set base_directory = base_directory || 'fdtest';
      commit;


    • Disable all Continuous Integration triggers.

      Code Block
      delete from fd.project_trigger_config;
      delete from fd.project_trigger;
      commit;


    • Disable production environment. so Test FlexDeploy can not run any executions even for testing against Production environment. For example,

      Code Block
      update fd.environment set is_active='N' where environment_code='PROD'; -- update as appropriate
      commit;
  • Copy artifacts zip file to Test FlexDeploy server and extract it in the artifact repository folder. 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.

  • Now you can 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.
  • 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.

    Code Block
    update fd.project_stream set version_syntax = ' + ".fdtest"' || version_syntax;
    commit;


  • Update System Settings.
    • Change FD_SERVER_BASE_URL.
    • Change SMTP_FROM_ADDRESS. This will make sure that emails are coming from different address for Test FlexDeploy.