Try our conversational search powered by Generative AI!

Loading...
Applies to versions: 14 and higher
Other versions:
ARCHIVED This content is retired and no longer maintained. See the version selector for other versions of this topic.

Importing catalog data

Recommended reading 
Note: This documentation is for the preview version of the upcoming release of CMS 12/Commerce 14/Search & Navigation 14. Features included here might not be complete, and might be changed before becoming available in the public release. This documentation is provided for evaluation purposes only.

This topic explains options for importing catalog data between e-commerce sites.

Classes in this topic are in the following namespaces: 

  • Mediachase.Commerce.Catalog
  • Mediachase.Commerce.Storage
Note: You should not import data directly into the catalog system database unless you have a full understanding of how it works.

Import scenarios and options

You can import catalog data using these methods described in the following:

Using the import/export API 

You can import and export catalogs through Catalog.ImportExport, see examples in the following.

//Import

try
 {
     var catalogImportExport = new CatalogImportExport()
     {
           //Should only be true when the application does not have access to the catalog models.
           IsModelsAvailable = true
     };
     catalogImportExport.Import(new FileStream("pathtoZip"), true);
 }
 catch (Exception exception)
 {
     LogManager.GetLogger().Error(exception.Message, exception);
 }


//Export 
try
 {
     var catalogImportExport = new CatalogImportExport()
     {
           //Should only be true when the application does not have access to the catalog models.
           IsModelsAvailable = true
     };
     catalogImportExport.Export("catalogName", new FileStream("pathtoZip"), "");
 }
 catch (Exception exception)
 {
     LogManager.GetLogger().Error(exception.Message, exception);
 };

Using the Service API

You can also use the Optimizely Service API to manage imports and exports of catalog data, see Catalog service.

Managing versions when importing

To improve performance by eliminating previous versions, see Clear version history for saved catalog content.

Related topics

Do you find this information helpful? Please log in to provide feedback.

Last updated: Jul 02, 2021

Recommended reading