X-Git-Url: http://git.equinoxoli.org/?p=migration-tools.git;a=blobdiff_plain;f=kmig.d%2Fbin%2Fmig-import;h=33302a7ddecd9011c9419e19fbea44792d2398a0;hp=6788d2852328be480fe2c5b0f745ef956b1f9aed;hb=e6810c5da4c55a0a64824a20b4944d792094211a;hpb=30444849807ba6c2afedf4c3f51d6c844cc9c0af diff --git a/kmig.d/bin/mig-import b/kmig.d/bin/mig-import index 6788d28..33302a7 100755 --- a/kmig.d/bin/mig-import +++ b/kmig.d/bin/mig-import @@ -438,8 +438,8 @@ sub restore_preferences { my $dom = $parser->parse_file($restore_file); foreach my $node ($dom->findnodes('//pref')) { - my $variable = sql_str($node->findvalue('./variable')); - my $value = sql_str($node->findvalue('./value')); + my $variable = domain_shift(sql_str($node->findvalue('./variable'))); + my $value = domain_shift(sql_str($node->findvalue('./value'))); my $query = "UPDATE systempreferences SET value = $value WHERE variable = $variable"; my $sth = $dbh->prepare($query); $sth->execute(); @@ -467,6 +467,13 @@ sub restore_smsproviders { return; } +sub domain_shift { + my $str = shift; + $str =~ s/-test.kohacatalog.com/.kohacatalog.com/g; + $str =~ s/-test-staff.kohacatalog.com/-staff.kohacatalog.com/g; + return $str; +} + sub sql_str { my $str = shift; if (!defined $str or $str eq '') { return 'NULL'; }