[Vtigercrm-developers] migration of large database...
Alan Lord
alanslists at gmail.com
Fri Nov 21 08:24:33 GMT 2014
On 21/11/14 04:03, Richard Hills - Technologywise wrote:
> Is it in a format that you can imagine vtiger ever accepting it as a
> contribution? Not suggesting that you need to give away all of your hard
> work, but it'd be great to have and it's always good to see how far they
> will go with accepting contribs.
Well actually for vtiger 600 - 610 it wasn't very difficult...
I took the 600_to_610.php schema file, removed all the code that had
completed successfully then stuck this lot at the top and saved it as a
new file in the module/Migration/ dir:
> ini_set('error_reporting', E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED);
> ini_set('display_errors','1');
>
> require_once('includes/main/WebUI.php');
> $user = new Users();
> $current_user = $user->retrieveCurrentUserInfoFromFile("1");
>
> vimport('~~include/utils/utils.php');
> vimport('~~modules/com_vtiger_workflow/include.inc');
> vimport('~~modules/com_vtiger_workflow/tasks/VTEntityMethodTask.inc');
> vimport('~~modules/com_vtiger_workflow/VTEntityMethodManager.inc');
> vimport('~~modules/com_vtiger_workflow/tasks/VTEmailTask.inc');
> vimport('~~include/Webservices/Utils.php');
>
> vimport('~~modules/Users/Users.php');
// Code starts here...
> Migration_Index_View::ExecuteQuery('UPDATE vtiger_currencies SET currency_name = ? where currency_name = ? and currency_code = ?',
>
> array('Hong Kong, Dollars', 'LvHong Kong, Dollars', 'HKD'));
>
> Migration_Index_View::ExecuteQuery('UPDATE vtiger_currency_info SET currency_name = ? where currency_name = ?',
>
> array('Hong Kong, Dollars', 'LvHong Kong, Dollars'));
...
I was then able to run this new file from the php cli.
I said it was a hack ;-)
HTH
Al
PS - I think for the 5.4.0 to 6.0.0 part it is a different problem to
solve. But I've not really had much of a problem with that migration step.
More information about the vtigercrm-developers
mailing list