cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Question about importing PKs from a source SAP Commerce system into another SAP Commerce system

aocabral
Explorer
0 Likes
711

Hello, everyone,

My team has the task to import/export data from a source commerce system (running CCV1) into a target commerce system (running on on premisse).

We've evaluated the options to do this and we've discarded using any database level ETL sort of tool.

Our plan is to use the Script Generator tool, available in Backoffice, to generate the migration ImpEx scripts.

The script generation has the option to export by PKs or to export by Reference.

The difference, obviously, is that by Reference the PKs will be created again in the target system.

The Export/Import by PKs seems a lot easier as the import process becomes a matter of only importing in the right order.

However, I'm afraid that, at some point or intermittently, when new instances of a type are created, the target system generates a PK for the new record that was already imported to the base.

Do you think this problem can happen? Or any other problem? Do you have any recommendation to make this process easier?

Best Regards!

Accepted Solutions (0)

Answers (1)

Answers (1)

geffchang
Active Contributor

When you migrate data, don't import using PKs. PKs for the same data can be different in different environments/servers.

Use the unique codes or composite keys that idenfies a record. e.g. code and catalogVersion for Product, and uid for Employee.

INSERT_UPDATE Employee;uid[unique=true];name
;emp1;EmployeeName1
;emp2;EmployeeName2

In this example, the code (or unique key) for the Employee is the uid. In all enviroments, you will refer to the records by their codes (in this case, the uid). When Hybris imports them, it's possible that Hybris will generate different PKs (in different environments) for the same code.

aocabral
Explorer
0 Likes

Hi, Geff,

Can you please elaborate on your recommendation? Why not import he PKs? What risk/issue do you envision?

geffchang
Active Contributor

acabral I updated the Answer, although I'm not sure it's clear. When you export the data, you can include the PK in the export. But, don't use the PK as the unique key. Use the code or some other set of attributes that uniquely identifies the record.