Migrations from multiple sources is a bit trickier, but is not overwhelmingly complicated. The main thing to remember is that you have to tell the migration which database to use as the source. To connect to a source, go to the php settings file at the root of your destination site. If one does not exist, create one titled settings.php or local.settings.php and add the following:

$databases['legacy']['default']= array(
    'driver'   => 'mysql',
    'database' => 'hr',
    'username' => 'migrate',
    'password' => 'migrate',
    'host'     => 'localhost',
    'port'     => '3306',
    'prefix'   => '',
);

This array tells the migration to connect to the hr legacy database with the username and password ‘migrate’. The source database is called legacy, and is listed as [‘legacy’][‘default’] in the array. Any time you need to change databases, all you need to do is change the database string.

The most important thing to remember when doing multiple database migrations is that pages with the same nid will overwrite existing pages with the same nid if you do not clear the database tables that keep track of migrated content. Any time it says a content type is updated it means a page in the destination has been overwritten. My workaround for this is a simple bash script that clears all of the relevant database tables. You can find this script in studev5.cws.oregonstate.edu/projects/modules/osu_migrate and is called migrate_clear.sh. Here is the proper procedure for using this script and migrating multiple databases:

1. Change database in the php settings file to the one you wish to migrate.

2. Run all migrations for the given database.

3. Change to the next database.

4. Run migrate_clear.sh, which clears the migration tracking tables, clears the cache, and calls migrate-status for the next migration.

5. Repeat until all tables have been imported.

Be sure to go through the script to make sure all content types being migrated have a table listed in the script. They all have the format of migrate_map_type, and the type listed is the name of the destination type. Please note that once you run the script, you will not be able to roll back any content types for previous tables. The migrate-status call uses these tables to know what content it needs to delete. It is still possible to delete all content and start from scratch (through the GUI or using VBO), however.