Change the key to update existing records from import

Hi, i was wondering how to change te key to update existing record from an import in the Account’s module.
Currently it is the ID of the accounts, but i want to change it with another field that I am sure it is univocal.
How can I do?

Imports are for new records, normally.

If you want to use them for updates, then you have to match the existing key - that is a natural requirement, otherwise SuiteCRM can’t tell which record you want to change.

So it follows that you can’t change keys with imports…

You can either

  • export, delete them on the database, change the keys outside SuiteCRM and then re-import as if they were new records

or

  • make the changes directly in the database. For example, you can make Excel write a bunch of SQL UPDATEs code starting from a table of old keys / new keys, and then run it from command-line mysql or from phpMyAdmin.

The first solution appears to be the best, but in my case when I receive the new file of the accounts with update fileds it is possbile that maybe an account in the CRM is not in the new file updated end if I delete it I will lost it.
Isn’t there anything for this problem?

You just need to be careful with your data and do only the required deletes, and not others.

If you need more control maybe you should go for a custom import script that does the updates for you through Beans, with all the necessary checks.

Ok, thank you

Did you get any solution to this issue?

Thanks!