[Vtigercrm-developers] Importing records

Hamono, Chris (DPC) Chris.Hamono at sa.gov.au
Mon Jul 27 23:23:23 GMT 2015


Hi Alan

That sounds like a good solution.

Have you experienced the duplication issue people are complaining about?

Chris

-----Original Message-----
From: vtigercrm-developers-bounces at lists.vtigercrm.com [mailto:vtigercrm-developers-bounces at lists.vtigercrm.com] On Behalf Of Alan Lord
Sent: Monday, 27 July 2015 4:43 PM
To: vtigercrm-developers at lists.vtigercrm.com
Subject: Re: [Vtigercrm-developers] Importing records

On 27/07/15 00:43, Hamono, Chris (DPC) wrote:
> Won’t manual import risk data integrity problems?
>
> I have never done it because a manual import (direct to db) does not 
> trigger other scripts. So if you have a module that relies on events 
> to fire on save or even workflows that need to run, a manual import 
> does not do them.

Use the Server APIs (this is not direct database insertion) - if you do
*not* set the global VAR "$VTIGER_BULK_SAVE_MODE" to true then using vtws_create/revise etc. will trigger Events etc.

> This is an issue I am about to encounter as I need to import data into 
> two separate vtiger instances one is some 57,000 assets and the other 
> is around 30,000 tickets into a highly customised ticket module.

Script it. Use the server APIs. If it's a large data import what I do is to run my import script from a bash wrapper which loops. It helps with memory starvation and also means (if you log properly) you can restart your process from where you left off it is does crash, rather than having to start again...

Example bash wrapper:

> for i in {0..500000..5000}
> do
>     echo "#3 $i..."
> 	sudo -u www-data php -f post-migration/account-migration-3.php ${i} > 
> ${LOGDIR}/account-migration-3-${i}.log
> done



_______________________________________________
http://www.vtiger.com/



More information about the vtigercrm-developers mailing list