Commit 585e1486 authored by Boobaa's avatar Boobaa Committed by moshe weitzman
Browse files

Issue #1058186 by Boobaa, Owen Barton: Drush migration uses Drush's batch processing.

parent 84c1f517
...@@ -112,11 +112,19 @@ function drush_content_migrate_field_structure($field_name) { ...@@ -112,11 +112,19 @@ function drush_content_migrate_field_structure($field_name) {
function drush_content_migrate_field_data($field_name) { function drush_content_migrate_field_data($field_name) {
drush_log(dt('Migrating data for !field', array('!field' => $field_name)), 'status'); drush_log(dt('Migrating data for !field', array('!field' => $field_name)), 'status');
module_load_include('inc', 'content_migrate', 'includes/content_migrate.admin'); module_load_include('inc', 'content_migrate', 'includes/content_migrate.admin');
$context = array( $batch = array(
'sandbox' => array(), 'title' => t('Migrating data'),
'file' => drupal_get_path('module', 'content_migrate') . '/includes/content_migrate.admin.inc',
'operations' => array(array('_content_migrate_batch_process_migrate_data', array($field_name))),
'finished' => "Field migration is finished",
'init_message' => t("Fields migration is starting."),
'progress_message' => t('Processed @current out of @total.'),
'error_message' => t('Field migration has encountered an error.'),
); );
_content_migrate_batch_process_migrate_data($field_name, $context); batch_set($batch);
drush_log(strip_tags($context['message']), 'status'); $batch =& batch_get();
$batch['progressive'] = FALSE;
drush_backend_batch_process();
} }
/** /**
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment