Date: Thu, 28 Mar 2024 09:38:45 +0000 (UTC) Message-ID: <1109388855.143.1711618725660@[3.220.22.64]> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_142_1100110870.1711618725659" ------=_Part_142_1100110870.1711618725659 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
This page documents the use of admin tools to perform ad hoc fixes and/o= r patches for version upgrades. Ad hoc fixes are run to simply correct data= conditions in the DB, they are one-time and the mojo should not be expecte= d to retain code for the fix.
Patches have date ranges associated with them so the staging of patches = can be successfully tested and deployed to dev, UAT, and then PROD. A= ll patches should be run in-order and one-at-a-time from the most recently = run patch for a database (which ideally should be tracked in the top-level = wiki with deployment info by the label "PATCH LEVEL").
Generally, with PatchData it will be important to update the database pr= ior to running the patch (if any of the changes involve new or changed fiel= ds in the data model). In addition, there may be a correspondin= g patch SQL file in admin/src/main/resources, such as patch20170110.sql.
To run a patch manually:
To run a patch automatically, find the corresponding patch######.csh fil= e in the config/prod/src/main/resources/bin directory:
After done:
This tool is used to fix a data condition or patch the database for a ne= w release.
Following are some details about the implementation of this tool:
Mojo: AdHocMojo.java (in admin/src/main/resources/=
java/org/ihtsdo/otf/refset/mojo)
Project: admin
Configuration Parameters
refset.config - the standard configuration file specified as a = -D parameter
Mojo: PatchDataMojo.java (in admin/src/main/resour=
ces/java/org/ihtsdo/otf/refset/mojo)
Project: admi=
n
Configuration Parameters
refset.config - the standard configuration file specified as a = -D parameter
Sample command line call to run an ad hoc fix:
% cd /home/iht= sdo/refset/code/admin % mvn install -PAdHoc -Drefset.config=3D/home/ihtsdo/refset/config/config.p= roperties
Sample command line call to upgrade the 20170110 patch (with prerequisit= es):
% cd /home/iht= sdo/refset/code/admin % mvn install -PUpdatedb -Drefset.config=3D/home/ihtsdo/refset/config/confi= g.properties % mysql -u $user -p$pwd $db < /home/ihtsdo/refset/code/admin/src/main/re= sources/patch20170110.sql % mvn install -PPatch -Drefset.config=3D/home/ihtsdo/refset/config/config.p= roperties \ -Dstart=3D20170110 -Dend=3D20170110
Make sure to fully test ad hoc or patch fixes on an exact copy of the en= vironment intended to run against. For example, if patching UAT, depl= oy the current state of UAT to dev, and run the patch and verify proper fun= ction. When upgrading UAT repeat exactly the same process.
References/Links