csv - Need to Change ids of records from SugarCRM Export for Accounts and Contacts -
i have bit of complex issue deal here @ moment , love please.
i have exported data sugarcrm in csv format imported in new app. app works differently in terms of database schema. use auto-incrementing integers id's sugarcrm uses long alphanumeric strings dc4c072c-ec0e-26b6-8780-4a9e7ec8375d.
i need able take data accounts , contacts, using sugarcrm pivot table export accounts_contacts, , change id's, while keeping them linked correctly. need use changed data import in database, each record in contacts table contains account_id field links them accounts, rather pivot table.
now, first thoughts import required data in clean database , use lookup table 4 fields in change id's. have old_account_id, new_account_id, old_contact_id, new_contact_id. i'd use table find right id's , amend data.
the issue have this, sql isn't amazing, i'm having difficulty visualising , writing query use lookup table , change data. love this.
also, once have query , correct amended data, need query create contacts table using account_id field pivot table.
hope guys can out. in advance.
are planning on keeping data in sync? i'd suggest adding "sugar_id" column in app , "your_app_id" column in sugarcrm. way native id column remains same , maintain reference record in other system.
Comments
Post a Comment