1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155
|
=head1 Tracking Changes In RT
Many organizations run a test RT in addition to their production system
so they can test changes before deploying them on their live instance.
This approach is a great way to try things before changing production,
but one challenge is that you need to repeat any updates you make in the
test environment step-by-step in your production environment.
The L<rt-dump-initialdata> tool included with RT provides a way to track
these changes in your test environment and export them so you can then
import them in your production environment. Using this tool, you can create
new queues, groups, scrips, and even grant rights, then export all of the
new configuration into a readable format.
Note that this utility is not a replacement for traditional database back-ups.
=head2 Migrating changes from test RT to production RT
As described above, let's look at an example of how you would make some
changes on a test RT server and then migrate them to a production server.
We'll assume that the configuration information between these two
instances is the same (same queues, groups, scripts, etc.). There are
ways to still use these tools if there are differences, but you'll have
the best results if they are in sync.
A good first step before starting is to validate that your RT data is valid:
rt-validator-5 --check
If L<rt-validator-5> reports any issues, it's good to investigate and fix those
first.
Next, take a JSON initialdata dump of our in dev RT:
rt-dump-initialdata-5 --sync --directory base
This should create a new directory "base" that contains a file
"initialdata.json" with your RT configuration. This contains
information like queue configuration, groups, custom fields,
scripts, etc. It does not contain ticket data, transactions,
attachments, etc. The C<--sync> option includes the ids of
various objects from the database to aid in finding updated
records.
Now say you want to add a new rights configuration to your "Support" queue
and also want to create a new scrip to automate some part of the support
process. You can make these changes on the test RT and save. Once you
are happy with the changes, run L<rt-dump-initialdata> again to output
the changes:
rt-dump-initialdata-5 --sync --directory new --base base/initialdata.json
For this run, C<--base> should point to the directory you created in the previous
step.
When you run it, a new directory "new" is created. The directory will have
another "initialdata.json" file along with a "changes.json" file that only
has the differences between the base and new RT initialdata. For this
example our changes file will have our new queue, some rights configurations
and the new scrip we created:
{
"ACL" : [
{
"GroupDomain" : "SystemInternal",
"GroupType" : "Everyone",
"ObjectId" : "Support",
"ObjectType" : "RT::Queue",
"RightName" : "CreateTicket"
},
{
"GroupDomain" : "SystemInternal",
"GroupType" : "Everyone",
"ObjectId" : "Support",
"ObjectType" : "RT::Queue",
"RightName" : "ReplyToTicket"
},
{
"GroupDomain" : "RT::Queue-Role",
"GroupType" : "AdminCc",
"ObjectId" : "Support",
"ObjectType" : "RT::Queue",
"RightName" : "CommentOnTicket"
},
{
"GroupDomain" : "RT::Queue-Role",
"GroupType" : "AdminCc",
"ObjectId" : "Support",
"ObjectType" : "RT::Queue",
"RightName" : "SeeQueue"
},
{
"GroupDomain" : "RT::Queue-Role",
"GroupType" : "AdminCc",
"ObjectId" : "Support",
"ObjectType" : "RT::Queue",
"RightName" : "ReplyToTicket"
},
{
"GroupDomain" : "RT::Queue-Role",
"GroupType" : "AdminCc",
"ObjectId" : "Support",
"ObjectType" : "RT::Queue",
"RightName" : "CreateTicket"
},
{
"GroupDomain" : "RT::Queue-Role",
"GroupType" : "AdminCc",
"ObjectId" : "Support",
"ObjectType" : "RT::Queue",
"RightName" : "ShowTicket"
}
],
"Queues" : [
{
"CommentAddress" : "",
"CorrespondAddress" : "",
"Description" : "",
"Lifecycle" : "default",
"Name" : "Support",
"SLADisabled" : 1,
"SortOrder" : 0
}
],
"Scrips" : [
{
"CustomCommitCode" : "",
"CustomIsApplicableCode" : "",
"CustomPrepareCode" : "",
"Description" : "On Support Request Do Something",
"Queue" : [
{
"ObjectId" : "Support",
"SortOrder" : 18,
"Stage" : "TransactionCreate",
"id" : 37
}
],
"ScripAction" : "User Defined",
"ScripCondition" : "User Defined",
"Template" : "Blank"
}
]
}
You can now apply the changes.json initialdata to your production RT:
rt-setup-database-5 --action insert --datafile new/changes.json
The output is JSON, so is human-readable. You can view the contents to
confirm it contains what you expect before running against your
production instance.
=cut
|