Kernel::System::SysConfig::Migration - System configuration settings migration tools.
Create an object. Do not use it directly, instead use:
use Kernel::System::ObjectManager; local $Kernel::OM = Kernel::System::ObjectManager->new(); my $SysConfigMigrationObject = $Kernel::OM->Get('Kernel::System::SysConfig::Migration');
Migrate XML file content from OTRS 5 to OTRS 6.
my $Result = $SysConfigMigrationObject->MigrateXMLStructure( Content => ' <?xml version="1.0" encoding="utf-8" ?> <otrs_config version="1.0" init="Framework"> ... </otrs_config>', Name => 'Framework', );
Returns:
$Result = ' <?xml version="1.0" encoding="utf-8" ?> <otrs_config version="2.0" init="Framework"> ... </otrs_config>';
Migrate the configs effective values to the new format for OTRS 6.
my $Result = $SysConfigMigrationObject->MigrateConfigEffectiveValues( FileClass => $FileClass, FilePath => $FilePath, NoOutput => 1, # ( 0 | 1 ) optional, default 0. # if set to 1 no info output will be printed to the screen. PackageSettings => [ # (optional) only migrate the given package settings 'Frontend::Module###AdminGeneralCatalog', 'Frontend::NavigationModule###AdminGeneralCatalog', 'GeneralCatalogPreferences###Comment2', 'GeneralCatalogPreferences###Permissions', 'Loader::Agent::CommonJS###100-GeneralCatalog' ], PackageLookupNewConfigName => { 'Ticket::EventModulePost###999-GenericInterface' => 'Ticket::EventModulePost###9900-GenericInterface', }, ReturnMigratedSettingsCounts => 1, # (optional) returns an array with counts of un/successful migrated settings );
Returns:
$Result = 1; # True on success or false on error. # or # if ReturnMigratedSettingsCounts parameter is set $Result = { AllSettingsCount => 1, MissingSettings => [], UnsuccessfullSettings => [], };
Get a list of all old Sub-Groups and the corresponding new navigation.
my %NavigationLookup = $SysConfigMigrationObject->NavigationLookupGet();
Returns:
%NavigationLookup = ( 'Old::Subgroup' => 'New::Navigation', # ... );
Helper function to lookup new config names for configuration settings where the name has been changed from OTRS 5 to OTRS 6.
my $NewName = $SysConfigMigrationObject->_LookupNewConfigName( OldName => 'CustomerCompany::EventModulePost###100-UpdateCustomerUsers', );
Returns:
True on success or false on error.
Helper function to migrate a frontend module setting from OTRS 5 to OTRS 6.
my $NewName = $SysConfigMigrationObject->_MigrateFrontendModuleSetting( FrontendSettingName => 'Frontend::Module', FrontendModuleName => 'AgentTicketQueue', OTRS5EffectiveValue => { 'Description' => 'Overview of all open Tickets.', 'Group' => [ 'users', 'admin' ], 'GroupRo' => [ 'stats' ], 'Loader' => { 'CSS' => [ 'Core.AgentTicketQueue.css', 'Core.AllocationList.css' ], 'JavaScript' => [ 'Core.UI.AllocationList.js', 'Core.Agent.TableFilters.js' ], }, 'NavBar' => [ { 'AccessKey' => 'o', 'Block' => '', 'Description' => 'Overview of all open Tickets. xxx xxx', 'Link' => 'Action=AgentTicketQueue', 'LinkOption' => '', 'Name' => 'Queue view', 'NavBar' => 'Ticket', 'Prio' => '100', 'Type' => '' }, { 'AccessKey' => 't', 'Block' => 'ItemArea', 'Description' => 'xxx', 'Link' => 'Action=AgentTicketQueue', 'LinkOption' => '', 'Name' => 'Tickets', 'NavBar' => 'Ticket', 'Prio' => '200', 'Type' => 'Menu' } ], 'NavBarName' => 'Ticket', 'Title' => 'QueueView', }, OTRS6Setting => \%OTRS6Setting, );
Returns:
True on success or false on error.
This method locks provided settings(by force), updates them and unlock the setting.
my %Result = $SysConfigMigrationObject->_SettingUpdate( Name => 'Setting::Name', IsValid => 1, # (optional) 1 or 0, modified 0 EffectiveValue => $SettingEffectiveValue, # (optional) );
Returns:
%Result = ( Success => 1, # or false in case of an error Error => undef, # error message );
This software is part of the OTRS project (https://otrs.org/).
This software comes with ABSOLUTELY NO WARRANTY. For details, see the enclosed file COPYING for license information (GPL). If you did not receive this file, see https://www.gnu.org/licenses/gpl-3.0.txt.