Dev GuideAPI Reference
Dev GuideAPI ReferenceUser GuideGitHubNuGetDev CommunityOptimizely AcademySubmit a ticketLog In
Dev Guide

Import catalog data

Explains options for importing catalog data between ecommerce sites.

Classes in this topic are in the following namespaces:

  • Mediachase.Commerce.Catalog
  • Mediachase.Commerce.Storage
📘

Note

Do 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 the methods described in the following:

Use the import/export API 

Import and export catalogs through Catalog.ImportExport. The following example shows how:

//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);
     };

Use the Service API

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