The Solution: YAML
Configure our custom Mapper in our YAML file:
---
source_connection:
base_class: New::DBI
db_name: dbi:mysql:new
username: user
password: password
target_connection:
base_class: Legacy::DBI
db_name: dbi:mysql:legacy
username: user
password: password
entities:
TransGaming::Legacy::DBI::Games:
target_cdbi_class: TransGaming::DBI::Game
mapper:
class: TransGaming::DataMigration::Legacy::Mapper::GamesToGame
mappings:
game_name:
target_key: name
game_keywords:
target_key: search_data
game_url:
target_key: website
game_genre:
target_key: game_type
mapping:
class: Class::DBI::DataMigration::Mapping::HasAToHasA
config:
target_class: New::DBI::GameType
target_class_search_key: name
matching_source_key: game_genre->game_genre_name
game_vendor:
target_key: publisher
mapping:
class: Legacy::Mapping::GameVendorToPublisher