Skip to content

Data Migration Service – Oracle Commerce (ATG) to commercetools

Uncategorized

Data Migration Service – Oracle Commerce (ATG) to commercetools

NEW ELEVATION • JUNE 13, 2020

New Elevation is excited to announce the creation of a Data Migration Service that imports data from Oracle Commerce / ATG to commercetools.   This article showcases the migration of “Motorprise” catalog data from the ATG Commerce Reference Store (CRS), and provides a look “under the hood” for how this service was created.

In addition to the Product Catalog, this Service can also be configured to support other types of ATG data including profiles, orders, and more.

Catalog Migration

The Service supports the following data types in the Product Catalog:

  • Categories / Category Tree
  • Products
  • Skus / Variants

The simplest way to use this tool is to start by exporting the ATG data into an XML file via the startSQLRepository command. The Data Migration Service then consumes this XML file and imports the data directly into commercetools.

The screenshots below demonstrate the commercetools Merchant Center with the ATG Motorprise CRS data.

Pricing Migration

Similar to the catalog, we can also extract the pricing data from the ATG repository and store it in an XML file. The Data Migration Service is then used to import the data into commercetools.

The screenshots below shows an example of the ATG Motorprise Commerce Reference Store (CRS) pricing data inside the commercetools Merchant Center.

Under the Hood

The Skinny

The service is built using the commercetools JVM SDK and their Java Sync Library.   There are three main classes that the ImportCatalog service calls for help with the import.  CategoryService for categories, PricingService for prices and ProductService for products and skus.

In the CategoryService class, we first grab all the category items from the catalog XML using XPathExpression –

XPathExpression expr = getExpression("//add-item[@item-descriptor= \""+ itemDescriptor +"\"]")

Then loop through the categories and grab category details –

String displayName_en = xPathEvaluator.evaluate("set-property[@name=\"displayName_en\"]", category);

Next create a List of CategoryDraft objects from the details gathered above –

final CategoryDraft categoryDraft = CategoryDraftBuilder.of(…).build();

And then call the sync method of the CategorySync class and import the data –

categorySync.sync(categoryDrafts)

.thenAcceptAsync(categorySyncStatistics -> LOG.info(categorySyncStatistics .getReportMessage()))

.toCompletableFuture()

.get();

In the ProductService class we do something similar using the ProductSync class.  The PricingService is also called here to grab the price while creating the ProductVariantDraft

String skuPrice_us = getValue("//add-item[set-property[@name[.='skuId'] and .='"+skuId+"']

and set-property[@name[.='priceList'] and .='"

+ config.getProperty("pricelist_us")+"']]/set-property[@name='listPrice']", pricesNodeList.item(0));

Finally, we call both these services in the ImportCatalog class in order to run the import –

 CompletableFuture.allOf(categoryService.processCategorySync(),productService.processProductSync()).thenRun(()-> { … });

Now we can confirm that all the categories, products and skus have been loaded successfully and in the correct hierarchy by going to the Merchant Center to validate the data.

Performance

Importing the entire Motorprise CRS store from ATG to commercetools can be done in under 1 minute using this tool.  This catalog consists of 59 categories and 314 products and skus.

Real-Time Sync Support

This adapter can be used in conjunction with event listeners in the BCC to maintain a commercetools catalog sync’d up with ATG.


Close