From 529a268cf64ca78b2893b0f8e68ebb85dcb560f4 Mon Sep 17 00:00:00 2001 From: Yannick Warnier Date: Fri, 9 Nov 2012 09:43:51 -0500 Subject: [PATCH] Split migrate process to allow for either migration or synchronization - command line option - refs BT#4881 --- tests/migrate/migrate.php | 36 ++++++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/tests/migrate/migrate.php b/tests/migrate/migrate.php index 1e668a34a6..8f7d606f5f 100644 --- a/tests/migrate/migrate.php +++ b/tests/migrate/migrate.php @@ -1,5 +1,9 @@ migrate($matches); - //Getting transactions from MSSQL (via webservices) + if ($action_type == 'migration') { + //Default migration from MSSQL to Chamilo MySQL + $m->migrate($matches); + } else { + //Getting transactions from MSSQL (via webservices) + + if (isset($matches['web_service_calls']['filename'])) { + require_once $matches['web_service_calls']['filename']; + } + //This functions truncates the transaction lists! + //$m->test_transactions($matches['web_service_calls']); - if (isset($matches['web_service_calls']['filename'])) { - require_once $matches['web_service_calls']['filename']; - } - //This functions truncates the transaction lists! - //$m->test_transactions($matches['web_service_calls']); - - //$m->search_transactions($matches['web_service_calls']); + $m->search_transactions($matches['web_service_calls']); - //Load transactions saved before - //$m->load_transactions($matches); + //Load transactions saved before + $m->load_transactions($matches); - //print_r($m->errors_stack); + //print_r($m->errors_stack); + } //echo "OK so far\n"; echo "\n ---- End loading server----- \n"; } else {