Class::DBI::DataMigration Getting Your Data From There to Here #26

Step 3: Pass the data structure to Class::DBI::DataMigration::Migrator

use Class::DBI::DataMigration::Migrator;
use Legacy::DBI::Games;
use New::DBI::Game;

open YAML, 'config.yaml' or die $!;
my $migrator = new Class::DBI::DataMigration::Migrator(join '', <YAML>);

my @source_objects = Legacy::DBI::Games->retrieve_all;
my $target_objects = $migrator->migrate_objects(\@source_objs);

# Now $target_objects point at the right game_types
Copyright © 2005 Dan Friedman (Powered by Spork)