0

I am using the Migrate module to transfer 400,000 items to a new Drupal 7 site. I had a lot of problems in my first attempt because the database table was too large to import in one go. To get around this problem, I created several (around 100) smaller migrations which each did a piece of the migration. This works fine (so far) but the migrations must be done is a specific order. I would like to set up something that will run each migration, one after the other, in a set order. The entire process will take several hours, and I would like to set it up and let it run on its own. How can I do this?

Also, if there is a way create a single migration that can break down one big table query into several smaller queries, I would like to know about it.

Here is a sample of my module activation code (note, the big 400,000 table is not referred to here):

function mig_contacts_enable() {

    for ($i=0; $i<10; $i++) {
        $index = substr((1000+$i), 1);
        Migration::registerMigration('ProspectImport', "prospect_import_$index", array('rank' => $i));
    }


    for ($i=0; $i<1; $i++) {
        $index = substr((1000+$i), 1);
        Migration::registerMigration('CustomerImport', "customer_import_$index", array('rank' => $i));
    }  


    for ($i=0; $i<1; $i++) {
        $index = substr((1000+$i), 1);
        Migration::registerMigration('CustomerContactImport', "customer_contact_import_$index", array('rank' => $i));
    } 

...

1 Answer 1

0

When you activate a migration module that contains multiple migrations, they are installed in alphabetical order. This is the order that they are executed in when you use the UI or:

drush mi --all

I have added a single letter as a prefix to my migration. This allowed me to arrange my migrations as needed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.