smeserver-domains/root/etc/e-smith/db/domains/migrate/10sanitise-db

25 lines
497 B
Plaintext
Raw Permalink Normal View History

{
# vim: ft=perl ts=4 sw=4 et:
foreach my $domain ( $DB->get_all )
{
my $lc_key = lc( $domain->key );
next if ( $lc_key eq $domain->key );
my $rec = $DB->get($lc_key);
if ($rec)
{
warn "DomainsDB: "
. $domain->key
. " NOT migrated as $lc_key exists\n";
next;
}
$rec = $DB->new_record($lc_key);
$rec->merge_props( $domain->props );
$domain->delete;
}
}