[Rt-commit] rt branch 5.0/docs-dump-initialdata-move-config created. rt-5.0.3-477-g78d90b3590
BPS Git Server
git at git.bestpractical.com
Fri Apr 14 17:59:46 UTC 2023
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "rt".
The branch, 5.0/docs-dump-initialdata-move-config has been created
at 78d90b359056517024ba09ba9ee4ed52bce35bd5 (commit)
- Log -----------------------------------------------------------------
commit 78d90b359056517024ba09ba9ee4ed52bce35bd5
Author: sunnavy <sunnavy at bestpractical.com>
Date: Sat Apr 15 01:42:19 2023 +0800
Clean up trailing whitespace in initialdata.pod
diff --git a/docs/initialdata.pod b/docs/initialdata.pod
index c7f74fdccf..d7c8822480 100644
--- a/docs/initialdata.pod
+++ b/docs/initialdata.pod
@@ -483,10 +483,10 @@ Here is an example of using a subroutine reference as a value for Object:
Object => sub {
my $GroupName = 'SomeQueue Group';
my $group = RT::Group->new( RT->SystemUser );
-
+
my( $ret, $msg ) = $group->LoadUserDefinedGroup( $GroupName );
die $msg unless $ret;
-
+
return $group;
},
Content => {
commit f7563ce8e667bce0bcf45e9087bba4bc898ad7b9
Author: Jim Brandt <jbrandt at bestpractical.com>
Date: Fri Apr 7 14:20:42 2023 -0400
Add some content to make podchecker happy
podchecker doesn't like blank sections.
diff --git a/docs/initialdata.pod b/docs/initialdata.pod
index 48c375c8a9..c7f74fdccf 100644
--- a/docs/initialdata.pod
+++ b/docs/initialdata.pod
@@ -501,6 +501,8 @@ Here is an example of using a subroutine reference as a value for Object:
=head2 C<@Initial>
+See C<@Final> below.
+
=head2 C<@Final>
C<@Initial> and C<@Final> are special and let you write your own processing
commit 6f84bcf63a7590c74dcd5f9490a970370e9823d0
Author: Jason Crome <jcrome at bestpractical.com>
Date: Thu Feb 17 09:31:01 2022 -0500
Document steps to generate initialdata changes file
rt-dump-initialdata has a way to generate JSON initialdata files containing
a set of changes made in the RT database. It requires running a set
of commands, so document all of the steps in the process.
diff --git a/docs/initialdata.pod b/docs/initialdata.pod
index 6911e960ee..48c375c8a9 100644
--- a/docs/initialdata.pod
+++ b/docs/initialdata.pod
@@ -588,4 +588,80 @@ No C<Final> elements will be used.
=back
+=head1 Automatically Generating Initialdata to Migrate Changes
+
+If you have RT instances running in multiple environments like dev,
+test, and production, you may want to pilot new configuration in dev,
+then move that configuration to production once it is validated.
+RT provides tooling to help export just new configuration changes as
+Initialdata and then load it into other environments.
+
+Note that for systems with very large databases, the generated initialdata
+files can be extremely large. With such systems, the process described below
+can take much longer and require more resources than on a typical RT system.
+
+=head2 Validate Your Starting Data
+
+It is good practice to run the L<rt-validator> tool to identify and resolve any
+errors in the RT database before starting:
+
+ /opt/rt5/sbin/rt-validator --check
+ /opt/rt5/sbin/rt-validator --check --resolve # If necessary
+
+=head2 Create a Baseline Checkpoint
+
+You can then create an initial export of your current configuration
+using the L<rt-dump-initialdata> utility. The generated Initialdata
+file will contain all of your current configuration, but no ticket,
+asset, or article data.
+
+ /opt/rt5/sbin/rt-dump-initialdata --sync
+
+When finished, you'll have a directory and file in the format F<yoursite.com:YYYY-MM-DD/initialdata.json>.
+
+=head2 Make Configuration Changes
+
+Make changes to your RT configuration through the web interface. You
+might add a new queue, create a new group, and add rights for that
+group on your new queue. All of these will be saved in the dev system
+database as you work.
+
+=head2 Export Changes as Initialdata
+
+When you've completed the changes you want to migrate to another RT,
+re-run L<rt-dump-initialdata>, providing the first export file as an
+argument.
+
+ /opt/rt5/sbin/rt-dump-initialdata --sync --directory changes/ \
+ --base yoursite.com:YYYY-MM-DD/initialdata.json
+
+A new output directory must be provided if you are making a diff file on the
+same day as the original configuration dump file was produced.
+
+You will now have a new directory, F<changes/>, with two files.
+F<initialdata.json> is the full dump of configuration data, and F<changes.json>
+has only that data which changed since the original dump. The initialdata file
+is JSON, so you can view it with a regular text editor. Before migrating changes
+to the target RT instance, you can review the contents. You can even edit the
+file directly if you need to add or remove some data.
+
+=head2 Importing Data
+
+By default, RT is not configured to import JSON data. The JSON format handler needs
+to be enabled before the change file produced in the prior step can be imported.
+See L<RT_Config/@InitialdataFormatHandlers> for details on enabling the
+JSON format.
+
+Copy F<changes.json> to your target server and run the following:
+
+ /opt/rt5/sbin/rt-setup-database --action insert \
+ --datafile path/to/changes.json
+
+The new configurations you made in development will now be available in your
+new environment.
+
+It is recommended that you make a database backup of your target RT before
+importing configuration changes. See Backups in L<Database|docs/system_administration/database.pod>
+for more information.
+
=cut
-----------------------------------------------------------------------
hooks/post-receive
--
rt
More information about the rt-commit
mailing list