diff --git a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/ExportDataCommand.java b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/ExportDataCommand.java
deleted file mode 100644
index 487b413..0000000
--- a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/ExportDataCommand.java
+++ /dev/null
@@ -1,67 +0,0 @@
-package org.openecomp.core.tools.Commands;
-
-import static java.nio.file.Files.createDirectories;
-
-import com.amdocs.zusammen.datatypes.SessionContext;
-import org.apache.commons.io.FileUtils;
-import org.openecomp.core.tools.Commands.exportdata.ElementHandler;
-import org.openecomp.core.tools.Commands.exportdata.ImportProperties;
-import org.openecomp.core.tools.Commands.exportdata.ItemHandler;
-import org.openecomp.core.tools.Commands.exportdata.VersionHandler;
-import org.openecomp.core.tools.util.ZipUtils;
-import org.openecomp.core.zusammen.impl.CassandraConnectionInitializer;
-import org.openecomp.sdc.logging.api.Logger;
-import org.openecomp.sdc.logging.api.LoggerFactory;
-
-import java.io.File;
-import java.io.IOException;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.nio.file.Paths;
-import java.time.LocalDateTime;
-import java.time.format.DateTimeFormatter;
-import java.util.HashSet;
-import java.util.Set;
-public class ExportDataCommand {
-    private static final Logger logger = LoggerFactory.getLogger(ExportDataCommand.class);
-
-    public static void exportData(SessionContext context, String filterItem) {
-        try {
-            Set<String> filteredItem = new HashSet<>();
-            filteredItem.add(filterItem);
-            ImportProperties.initParams();
-            CassandraConnectionInitializer.setCassandraConnectionPropertiesToSystem();
-            Path rootDir = Paths.get(ImportProperties.ROOT_DIRECTORY);
-            initDir(rootDir);
-            if (filterItem != null) {
-                filterItem = filterItem.replaceAll("\\r", "");
-            }
-            new ItemHandler().createItemsData(context, filteredItem);
-            new VersionHandler().loadVersions(filteredItem);
-            new ElementHandler().loadElements(filteredItem);
-            zipPath(rootDir,filteredItem);
-            FileUtils.forceDelete(rootDir.toFile());
-        } catch (Exception ex) {
-            logger.error(ex.getMessage(), ex);
-        }
-
-    }
-    private static void zipPath(Path rootDir,Set<String> filterItem ) throws Exception{
-        LocalDateTime date = LocalDateTime.now();
-        DateTimeFormatter formatter = DateTimeFormatter.ISO_LOCAL_DATE_TIME;
-        String dateStr = date.format(formatter);
-        String zipFile = System.getProperty("user.home")+ File.separatorChar+"onboarding_import"+ dateStr + ".zip";
-        ZipUtils.createZip(zipFile, rootDir,filterItem);
-        logger.info("Exported file :" + zipFile);
-        System.out.println("Exported file :" + zipFile);
-    }
-
-
-    public static void initDir(Path rootDir ) throws IOException{
-        if (Files.exists(rootDir)) {
-            FileUtils.forceDelete(rootDir.toFile());
-        }
-        createDirectories(rootDir);
-    }
-
-}
\ No newline at end of file
diff --git a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/HealAll.java b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/HealAll.java
index 2bc48bd..40a56ed 100644
--- a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/HealAll.java
+++ b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/HealAll.java
@@ -3,6 +3,8 @@
 import org.apache.commons.collections.CollectionUtils;
 import org.openecomp.core.tools.concurrent.ItemHealingTask;
 import org.openecomp.core.tools.loaders.VersionInfoCassandraLoader;
+import org.openecomp.sdc.healing.api.HealingManager;
+import org.openecomp.sdc.healing.factory.HealingManagerFactory;
 import org.openecomp.sdc.vendorsoftwareproduct.VendorSoftwareProductConstants;
 import org.openecomp.sdc.vendorsoftwareproduct.VendorSoftwareProductManager;
 import org.openecomp.sdc.vendorsoftwareproduct.VspManagerFactory;
@@ -31,18 +33,20 @@
 public class HealAll {
 
   private static final String HEALING_USER = "healing_user";
-  private static final int defaulThreadNumber =100;
+  private static final int defaulThreadNumber = 100;
   private static BufferedWriter log;
   private static List<ItemHealingTask> tasks = new ArrayList<>();
   private static VendorSoftwareProductManager vspManager = VspManagerFactory
       .getInstance().createInterface();
+  private static HealingManager healingManager = HealingManagerFactory.getInstance()
+      .createInterface();
   private static VersioningManager versioningManager = VersioningManagerFactory.getInstance()
       .createInterface();
 
   static {
     try {
       log =
-          new BufferedWriter(new FileWriter("healing.log",true));
+          new BufferedWriter(new FileWriter("healing.log", true));
     } catch (IOException e) {
       if (log != null) {
         try {
@@ -64,13 +68,13 @@
         defaulThreadNumber;
     ExecutorService executor = Executors.newFixedThreadPool(numberOfThreads);
 
-   filterByEntityType(VersionInfoCassandraLoader.list(),
+    filterByEntityType(VersionInfoCassandraLoader.list(),
         VendorSoftwareProductConstants.VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE).forEach
-       (HealAll::addTaskToTasks);
+        (HealAll::addTaskToTasks);
 
     executeAllTasks(executor);
 
-    writeToLog("----finished healing------" );
+    writeToLog("----finished healing------");
     Instant endTime = Instant.now();
     writeToLog("Total runtime was: " + Duration.between(startTime, endTime));
 
@@ -112,7 +116,7 @@
     if (Objects.nonNull(versionInfoEntity.getCandidate())) {
       return versionInfoEntity.getCandidate().getVersion();
     } else if (!CollectionUtils.isEmpty(versionInfoEntity.getViewableVersions())) {
-     return versionInfoEntity.getViewableVersions().stream().max(Version::compateTo).get();
+      return versionInfoEntity.getViewableVersions().stream().max(Version::compateTo).get();
     }
     return versionInfoEntity.getActiveVersion();
   }
@@ -126,17 +130,16 @@
     }
   }
 
-  private static Stream<VersionInfoEntity> filterByEntityType(Collection<VersionInfoEntity>
-                                                             versionInfoEntities,
-                                                     String entityType){
+  private static Stream<VersionInfoEntity> filterByEntityType(
+      Collection<VersionInfoEntity> versionInfoEntities, String entityType) {
     return versionInfoEntities.stream().filter(versionInfoEntity -> versionInfoEntity
         .getEntityType().equals(entityType));
   }
-  private static void addTaskToTasks(VersionInfoEntity versionInfoEntity){
+
+  private static void addTaskToTasks(VersionInfoEntity versionInfoEntity) {
     tasks.add(new ItemHealingTask(versionInfoEntity.getEntityId(), resolveVersion
-            (versionInfoEntity).toString(), versionInfoEntity.getCandidate() == null ?
-            HEALING_USER : versionInfoEntity.getCandidate().getUser(),
-            vspManager, versioningManager));
+        (versionInfoEntity).toString(),
+        vspManager, healingManager));
   }
 
 }
diff --git a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/ImportCommand.java b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/ImportCommand.java
deleted file mode 100644
index cebff91..0000000
--- a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/ImportCommand.java
+++ /dev/null
@@ -1,45 +0,0 @@
-package org.openecomp.core.tools.Commands;
-
-import com.amdocs.zusammen.datatypes.SessionContext;
-import org.apache.commons.io.FileUtils;
-import org.openecomp.core.tools.Commands.importdata.TreeWalker;
-import org.openecomp.core.tools.Commands.exportdata.ImportProperties;
-import org.openecomp.core.tools.util.ZipUtils;
-import org.openecomp.core.zusammen.impl.CassandraConnectionInitializer;
-import org.openecomp.sdc.logging.api.Logger;
-import org.openecomp.sdc.logging.api.LoggerFactory;
-
-import java.nio.file.Path;
-import java.nio.file.Paths;
-
-public class ImportCommand {
-
-    private static final Logger logger = LoggerFactory.getLogger(ImportCommand.class);
-
-
-    public static void importData(SessionContext context, String zippedFile, String filterItem) {
-        try {
-            ImportProperties.initParams();
-            CassandraConnectionInitializer.setCassandraConnectionPropertiesToSystem();
-            if (zippedFile == null){
-                logger.error("Import must have a valid file as an input.");
-            }
-            if (zippedFile != null) {
-                zippedFile = zippedFile.replaceAll("\\r", "");
-                if (filterItem != null) {
-                    filterItem = filterItem.replaceAll("\\r", "");
-                }
-                Path rootDir = Paths.get(ImportProperties.ROOT_DIRECTORY);
-                ExportDataCommand.initDir(rootDir);
-                ZipUtils.unzip(Paths.get(zippedFile), rootDir);
-                TreeWalker.walkFiles(context, rootDir, filterItem);
-                FileUtils.forceDelete(rootDir.toFile()); // clear all unzip data at the end.
-            }
-
-
-        } catch (Exception ex) {
-            logger.error(ex.getMessage(), ex);
-        }
-    }
-
-}
diff --git a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/SetHealingFlag.java b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/SetHealingFlag.java
new file mode 100644
index 0000000..b885ac5
--- /dev/null
+++ b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/SetHealingFlag.java
@@ -0,0 +1,31 @@
+package org.openecomp.core.tools.Commands;
+
+import com.datastax.driver.core.ResultSet;
+import org.openecomp.core.tools.store.HealingHandler;
+import org.openecomp.core.tools.store.VersionCassandraLoader;
+import org.openecomp.core.tools.store.zusammen.datatypes.HealingEntity;
+
+import java.util.ArrayList;
+
+
+/**
+ * Created by ayalaben on 10/15/2017
+ */
+public class SetHealingFlag {
+
+
+  public static void populateHealingTable(String oldVersion) {
+
+    VersionCassandraLoader versionCassandraLoader = new VersionCassandraLoader();
+    ResultSet listItemVersion = versionCassandraLoader.listItemVersion();
+
+    ArrayList<HealingEntity> healingEntities = new ArrayList<HealingEntity>();
+
+    listItemVersion.iterator().forEachRemaining(entry -> healingEntities.add(new HealingEntity
+        (entry.getString(0),entry.getString(1),entry.getString(2),true,oldVersion)));
+
+    HealingHandler healingHandler = new HealingHandler();
+    healingHandler.populateHealingTable(healingEntities);
+
+  }
+}
diff --git a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/exportdata/ElementHandler.java b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/exportdata/ElementHandler.java
deleted file mode 100644
index e03b7ff..0000000
--- a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/exportdata/ElementHandler.java
+++ /dev/null
@@ -1,108 +0,0 @@
-package org.openecomp.core.tools.Commands.exportdata;
-
-
-import org.openecomp.core.tools.store.ElementCassandraLoader;
-import org.openecomp.core.tools.store.zusammen.datatypes.ElementEntity;
-import org.openecomp.sdc.logging.api.Logger;
-import org.openecomp.sdc.logging.api.LoggerFactory;
-
-import java.nio.ByteBuffer;
-import java.nio.file.Path;
-import java.nio.file.Paths;
-import java.util.Objects;
-import java.util.Set;
-
-import static java.io.File.separator;
-import static java.nio.file.Files.*;
-import static org.openecomp.core.tools.Commands.exportdata.ImportProperties.*;
-
-public class ElementHandler {
-
-    private static final Logger logger = LoggerFactory.getLogger(ElementHandler.class);
-
-    public ElementHandler() {
-    }
-
-    public void loadElements(Set<String> filteredItem) {
-        ElementCassandraLoader elementCassandraLoader = new ElementCassandraLoader();
-          elementCassandraLoader.list().forEach(elementEntity ->  handleElementEntity(elementEntity,filteredItem));
-    }
-
-    private void handleElementEntity(ElementEntity elementEntity, Set<String> filteredItem) {
-        try {
-            String itemId = elementEntity.getItemId();
-
-            if (!filteredItem.isEmpty() && !filteredItem.contains(itemId)){
-                return;
-            }
-            String versionId = elementEntity.getVersionId();
-            String space = elementEntity.getSpace();
-            String namespace = elementEntity.getNamespace();
-            String elementId = elementEntity.getElement_id();
-
-            String namespacePath = separator;
-            if (!isNull(namespace)){
-                namespacePath =  namespace.replace(ELEMENT_NAMESPACE_SPLITTER,separator)+separator;
-            }
-            Path elementDirectoryPath;
-            if (!isNull(namespace)){
-                elementDirectoryPath = Paths.get( ROOT_DIRECTORY + separator + itemId
-                        + separator + versionId + separator + space + separator + namespacePath+ separator + elementId);
-            } else {
-                elementDirectoryPath = Paths.get( ROOT_DIRECTORY + separator + itemId
-                        + separator + versionId + separator + space + separator + elementId);
-              }
-
-            if (notExists(elementDirectoryPath)) {
-                 Path created = createDirectories(elementDirectoryPath);
-             }
-
-            String info = elementEntity.getInfo();
-            if (!isNull(info)) {
-                Path infoFilePath = Paths.get(elementDirectoryPath.toString() + separator + ELEMENT_INFO_PREFIX
-                        + elementId + JSON_POSTFIX);
-                write(infoFilePath, info.getBytes());
-            }
-
-            String relations = elementEntity.getRelations();
-            if (!isNull(relations)) {
-                Path realtionsFilePath = Paths.get(elementDirectoryPath.toString() + separator
-                        + ELEMENT_RELATION_PREFIX + elementId + JSON_POSTFIX);
-                write(realtionsFilePath, relations.getBytes());
-            }
-
-            ByteBuffer data = elementEntity.getData();
-            if (!Objects.isNull(data)) {
-                Path dataFilePath = Paths.get(elementDirectoryPath.toString() + separator
-                        + ELEMENT_DATA_PREFIX + elementId + JSON_POSTFIX);
-                write(dataFilePath, data.array());
-            }
-
-            ByteBuffer visualization = elementEntity.getVisualization();
-            if (!Objects.isNull(visualization)) {
-                Path visualFilePath = Paths.get(elementDirectoryPath.toString() + separator
-                        + ELEMENT_VISUALIZATION_PREFIX + elementId );
-                write(visualFilePath, visualization.array());
-            }
-
-            ByteBuffer searchableData = elementEntity.getSearchableData();
-            if (!Objects.isNull(searchableData)) {
-                Path searchableFilePath = Paths.get(elementDirectoryPath.toString() + separator
-                        + ELEMENT_SEARCHABLE_PREFIX + elementId);
-                write(searchableFilePath, searchableData.array());
-            }
-
-        } catch (Exception ex) {
-            logger.error(ex.getMessage(), ex);
-        }
-
-    }
-
-    private boolean isNull(String inStr){
-        if (Objects.isNull(inStr)){
-            return true;
-        }
-        return inStr.trim().equalsIgnoreCase("null");
-    }
-
-}
diff --git a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/exportdata/ImportProperties.java b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/exportdata/ImportProperties.java
deleted file mode 100644
index 3b7566f..0000000
--- a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/exportdata/ImportProperties.java
+++ /dev/null
@@ -1,20 +0,0 @@
-package org.openecomp.core.tools.Commands.exportdata;
-
-import java.io.File;
-
-public class ImportProperties {
-    public static final String VERSION_FILE_PREFIX = "version_";
-    public static final String VERSION_INFO_FILE_PREFIX = "version_info_";
-    public static final String JSON_POSTFIX = ".json";
-
-    public static final String ELEMENT_INFO_PREFIX = "elem_info";
-    public static final String ELEMENT_RELATION_PREFIX = "elem_relations";
-    public static final String ELEMENT_DATA_PREFIX = "elem_data";
-    public static final String ELEMENT_VISUALIZATION_PREFIX = "elem_visualization";
-    public static final String ELEMENT_SEARCHABLE_PREFIX = "elem_searchableData";
-    public static final String ELEMENT_NAMESPACE_SPLITTER = "/";
-    public static String ROOT_DIRECTORY;
-    public static final void initParams(){
-         ROOT_DIRECTORY = System.getProperty("user.home")+File.separator+ "onboarding_import";
-    }
-}
diff --git a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/exportdata/ItemHandler.java b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/exportdata/ItemHandler.java
deleted file mode 100644
index ebbfb56..0000000
--- a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/exportdata/ItemHandler.java
+++ /dev/null
@@ -1,87 +0,0 @@
-package org.openecomp.core.tools.Commands.exportdata;
-
-import com.amdocs.zusammen.datatypes.Id;
-import com.amdocs.zusammen.datatypes.SessionContext;
-import com.amdocs.zusammen.datatypes.item.Item;
-import com.amdocs.zusammen.plugin.statestore.cassandra.dao.ItemDao;
-import com.amdocs.zusammen.plugin.statestore.cassandra.dao.ItemDaoFactory;
-import com.google.common.base.Strings;
-import org.openecomp.core.tools.Commands.ExportDataCommand;
-import org.openecomp.core.utilities.json.JsonUtil;
-import org.openecomp.sdc.logging.api.Logger;
-import org.openecomp.sdc.logging.api.LoggerFactory;
-
-import java.io.IOException;
-import java.net.URISyntaxException;
-import java.nio.file.Path;
-import java.nio.file.Paths;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Optional;
-import java.util.Set;
-
-import static java.io.File.separator;
-import static java.nio.file.Files.*;
-import static org.openecomp.core.tools.Commands.exportdata.ImportProperties.JSON_POSTFIX;
-
-public class ItemHandler {
-    private static final Logger logger = LoggerFactory.getLogger(ExportDataCommand.class);
-
-
-    public ItemHandler() {
-        ImportProperties.initParams();
-    }
-
-    public void createItemsData(SessionContext context, Set<String> filteredItem) throws URISyntaxException, IOException {
-        final List<Item> items = new ArrayList<>();
-        if (filteredItem.isEmpty()) {
-            items.addAll(getItemDao(context).list(context));
-        } else {
-            Optional<Item> item = addItem(context, filteredItem.iterator().next(), items);
-            item.ifPresent(foundedItem -> {
-                Object vendorId =  foundedItem.getInfo().getProperty("vendorId");
-                if (vendorId != null) {
-                    String vendorIdStr = vendorId.toString();
-                    addItem(context, vendorIdStr, items);
-                    filteredItem.add(vendorIdStr);
-                }
-            });
-        }
-
-        items.parallelStream().forEach(item -> createItemDirectoryAndFiles(item, filteredItem));
-
-    }
-
-
-
-    private Optional<Item> addItem(SessionContext context, String filteredItem, List<Item> items) {
-        Optional<Item> item = getItemDao(context).get(context, new Id(filteredItem));
-        item.ifPresent(itemData -> items.add(itemData));
-        return item;
-    }
-
-    private final void createItemDirectoryAndFiles(Item item, Set<String> filteredItem) {
-        try {
-            String itemId = item.getId().getValue();
-            if (!filteredItem.isEmpty() && !filteredItem.contains(itemId)) {
-                return;
-            }
-            Path itemPath = Paths.get(ImportProperties.ROOT_DIRECTORY + separator + itemId);
-            Path itemFilePath = Paths.get(ImportProperties.ROOT_DIRECTORY + separator +
-                    itemId + separator + itemId + JSON_POSTFIX);
-            if (notExists(itemPath)) {
-                createDirectories(itemPath);
-            }
-            String itemJson = JsonUtil.object2Json(item);
-            write(itemFilePath, itemJson.getBytes());
-        } catch (Exception ex) {
-            logger.error(ex.getMessage(), ex);
-        }
-
-    }
-
-
-    private ItemDao getItemDao(SessionContext context) {
-        return ItemDaoFactory.getInstance().createInterface(context);
-    }
-}
diff --git a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/exportdata/VersionHandler.java b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/exportdata/VersionHandler.java
deleted file mode 100644
index 4ff5624..0000000
--- a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/exportdata/VersionHandler.java
+++ /dev/null
@@ -1,73 +0,0 @@
-package org.openecomp.core.tools.Commands.exportdata;
-
-import org.openecomp.core.tools.Commands.ExportDataCommand;
-import org.openecomp.core.tools.store.VersionInfoCassandraLoader;
-import org.openecomp.core.tools.store.VersionCassandraLoader;
-
-import org.openecomp.core.tools.store.zusammen.datatypes.VersionEntity;
-import org.openecomp.core.utilities.json.JsonUtil;
-import org.openecomp.sdc.logging.api.Logger;
-import org.openecomp.sdc.logging.api.LoggerFactory;
-import org.openecomp.sdc.versioning.dao.types.VersionInfoEntity;
-
-import static java.io.File.separator;
-import static java.nio.file.Files.*;
-import static org.openecomp.core.tools.Commands.exportdata.ImportProperties.*;
-import static org.openecomp.core.tools.Commands.exportdata.ImportProperties.ROOT_DIRECTORY;
-
-import java.nio.file.Path;
-import java.nio.file.Paths;
-import java.util.Set;
-
-public class VersionHandler {
-    private static final Logger logger = LoggerFactory.getLogger(ExportDataCommand.class);
-
-    public VersionHandler() {
-    }
-
-    public void loadVersions(Set<String> filteredItem) {
-        VersionCassandraLoader versionCassandraLoader = new VersionCassandraLoader();
-        versionCassandraLoader.list().forEach(versionEntity -> handleVersionEntity(versionEntity,filteredItem));
-        VersionInfoCassandraLoader versionInfoCassandraLoader = new VersionInfoCassandraLoader();
-        versionInfoCassandraLoader.list().forEach(versionInfoEntity ->  handleVersionInfo(versionInfoEntity,filteredItem));
-    }
-
-    private void handleVersionEntity(VersionEntity versionEntity, Set<String> filteredItem) {
-        try {
-            String itemId = versionEntity.getItemId();
-            if (!filteredItem.isEmpty()  && !filteredItem.contains(itemId)){
-                return;
-            }
-            String versionId = versionEntity.getVersionId();
-            String space = versionEntity.getSpace();
-            Path versionDirectoryPath = Paths.get( ROOT_DIRECTORY + separator + itemId
-                    + separator + versionId + separator + space);
-            Path versionFilePath = Paths.get(versionDirectoryPath.toString() + separator + VERSION_FILE_PREFIX
-                    + versionId + JSON_POSTFIX);
-            if (notExists(versionDirectoryPath)) {
-                createDirectories(versionDirectoryPath);
-            }
-            String versionJson = JsonUtil.object2Json(versionEntity);
-            write(versionFilePath, versionJson.getBytes());
-        } catch (Exception ex) {
-            logger.error(ex.getMessage(), ex);
-        }
-
-    }
-
-    private void handleVersionInfo(VersionInfoEntity versionInfoEntity, Set<String> filteredItem) {
-        try {
-            String itemId = versionInfoEntity.getEntityId();
-            Path itemDirectory = Paths.get( ROOT_DIRECTORY + separator + itemId);
-            Path versionInfoFilePath = Paths.get(itemDirectory.toString() + separator + VERSION_INFO_FILE_PREFIX
-                    + itemId + JSON_POSTFIX);
-            if (exists(itemDirectory)) {
-                String versionJson = JsonUtil.object2Json(versionInfoEntity);
-                write(versionInfoFilePath, versionJson.getBytes());
-            }
-        } catch (Exception ex) {
-            logger.error(ex.getMessage(), ex);
-        }
-
-    }
-}
diff --git a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/importdata/ElementImport.java b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/importdata/ElementImport.java
deleted file mode 100644
index d439468..0000000
--- a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/importdata/ElementImport.java
+++ /dev/null
@@ -1,135 +0,0 @@
-package org.openecomp.core.tools.Commands.importdata;
-
-import com.amdocs.zusammen.datatypes.Id;
-import com.amdocs.zusammen.datatypes.SessionContext;
-import org.openecomp.core.tools.store.ElementCassandraLoader;
-import org.openecomp.core.tools.store.ElementNamespaceHandler;
-import org.openecomp.core.tools.store.VersionCassandraLoader;
-import org.openecomp.core.tools.store.zusammen.datatypes.ElementEntity;
-import org.openecomp.sdc.logging.api.Logger;
-import org.openecomp.sdc.logging.api.LoggerFactory;
-
-import java.io.File;
-import java.io.IOException;
-import java.nio.ByteBuffer;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.nio.file.Paths;
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.Set;
-
-import static java.io.File.separator;
-import static org.openecomp.core.tools.Commands.exportdata.ImportProperties.*;
-
-public class ElementImport {
-    private static final Logger logger = LoggerFactory.getLogger(ElementImport.class);
-    public static final String ROOT_ITEM = Id.ZERO.getValue();
-
-    private ElementCassandraLoader elementCassandraLoader = new ElementCassandraLoader();
-    private ElementNamespaceHandler cassandraElementRepository = new ElementNamespaceHandler();
-    private VersionCassandraLoader versionCassandraLoader = new VersionCassandraLoader();
-
-    public void loadPath(SessionContext sessionContext, Path elementDir, String elementId, String[]
-            pathObjects) {
-        try {
-            if (!Files.isDirectory(elementDir)){
-                return;
-            }
-            // load info file
-            ElementEntity elementEntity = new ElementEntity();
-            Path infoFilePath = Paths.get(elementDir.toString() + separator + ELEMENT_INFO_PREFIX
-                    + elementId + JSON_POSTFIX);
-            if (Files.exists(infoFilePath)) {
-                String info = new String(Files.readAllBytes(infoFilePath));
-                elementEntity.setInfo(info);
-            }
-            // load relation file
-            Path realtionsFilePath = Paths.get(elementDir.toString() + separator
-                    + ELEMENT_RELATION_PREFIX + elementId + JSON_POSTFIX);
-            if (Files.exists(realtionsFilePath)) {
-                String relations = new String(Files.readAllBytes(realtionsFilePath));
-                elementEntity.setRelations(relations);
-            }
-
-            //load entity data
-            Path dataFilePath = Paths.get(elementDir.toString() + separator
-                    + ELEMENT_DATA_PREFIX + elementId + JSON_POSTFIX);
-            if (Files.exists(dataFilePath)) {
-                byte[] bytes = Files.readAllBytes(dataFilePath);
-                ByteBuffer data = ByteBuffer.wrap(bytes);
-                elementEntity.setData(data);
-            }
-
-            //load visualization
-            Path visualFilePath = Paths.get(elementDir.toString() + separator
-                    + ELEMENT_VISUALIZATION_PREFIX + elementId);
-            if (Files.exists(visualFilePath)) {
-                byte[] bytes = Files.readAllBytes(visualFilePath);
-                ByteBuffer visualization = ByteBuffer.wrap(bytes);
-                elementEntity.setVisualization(visualization);
-            }
-
-            //load searchable
-            Path searchableFilePath = Paths.get(elementDir.toString() + separator
-                    + ELEMENT_SEARCHABLE_PREFIX + elementId);
-            if (Files.exists(searchableFilePath)) {
-                byte[] bytes = Files.readAllBytes(searchableFilePath);
-                ByteBuffer searchable = ByteBuffer.wrap(bytes);
-                elementEntity.setSearchableData(searchable);
-            }
-            String element_Id = pathObjects[pathObjects.length - 1];
-            elementEntity.setSpace(pathObjects[2]);
-            elementEntity.setItemId(pathObjects[0]);
-            elementEntity.setVersionId(pathObjects[1]);
-            elementEntity.setElement_id(element_Id);
-            elementEntity.setNamespace(getNameSpace(pathObjects));
-            elementEntity.setParentId(getParentId(pathObjects));
-            elementEntity.setSubElementIds(getAllSubElementsIds(elementDir, element_Id));
-            elementCassandraLoader.createEntity(elementEntity);
-            cassandraElementRepository.createElementNamespace(elementEntity);
-            versionCassandraLoader.insertElementToVersion(elementEntity);
-        } catch (Exception ex) {
-            logger.error(ex.getMessage(), ex);
-        }
-    }
-
-    private String getParentId(String[] pathObjects) {
-
-        if (pathObjects[pathObjects.length - 1].equals(ROOT_ITEM)) {
-            return null;
-        }
-        if (pathObjects.length == 4) {
-            return ROOT_ITEM;
-        }
-        return pathObjects[pathObjects.length - 2];
-    }
-
-    private Set<String> getAllSubElementsIds(Path root, String elementId) throws IOException {
-        if (elementId.equals(ROOT_ITEM)) {
-            root = root.getParent();
-        }
-        File file = root.toFile();
-        Set<String> retVal = new HashSet<>();
-        File[] files = file.listFiles();
-        for (File f : files){
-            if (f.isDirectory()){
-                retVal.add(f.getName());
-            }
-        }
-        retVal.remove(ROOT_ITEM);
-        return retVal;
-
-    }
-
-    private String getNameSpace(String[] pathObjects) {
-        if (pathObjects.length <= 4) {
-            return "";
-        }
-        if (pathObjects.length == 5) {
-            return pathObjects[3];
-        }
-        return Arrays.stream(pathObjects, 3, pathObjects.length - 1)
-                .reduce("", (s1, s2) -> s1 + File.separator + s2);
-    }
-}
diff --git a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/importdata/ItemImport.java b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/importdata/ItemImport.java
deleted file mode 100644
index 4dd4a1f..0000000
--- a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/importdata/ItemImport.java
+++ /dev/null
@@ -1,44 +0,0 @@
-package org.openecomp.core.tools.Commands.importdata;
-
-import com.amdocs.zusammen.datatypes.SessionContext;
-import com.amdocs.zusammen.datatypes.item.Item;
-import com.amdocs.zusammen.plugin.statestore.cassandra.dao.ItemDao;
-import com.amdocs.zusammen.plugin.statestore.cassandra.dao.ItemDaoFactory;
-import org.openecomp.core.utilities.json.JsonUtil;
-import org.openecomp.sdc.logging.api.Logger;
-import org.openecomp.sdc.logging.api.LoggerFactory;
-
-import java.io.File;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.nio.file.Paths;
-
-import static org.openecomp.core.tools.Commands.exportdata.ImportProperties.JSON_POSTFIX;
-
-public class ItemImport {
-    private static final Logger logger = LoggerFactory.getLogger(ItemImport.class);
-
-    public void loadPath(SessionContext sessionContext, Path itemDir, String itemName) {
-        try {
-            Path itemPath = Paths.get(itemDir.toString() + File.separator + itemName + JSON_POSTFIX);
-            if (!Files.exists(itemPath)) {
-                return;
-            }
-            String itemJson = new String(Files.readAllBytes(itemPath));
-            if (itemJson.trim().isEmpty()) {
-                return;
-            }
-            Item item = JsonUtil.json2Object(itemJson, Item.class);
-            ItemDao itemDao = getItemDao(sessionContext);
-            itemDao.create(sessionContext, item.getId(), item.getInfo(), item.getCreationTime());
-            logger.info("Item Created :"+item.getInfo().getName()+" , "+item.getId());
-            System.out.println("Item Created :"+item.getInfo().getName()+" , "+item.getId());
-        } catch (Exception ex) {
-            logger.error(ex.getMessage(), ex);
-        }
-    }
-
-    private ItemDao getItemDao(SessionContext context) {
-        return ItemDaoFactory.getInstance().createInterface(context);
-    }
-}
diff --git a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/importdata/TreeWalker.java b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/importdata/TreeWalker.java
deleted file mode 100644
index 30c4152..0000000
--- a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/importdata/TreeWalker.java
+++ /dev/null
@@ -1,54 +0,0 @@
-package org.openecomp.core.tools.Commands.importdata;
-
-import com.amdocs.zusammen.datatypes.SessionContext;
-import org.openecomp.sdc.logging.api.Logger;
-import org.openecomp.sdc.logging.api.LoggerFactory;
-
-import java.io.File;
-import java.io.IOException;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.util.stream.Stream;
-
-public class TreeWalker {
-    private static final Logger logger = LoggerFactory.getLogger(TreeWalker.class);
-
-    public static final void walkFiles(SessionContext sessionContext,Path rootDir, String filterItem) throws IOException {
-        try (Stream<Path> walk = Files.walk(rootDir)) {
-            walk.parallel().filter(path -> Files.isDirectory(path)).
-                    forEach(path -> handlePath(sessionContext,path, rootDir, filterItem));
-        }
-    }
-
-    private static final void handlePath(SessionContext sessionContext, Path path, Path root,String filterItem) {
-        String logicalPath = path.toString().replace(root.toString(), "");
-        if (logicalPath.startsWith(File.separator)){
-            logicalPath = logicalPath.substring(1);
-        }
-        String[] splitted = logicalPath.split(File.separator);
-        if(filterItem != null && splitted.length > 0 && !splitted[0].contains(filterItem)){
-            return;
-        }
-        switch (splitted.length) {
-            case 0:
-                //root - ignore
-                break;
-            case 1:     // handle Item
-                new ItemImport().loadPath(sessionContext,path,splitted[splitted.length -1]);
-                new VersionInfoImport().loadPath(sessionContext,path,splitted[splitted.length -1]);
-                break;
-            case 2:
-                //ignore this level
-                break;
-            case 3: // handle version
-                new VersionImport().loadPath(sessionContext,path,splitted[splitted.length -2]);
-                break;
-            default:
-                //handle elements
-                 new ElementImport().loadPath(sessionContext,path,splitted[splitted.length -1],splitted);
-                break;
-        }
-
-    }
-
-}
diff --git a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/importdata/VersionImport.java b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/importdata/VersionImport.java
deleted file mode 100644
index 48433d8..0000000
--- a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/importdata/VersionImport.java
+++ /dev/null
@@ -1,41 +0,0 @@
-package org.openecomp.core.tools.Commands.importdata;
-
-import com.amdocs.zusammen.datatypes.SessionContext;
-import org.openecomp.core.tools.store.VersionCassandraLoader;
-import org.openecomp.core.tools.store.zusammen.datatypes.VersionEntity;
-import org.openecomp.core.utilities.json.JsonUtil;
-import org.openecomp.sdc.logging.api.Logger;
-import org.openecomp.sdc.logging.api.LoggerFactory;
-
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.nio.file.Paths;
-
-import static java.io.File.separator;
-import static org.openecomp.core.tools.Commands.exportdata.ImportProperties.JSON_POSTFIX;
-import static org.openecomp.core.tools.Commands.exportdata.ImportProperties.VERSION_FILE_PREFIX;
-
-public class VersionImport {
-    private static final Logger logger = LoggerFactory.getLogger(VersionImport.class);
-
-    public void loadPath(SessionContext sessionContext, Path versionDir , String versionId){
-        try {
-            Path versionPath = Paths.get(versionDir.toString() + separator + VERSION_FILE_PREFIX
-                    + versionId + JSON_POSTFIX);
-            if (!Files.exists(versionPath)) {
-                return;
-            }
-            String versionJson = new String(Files.readAllBytes(versionPath));
-            if (versionJson.trim().isEmpty()) {
-                return;
-            }
-            VersionEntity versionEntity = JsonUtil.json2Object(versionJson, VersionEntity.class);
-            VersionCassandraLoader versionCassandraLoader = new VersionCassandraLoader();
-            versionCassandraLoader.insertVersion(versionEntity);
-        } catch (Exception ex) {
-            logger.error(ex.getMessage(), ex);
-        }
-    }
-
-
-}
diff --git a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/importdata/VersionInfoImport.java b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/importdata/VersionInfoImport.java
deleted file mode 100644
index e9d4174..0000000
--- a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/importdata/VersionInfoImport.java
+++ /dev/null
@@ -1,41 +0,0 @@
-package org.openecomp.core.tools.Commands.importdata;
-
-import com.amdocs.zusammen.datatypes.SessionContext;
-import org.openecomp.core.tools.store.VersionInfoCassandraLoader;
-import org.openecomp.core.utilities.json.JsonUtil;
-import org.openecomp.sdc.logging.api.Logger;
-import org.openecomp.sdc.logging.api.LoggerFactory;
-import org.openecomp.sdc.versioning.dao.types.VersionInfoEntity;
-
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.nio.file.Paths;
-
-import static java.io.File.separator;
-import static org.openecomp.core.tools.Commands.exportdata.ImportProperties.JSON_POSTFIX;
-import static org.openecomp.core.tools.Commands.exportdata.ImportProperties.VERSION_INFO_FILE_PREFIX;
-
-public class VersionInfoImport {
-    private static final Logger logger = LoggerFactory.getLogger(VersionInfoImport.class);
-
-    public void loadPath(SessionContext sessionContext, Path itemPath, String itemId) {
-        try {
-             Path versionInfoFilePath = Paths.get(itemPath.toString() + separator + VERSION_INFO_FILE_PREFIX
-                    + itemId + JSON_POSTFIX);
-            if (!Files.exists(versionInfoFilePath)) {
-                return;
-            }
-            String versionInfoJson = new String(Files.readAllBytes(versionInfoFilePath));
-            if (versionInfoJson.trim().isEmpty()) {
-                return;
-            }
-            VersionInfoEntity versionInfoEntity = JsonUtil.json2Object(versionInfoJson, VersionInfoEntity.class);
-            VersionInfoCassandraLoader versionInfoCassandraLoader = new VersionInfoCassandraLoader();
-            versionInfoCassandraLoader.insertVersionInfo(versionInfoEntity);
-        } catch (Exception ex) {
-            logger.error(ex.getMessage(), ex);
-        }
-    }
-
-
-}
diff --git a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/concurrent/ItemHealingTask.java b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/concurrent/ItemHealingTask.java
index 39b62d4..878390f 100644
--- a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/concurrent/ItemHealingTask.java
+++ b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/concurrent/ItemHealingTask.java
@@ -1,13 +1,8 @@
 package org.openecomp.core.tools.concurrent;
 
-import org.openecomp.sdc.vendorsoftwareproduct.VendorSoftwareProductConstants;
+import org.openecomp.sdc.healing.api.HealingManager;
 import org.openecomp.sdc.vendorsoftwareproduct.VendorSoftwareProductManager;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspDetails;
-import org.openecomp.sdc.versioning.VersioningManager;
-import org.openecomp.sdc.versioning.VersioningUtil;
 import org.openecomp.sdc.versioning.dao.types.Version;
-import org.openecomp.sdc.versioning.types.VersionInfo;
-import org.openecomp.sdc.versioning.types.VersionableEntityAction;
 
 import java.util.concurrent.Callable;
 
@@ -17,55 +12,44 @@
 public class ItemHealingTask implements Callable<String> {
 
   private String itemId;
-  private String versionId;
-  private String user;
+  private Version version;
   private VendorSoftwareProductManager vspManager;
-  private VersioningManager versioningManager;
+  private HealingManager healingManager;
 
   public String getItemId() {
     return itemId;
   }
 
   public String getVersionId() {
-    return versionId;
+//    return version.getId();
+    return null;
   }
 
 
-  public ItemHealingTask(String itemId, String versionId, String user,
+  public ItemHealingTask(String itemId, String versionId,
                          VendorSoftwareProductManager vspManager,
-                         VersioningManager versioningManager) {
-    this.itemId = itemId;
-    this.versionId = versionId;
-    this.user = user;
-    this.versioningManager = versioningManager;
+                         HealingManager healingManager) {
+//    this.itemId = itemId;
+//    this.version = new Version(versionId);
     this.vspManager = vspManager;
+    this.healingManager = healingManager;
+
   }
 
   @Override
   public String call() throws Exception {
-
-    VersionInfo versionInfo = getVersionInfo(itemId, VersionableEntityAction.Read, user);
-    Version resolvedVersion = VersioningUtil.resolveVersion(Version.valueOf(versionId),
-        versionInfo, user);
-    VspDetails vspDetails = vspManager.getVsp(itemId, resolvedVersion, user);
-
-    try {
-      vspManager.callAutoHeal(itemId, versionInfo, vspDetails, user);
-
-    } catch (Exception e) {
-      return (String.format("healing failed on vsp: %s with id: %s, versionId: %s, resolved " +
-              "Version: %s, with message: %s",vspDetails.getName(),itemId,
-          versionId,resolvedVersion,e.getMessage()));
-    }
-
-    return String.format("healed vsp: %s, with id: %s, versionId:%s, resolved version: %s",
-        vspDetails.getName(), itemId, versionId,resolvedVersion );
-  }
-
-  private VersionInfo getVersionInfo(String vendorSoftwareProductId, VersionableEntityAction action,
-                                     String user) {
-    return versioningManager.getEntityVersionInfo(
-        VendorSoftwareProductConstants.VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE,
-        vendorSoftwareProductId, user, action);
+//    VspDetails vspDetails = vspManager.getVsp(itemId, version);
+//
+//    try {
+//      healingManager.healItemVersion(itemId, version, ItemType.vsp, true);
+//    } catch (Exception e) {
+//      return (String
+//          .format("healing failed on vsp: %s with id: %s, versionId: %s, with message: %s",
+//              vspDetails.getName(), itemId, version.getId(), e.getMessage()));
+//    }
+//
+//    return String.format("healed vsp: %s, with id: %s, versionId: %s",
+//        vspDetails.getName(), itemId, version.getId());
+    return null;
   }
 }
diff --git a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/exportinfo/ExportDataCommand.java b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/exportinfo/ExportDataCommand.java
new file mode 100644
index 0000000..5dcc72d
--- /dev/null
+++ b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/exportinfo/ExportDataCommand.java
@@ -0,0 +1,125 @@
+/**
+ * Copyright © 2016-2017 European Support Limited.
+ */
+package org.openecomp.core.tools.exportinfo;
+
+import com.amdocs.zusammen.datatypes.SessionContext;
+import com.datastax.driver.core.ResultSet;
+import com.datastax.driver.core.ResultSetFuture;
+import com.datastax.driver.core.Session;
+import com.google.common.collect.Sets;
+import com.google.common.util.concurrent.FutureCallback;
+import com.google.common.util.concurrent.Futures;
+import org.apache.commons.io.FileUtils;
+import org.openecomp.core.nosqldb.impl.cassandra.CassandraSessionFactory;
+import org.openecomp.core.tools.importinfo.ImportProperties;
+import org.openecomp.core.tools.util.Utils;
+import org.openecomp.core.tools.util.ZipUtils;
+import org.openecomp.core.zusammen.impl.CassandraConnectionInitializer;
+import org.openecomp.sdc.logging.api.Logger;
+import org.openecomp.sdc.logging.api.LoggerFactory;
+import org.yaml.snakeyaml.Yaml;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.CountDownLatch;
+import java.util.stream.Collectors;
+
+import static java.nio.file.Files.createDirectories;
+
+
+public class ExportDataCommand {
+    private static final Logger logger = LoggerFactory.getLogger(ExportDataCommand.class);
+    public static final String JOIN_DELIMITER = "$#";
+    public static final String JOIN_DELIMITER_SPILTTER = "\\$\\#";
+    public static final String MAP_DELIMITER = "!@";
+    public static final String MAP_DELIMITER_SPLITTER = "\\!\\@";
+    public static final String EXPORT_FILE_NAME = "ITEM_EXPORT";
+
+    public static void exportData(SessionContext sessionContext, String filterItem) {
+        try {
+            CassandraConnectionInitializer.setCassandraConnectionPropertiesToSystem();
+            final Set<String> filteredItems = Sets.newHashSet(filterItem);
+            Path rootDir = Paths.get(ImportProperties.ROOT_DIRECTORY);
+            initDir(rootDir);
+            Set<String> fis = filteredItems.stream().map(fi -> fi.replaceAll("\\r", "")).collect(Collectors.toSet());
+
+            Map<String, List<String>> queries;
+            Yaml yaml = new Yaml();
+            try (InputStream is = ExportDataCommand.class.getResourceAsStream("/queries.yaml")) {
+                queries = (Map<String, List<String>>) yaml.load(is);
+            }
+            List<String> queriesList = queries.get("queries");
+            List<String> itempsColumns = queries.get("item_columns");
+            Set<String> vlms = new HashSet<>();
+            CountDownLatch doneQueries = new CountDownLatch(queriesList.size());
+            for (int i = 0; i < queriesList.size(); i++) {
+                executeQuery(queriesList.get(i), fis, itempsColumns.get(i), vlms, doneQueries);
+            }
+            doneQueries.await();
+            if (!vlms.isEmpty()) {
+                CountDownLatch doneVmls = new CountDownLatch(queriesList.size());
+
+                for (int i = 0; i < queriesList.size(); i++) {
+                    executeQuery(queriesList.get(i), vlms, itempsColumns.get(i), null, doneVmls);
+                }
+
+                doneVmls.await();
+            }
+            zipPath(rootDir);
+            FileUtils.forceDelete(rootDir.toFile());
+        } catch (Exception ex) {
+            Utils.logError(logger, ex);
+        }
+
+    }
+
+
+    private static boolean executeQuery(final String query, final Set<String> filteredItems, final String filteredColumn,
+                                        final Set<String> vlms, final CountDownLatch donequerying) {
+        Session session = CassandraSessionFactory.getSession();
+        ResultSetFuture resultSetFuture = session.executeAsync(query);
+        Futures.addCallback(resultSetFuture, new FutureCallback<ResultSet>() {
+            @Override
+            public void onSuccess(ResultSet resultSet) {
+                new ExportSerializer().serializeResult(resultSet, filteredItems, filteredColumn, vlms);
+                donequerying.countDown();
+            }
+
+            @Override
+            public void onFailure(Throwable t) {
+                Utils.logError(logger, "Query failed :" + query, t);
+                donequerying.countDown();
+            }
+        });
+        return true;
+    }
+
+    private static void zipPath(Path rootDir) throws Exception {
+        LocalDateTime date = LocalDateTime.now();
+        DateTimeFormatter formatter = DateTimeFormatter.ISO_LOCAL_DATE_TIME;
+        String dateStr = date.format(formatter);
+        dateStr = dateStr.replaceAll(":", "_");
+        String zipFile = System.getProperty("user.home") + File.separatorChar + "onboarding_import" + dateStr + ".zip";
+        ZipUtils.createZip(zipFile, rootDir);
+        Utils.printMessage(logger, "Exported file :" + zipFile);
+    }
+
+
+    public static void initDir(Path rootDir) throws IOException {
+        if (rootDir.toFile().exists()) {
+            FileUtils.forceDelete(rootDir.toFile());
+        }
+        createDirectories(rootDir);
+    }
+
+}
\ No newline at end of file
diff --git a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/exportinfo/ExportSerializer.java b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/exportinfo/ExportSerializer.java
new file mode 100644
index 0000000..3c917b1
--- /dev/null
+++ b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/exportinfo/ExportSerializer.java
@@ -0,0 +1,152 @@
+/**
+ * Copyright © 2016-2017 European Support Limited.
+ */
+package org.openecomp.core.tools.exportinfo;
+
+import com.datastax.driver.core.DataType.Name;
+import com.datastax.driver.core.ResultSet;
+import com.datastax.driver.core.Row;
+import com.google.gson.JsonElement;
+import com.google.gson.JsonParser;
+import org.codehaus.jackson.map.ObjectMapper;
+import org.openecomp.core.tools.importinfo.ImportProperties;
+import org.openecomp.core.tools.model.ColumnDefinition;
+import org.openecomp.core.tools.model.TableData;
+import org.openecomp.core.tools.util.Utils;
+import org.openecomp.sdc.logging.api.Logger;
+import org.openecomp.sdc.logging.api.LoggerFactory;
+
+import java.io.File;
+import java.io.IOException;
+import java.nio.ByteBuffer;
+import java.nio.file.Paths;
+import java.util.ArrayList;
+import java.util.Base64;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.stream.Collectors;
+
+import static org.openecomp.core.tools.importinfo.ImportSingleTable.dataTypesMap;
+
+public class ExportSerializer {
+
+    private static final Logger logger = LoggerFactory.getLogger(ExportDataCommand.class);
+    private static final String ELEMENT_TABLE_NAME = "element";
+    private static final String ELEMENT_INFO_COLUMN_NAME = "info";
+
+    public void serializeResult(final ResultSet resultSet, final Set<String> filteredItems, final String filteredColumn, Set<String> vlms) {
+        try {
+            TableData tableData = new TableData();
+            tableData.definitions = resultSet.getColumnDefinitions().asList().stream().map(column -> new ColumnDefinition(column)).collect(Collectors.toList());
+            String table = tableData.definitions.iterator().next().getTable();
+            boolean isElementTable = table.equals(ELEMENT_TABLE_NAME);
+            Iterator<Row> iterator = resultSet.iterator();
+            iterator.forEachRemaining(row -> {
+                if (!filteredItems.contains(row.getString(filteredColumn))) {
+                    return;
+                }
+                List<String> rowData = new ArrayList<>();
+                for (int i = 0; i < tableData.definitions.size(); i++) {
+                    ColumnDefinition columnDefinition = tableData.definitions.get(i);
+                    Name name = dataTypesMap.get(columnDefinition.getType());
+                    boolean checkForVLM = isElementTable && columnDefinition.getName().equals(ELEMENT_INFO_COLUMN_NAME);
+                    Object data;
+                    data = convertByType(vlms, row, i, name, checkForVLM);
+                    rowData.add(data.toString());
+                }
+                tableData.rows.add(rowData);
+            });
+            ObjectMapper objectMapper = new ObjectMapper();
+            String fileName = ImportProperties.ROOT_DIRECTORY + File.separator + table + "_" + System.currentTimeMillis() + ".json";
+            objectMapper.writeValue(Paths.get(fileName).toFile(), tableData);
+            Utils.printMessage(logger, "File exported is :" + fileName);
+
+        } catch (IOException e) {
+            Utils.logError(logger, e);
+            System.exit(1);
+        }
+    }
+
+    private Object convertByType(Set<String> vlms, Row row, int i, Name name, boolean checkForVLM) {
+        Object data;
+        switch (name) {
+            case VARCHAR:
+            case TEXT:
+            case ASCII:
+                String string = row.getString(i);
+                if (string == null) {
+                    string = "";
+                }
+                if (checkForVLM && vlms != null){
+                    String vlm = extractVlm(string);
+                    if (vlm!= null) {
+                        vlms.add(vlm);
+                    }
+                }
+                data = Base64.getEncoder().encodeToString(string.getBytes());
+                break;
+            case BLOB:
+                ByteBuffer bytes = row.getBytes(i);
+                if (bytes == null) {
+                    bytes = ByteBuffer.wrap("".getBytes());
+                }
+                data = Base64.getEncoder().encodeToString(bytes.array());
+                break;
+            case TIMESTAMP:
+                data = row.getDate(i).getTime();
+                break;
+            case BOOLEAN:
+                data = row.getBool(i);
+                break;
+            case COUNTER:
+                data = row.getLong(i);
+                break;
+            case INT:
+                data = row.getInt(i);
+                break;
+            case FLOAT:
+                data = row.getFloat(i);
+                break;
+            case SET:
+                Set set = row.getSet(i, Object.class);
+                Object joined = set.stream().map(o -> o.toString()).collect(Collectors.joining(ExportDataCommand.JOIN_DELIMITER));
+                data = Base64.getEncoder().encodeToString(joined.toString().getBytes());
+                break;
+            case MAP:
+                Map<Object,Object> map = row.getMap(i, Object.class, Object.class);
+                Set<Map.Entry<Object,Object>> entrySet = map.entrySet();
+                Object mapAsString = entrySet.parallelStream().map(entry -> entry.getKey().toString() + ExportDataCommand.MAP_DELIMITER +entry.getValue().toString())
+                        .collect(Collectors.joining(ExportDataCommand.MAP_DELIMITER));
+                data = Base64.getEncoder().encodeToString(mapAsString.toString().getBytes());
+                break;
+            default:
+                throw new UnsupportedOperationException("Name is not supported :" + name);
+        }
+        return data;
+    }
+
+    protected String extractVlm(String injson) {
+        try {
+            if (injson == null){
+                return null;
+            }
+            JsonElement root = new JsonParser().parse(injson);
+            if (root == null){
+                return null;
+            }
+            JsonElement properties = root.getAsJsonObject().get("properties");
+            if (properties == null){
+                return null;
+            }
+            JsonElement vendorId = properties.getAsJsonObject().get("vendorId");
+            if (vendorId == null){
+                return null;
+            }
+            return vendorId.getAsString();
+        } catch (Exception ex){
+            return null;
+        }
+    }
+}
diff --git a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/importinfo/ImportDataCommand.java b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/importinfo/ImportDataCommand.java
new file mode 100644
index 0000000..bae6cfa
--- /dev/null
+++ b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/importinfo/ImportDataCommand.java
@@ -0,0 +1,37 @@
+package org.openecomp.core.tools.importinfo;
+
+
+import com.amdocs.zusammen.datatypes.SessionContext;
+import org.apache.commons.io.FileUtils;
+import org.openecomp.core.tools.exportinfo.ExportDataCommand;
+import org.openecomp.core.tools.util.Utils;
+import org.openecomp.core.tools.util.ZipUtils;
+import org.openecomp.core.zusammen.impl.CassandraConnectionInitializer;
+import org.openecomp.sdc.logging.api.Logger;
+import org.openecomp.sdc.logging.api.LoggerFactory;
+
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.stream.Stream;
+
+public class ImportDataCommand {
+
+    private static final Logger logger = LoggerFactory.getLogger(ImportDataCommand.class);
+
+    public static final void execute(SessionContext sessionContext, String uploadFile) {
+        try {
+            CassandraConnectionInitializer.setCassandraConnectionPropertiesToSystem();
+            Path outputFolder = Paths.get(ImportProperties.ROOT_DIRECTORY);
+            ExportDataCommand.initDir(outputFolder); //clear old imports.
+            ZipUtils.unzip(Paths.get(uploadFile), outputFolder);
+            try( Stream<Path> files = Files.list(outputFolder)) {
+                files.forEach(file -> new ImportSingleTable().importFile(file));
+            }
+            FileUtils.forceDelete(outputFolder.toFile()); // leaves directory clean
+        } catch (IOException e) {
+            Utils.logError(logger, e);
+        }
+    }
+}
diff --git a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/importinfo/ImportProperties.java b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/importinfo/ImportProperties.java
new file mode 100644
index 0000000..b9a27fa
--- /dev/null
+++ b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/importinfo/ImportProperties.java
@@ -0,0 +1,7 @@
+package org.openecomp.core.tools.importinfo;
+
+import java.io.File;
+
+public class ImportProperties {
+    public static final String ROOT_DIRECTORY = System.getProperty("user.home")+File.separator+ "onboarding_import";
+}
diff --git a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/importinfo/ImportSingleTable.java b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/importinfo/ImportSingleTable.java
new file mode 100644
index 0000000..7504ad1
--- /dev/null
+++ b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/importinfo/ImportSingleTable.java
@@ -0,0 +1,166 @@
+package org.openecomp.core.tools.importinfo;
+
+import com.datastax.driver.core.BoundStatement;
+import com.datastax.driver.core.DataType.Name;
+import com.datastax.driver.core.PreparedStatement;
+import com.datastax.driver.core.ResultSet;
+import com.datastax.driver.core.ResultSetFuture;
+import com.datastax.driver.core.Session;
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.ImmutableMap.Builder;
+import com.google.common.collect.Sets;
+import com.google.common.util.concurrent.FutureCallback;
+import com.google.common.util.concurrent.Futures;
+import org.apache.commons.lang3.StringUtils;
+import org.codehaus.jackson.map.ObjectMapper;
+import org.openecomp.core.nosqldb.impl.cassandra.CassandraSessionFactory;
+import org.openecomp.core.tools.exportinfo.ExportDataCommand;
+import org.openecomp.core.tools.model.ColumnDefinition;
+import org.openecomp.core.tools.model.TableData;
+import org.openecomp.core.tools.util.Utils;
+import org.openecomp.sdc.logging.api.Logger;
+import org.openecomp.sdc.logging.api.LoggerFactory;
+
+import java.io.IOException;
+import java.nio.ByteBuffer;
+import java.nio.file.Path;
+import java.util.Base64;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.stream.Collectors;
+
+public class ImportSingleTable {
+
+    private static final Logger logger = LoggerFactory.getLogger(ImportSingleTable.class);
+
+    public static final String INSERT_INTO = "INSERT INTO ";
+    public static final String VALUES = " VALUES ";
+    private static final Map<String, PreparedStatement> statementsCache = new HashMap<>();
+
+    public void importFile(Path file) {
+        try {
+            ObjectMapper objectMapper = new ObjectMapper();
+            TableData tableData = objectMapper.readValue(file.toFile(), TableData.class);
+            Session session = CassandraSessionFactory.getSession();
+            PreparedStatement ps = getPrepareStatement(tableData, session);
+            tableData.rows.parallelStream().forEach(row -> executeQuery(session, ps, tableData.definitions, row));
+        } catch (IOException e) {
+            Utils.logError(logger, e);
+        }
+
+    }
+
+    private PreparedStatement getPrepareStatement(TableData tableData, Session session) {
+        String query = createQuery(tableData);
+        if (statementsCache.containsKey(query)) {
+            return statementsCache.get(query);
+        }
+        PreparedStatement preparedStatement = session.prepare(query);
+        statementsCache.put(query, preparedStatement);
+        return preparedStatement;
+    }
+
+    private void executeQuery(Session session, PreparedStatement ps, List<ColumnDefinition> definitions, List<String> rows) {
+        BoundStatement bind = ps.bind();
+        for (int i = 0; i < definitions.size(); i++) {
+            ColumnDefinition columnDefinition = definitions.get(i);
+            String rowData = rows.get(i);
+            Name name = dataTypesMap.get(columnDefinition.getType());
+            handleByType(bind, i, rowData, name);
+        }
+        ResultSetFuture resultSetFuture = session.executeAsync(bind);
+        Futures.addCallback(resultSetFuture, new FutureCallback<ResultSet>() {
+            @Override
+            public void onSuccess(ResultSet resultSet) {
+                Utils.printMessage(logger, "successful write ");
+            }
+
+            @Override
+            public void onFailure(Throwable t) {
+                Utils.logError(logger, t);
+            }
+        });
+    }
+
+    private void handleByType(BoundStatement bind, int i, String rowData, Name name) {
+        switch (name) {
+            case VARCHAR:
+            case TEXT:
+            case ASCII:
+                bind.setString(i, new String(Base64.getDecoder().decode(rowData)));
+                break;
+            case BLOB:
+                bind.setBytes(i, ByteBuffer.wrap(Base64.getDecoder().decode(rowData.getBytes())));
+                break;
+            case TIMESTAMP:
+                bind.setDate(i, new Date(Long.parseLong(rowData)));
+                break;
+            case BOOLEAN:
+                bind.setBool(i, Boolean.parseBoolean(rowData));
+                break;
+            case COUNTER:
+                bind.setLong(i, Long.parseLong(rowData));
+                break;
+            case INT:
+                bind.setInt(i, Integer.parseInt(rowData));
+                break;
+            case FLOAT:
+                bind.setFloat(i, Float.parseFloat(rowData));
+                break;
+            case SET:
+                byte[] decoded = Base64.getDecoder().decode(rowData);
+                String decodedStr = new String(decoded);
+                if (!StringUtils.isEmpty(decodedStr)) {
+                    String[] splitted = decodedStr.split(ExportDataCommand.JOIN_DELIMITER_SPILTTER);
+                    Set set = Sets.newHashSet(splitted);
+                    set.remove("");
+                    bind.setSet(i, set);
+                } else {
+                    bind.setSet(i, null);
+                }
+                break;
+            case MAP:
+                byte[] decodedMap = Base64.getDecoder().decode(rowData);
+                String mapStr = new String(decodedMap);
+                if (!StringUtils.isEmpty(mapStr)) {
+                    String[] splittedMap = mapStr.split(ExportDataCommand.JOIN_DELIMITER_SPILTTER);
+                    Map<String, String> map = new HashMap<>();
+                    for (String keyValue : splittedMap) {
+                        String[] split = keyValue.split(ExportDataCommand.MAP_DELIMITER_SPLITTER);
+                        map.put(split[0], split[1]);
+                    }
+                    bind.setMap(i, map);
+                } else {
+                    bind.setMap(i, null);
+                }
+                break;
+            default:
+                throw new UnsupportedOperationException("Name is not supported :" + name);
+
+        }
+    }
+
+    private String createQuery(TableData tableData) {
+        ColumnDefinition def = tableData.definitions.iterator().next();
+        StringBuilder sb = new StringBuilder();
+        sb.append(INSERT_INTO).append(def.getKeyspace()).append(".").append(def.getTable());
+        sb.append(tableData.definitions.stream().map(definition -> definition.getName()).collect(Collectors.joining(" , ", " ( ", " ) ")));
+        sb.append(VALUES).append(tableData.definitions.stream().map(definition -> "?").collect(Collectors.joining(" , ", " ( ", " ) "))).append(";");
+        return sb.toString();
+    }
+
+    public static final ImmutableMap<String, Name> dataTypesMap;
+
+    static {
+        Builder<String, Name> builder = ImmutableMap.builder();
+        Name[] values = Name.values();
+        for (Name name : values) {
+            builder.put(name.name().toLowerCase(), name);
+        }
+        dataTypesMap = builder.build();
+    }
+
+}
diff --git a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/loaders/zusammen/VspGeneralLoader.java b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/loaders/zusammen/VspGeneralLoader.java
deleted file mode 100644
index d92866b..0000000
--- a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/loaders/zusammen/VspGeneralLoader.java
+++ /dev/null
@@ -1,40 +0,0 @@
-package org.openecomp.core.tools.loaders.zusammen;
-
-import com.amdocs.zusammen.datatypes.Id;
-import com.amdocs.zusammen.datatypes.SessionContext;
-import com.amdocs.zusammen.plugin.statestore.cassandra.dao.types.ElementEntityContext;
-import org.openecomp.core.zusammen.plugin.dao.impl.CassandraElementRepository;
-import org.openecomp.core.zusammen.plugin.dao.types.ElementEntity;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.impl.zusammen.StructureElement;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Optional;
-
-public class VspGeneralLoader {
-  public static Map<String, ElementEntity> load(SessionContext context,
-                                                Map<String, List<String>> vspItemVersionsMap) {
-    Map<String, ElementEntity> elementEntityMap = new HashMap<>();
-    System.setProperty("cassandra.dox.keystore", "zusammen_dox");
-    CassandraElementRepository cassandraElementRepository = new CassandraElementRepository();
-    for (Map.Entry<String, List<String>> entry : vspItemVersionsMap.entrySet()) {
-
-      for (String version : entry.getValue()) {
-
-        Optional<ElementEntity> result =
-            cassandraElementRepository.get(context, new ElementEntityContext(
-                    context.getUser().getUserName(),
-                    new Id(entry.getKey()),
-                    new Id(version)),
-                new ElementEntity(new Id(StructureElement.General.name())));
-        if (result.isPresent()) {
-          elementEntityMap.put(context.getUser().getUserName() + "_" + entry.getKey()
-              + "_" + version, result.get());
-        }
-      }
-    }
-
-    return elementEntityMap;
-  }
-}
diff --git a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/loaders/zusammen/VspItemLoader.java b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/loaders/zusammen/VspItemLoader.java
deleted file mode 100644
index 78b915c..0000000
--- a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/loaders/zusammen/VspItemLoader.java
+++ /dev/null
@@ -1,4 +0,0 @@
-package org.openecomp.core.tools.loaders.zusammen;
-
-public class VspItemLoader {
-}
diff --git a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/main/ZusammenMainTool.java b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/main/ZusammenMainTool.java
index b55d517..1829887 100644
--- a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/main/ZusammenMainTool.java
+++ b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/main/ZusammenMainTool.java
@@ -3,9 +3,9 @@
 import com.amdocs.zusammen.datatypes.SessionContext;
 import com.amdocs.zusammen.datatypes.UserInfo;
 import org.openecomp.core.tools.Commands.HealAll;
-import org.openecomp.core.tools.Commands.ImportCommand;
-import org.openecomp.core.tools.Commands.ExportDataCommand;
-import org.openecomp.core.tools.Commands.ResetOldVersion;
+import org.openecomp.core.tools.Commands.SetHealingFlag;
+import org.openecomp.core.tools.exportinfo.ExportDataCommand;
+import org.openecomp.core.tools.importinfo.ImportDataCommand;
 import org.openecomp.core.tools.util.ToolsUtil;
 import org.openecomp.sdc.logging.api.Logger;
 import org.openecomp.sdc.logging.api.LoggerFactory;
@@ -39,13 +39,13 @@
 
     switch (COMMANDS.valueOf(command)){
       case RESET_OLD_VERSION:
-        ResetOldVersion.reset(context,ToolsUtil.getParam("v",args),ToolsUtil.getParam("n",args));
+        SetHealingFlag.populateHealingTable(ToolsUtil.getParam("v",args));
         break;
       case EXPORT:
         ExportDataCommand.exportData(context,ToolsUtil.getParam("i",args));
         break;
       case IMPORT:
-        ImportCommand.importData(context, ToolsUtil.getParam("f",args),ToolsUtil.getParam("i",args));
+        ImportDataCommand.execute(context, ToolsUtil.getParam("f",args));
         break;
       case HEAL_ALL:
         HealAll.healAll(ToolsUtil.getParam("t",args));
diff --git a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/model/ColumnDefinition.java b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/model/ColumnDefinition.java
new file mode 100644
index 0000000..846392c
--- /dev/null
+++ b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/model/ColumnDefinition.java
@@ -0,0 +1,84 @@
+/**
+ * Copyright © 2016-2017 European Support Limited.
+ */
+package org.openecomp.core.tools.model;
+
+import com.datastax.driver.core.ColumnDefinitions.Definition;
+import com.datastax.driver.core.DataType;
+
+import java.util.Arrays;
+
+public class ColumnDefinition {
+
+    private String keyspace;
+    private String table;
+    private String name;
+    private String type;
+
+    public ColumnDefinition() {
+    }
+
+    public ColumnDefinition(String keyspace, String table, String name, DataType type) {
+        this.keyspace = keyspace;
+        this.table = table;
+        this.name = name;
+        this.type = type.getName().toString();
+    }
+
+    public ColumnDefinition(Definition definition) {
+        this(definition.getKeyspace(), definition.getTable(), definition.getName(), definition.getType());
+    }
+
+    /**
+     * The name of the keyspace this column is part of.
+     *
+     * @return the name of the keyspace this column is part of.
+     */
+    public String getKeyspace() {
+        return keyspace;
+    }
+
+    /**
+     * Returns the name of the table this column is part of.
+     *
+     * @return the name of the table this column is part of.
+     */
+    public String getTable() {
+        return table;
+    }
+
+    /**
+     * Returns the name of the column.
+     *
+     * @return the name of the column.
+     */
+    public String getName() {
+        return name;
+    }
+
+    /**
+     * Returns the type of the column.
+     *
+     * @return the type of the column.
+     */
+    public String getType() {
+        return type;
+    }
+
+    @Override
+    public final int hashCode() {
+        return Arrays.hashCode(new Object[]{keyspace, table, name, type});
+    }
+
+    @Override
+    public final boolean equals(Object o) {
+        if (!(o instanceof ColumnDefinition))
+            return false;
+
+        ColumnDefinition other = (ColumnDefinition) o;
+        return keyspace.equals(other.keyspace)
+                && table.equals(other.table)
+                && name.equals(other.name)
+                && type.equals(other.type);
+    }
+}
diff --git a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/model/TableData.java b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/model/TableData.java
new file mode 100644
index 0000000..155f35c
--- /dev/null
+++ b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/model/TableData.java
@@ -0,0 +1,12 @@
+/**
+ * Copyright © 2016-2017 European Support Limited.
+ */
+package org.openecomp.core.tools.model;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class TableData {
+    public List<ColumnDefinition> definitions = new ArrayList<>();
+    public List<List<String>> rows = new ArrayList<>();
+}
diff --git a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/store/CassandraElementRepository.java b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/store/CassandraElementRepository.java
index c41b46e..fcc67e1 100644
--- a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/store/CassandraElementRepository.java
+++ b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/store/CassandraElementRepository.java
@@ -34,7 +34,12 @@
 
 import java.lang.reflect.Type;
 import java.nio.ByteBuffer;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Objects;
+import java.util.Optional;
+import java.util.Set;
 import java.util.stream.Collectors;
 
 public class CassandraElementRepository {
@@ -61,18 +66,18 @@
                                      ElementEntity element) {
     Row row = getElementAccessor(context).get(
         elementContext.getSpace(),
-        elementContext.getItemId().toString(),
+        elementContext.getItemId().getValue(),
         getVersionId(elementContext),
-        element.getId().toString()).one();
+        element.getId().getValue()).one();
 
     return row == null ? Optional.empty() : Optional.of(getElementEntity(element, row));
   }
 
 
   private String getVersionId(ElementEntityContext elementContext) {
-    return elementContext.getChangeRef() == null
-        ? elementContext.getVersionId().toString()
-        : elementContext.getChangeRef();
+    return elementContext.getRevisionId() == null
+        ? elementContext.getVersionId().getValue()
+        : elementContext.getRevisionId().getValue();
   }
 
 
@@ -92,7 +97,7 @@
   private void updateElement(SessionContext context, ElementEntityContext elementContext,
                              ElementEntity element) {
 
-    if (elementContext.getChangeRef() == null) {
+    if (elementContext.getRevisionId() == null) {
 
       getElementAccessor(context).update(
           JsonUtil.object2Json(element.getInfo()),
@@ -113,7 +118,7 @@
           element.getVisualization(),
           elementContext.getSpace(),
           elementContext.getItemId().toString(),
-          elementContext.getChangeRef(),
+          elementContext.getRevisionId().getValue(),
           element.getId().toString());
     }
   }
@@ -154,7 +159,7 @@
         getVersionId(elementContext)).one();
     return row == null
         ? new HashSet<>()
-        : row.getSet(CassandraElementRepository.VersionElementsField.ELEMENT_IDS, String.class);
+        : row.getSet(VersionElementsField.ELEMENT_IDS, String.class);
   }
 
   /*
diff --git a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/store/ElementHandler.java b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/store/ElementHandler.java
index 5c72c95..d8929ea 100644
--- a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/store/ElementHandler.java
+++ b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/store/ElementHandler.java
@@ -2,7 +2,6 @@
 
 import com.amdocs.zusammen.datatypes.Id;
 import com.amdocs.zusammen.datatypes.SessionContext;
-import com.amdocs.zusammen.datatypes.item.ElementContext;
 import com.amdocs.zusammen.plugin.statestore.cassandra.dao.types.ElementEntityContext;
 import org.openecomp.core.zusammen.plugin.dao.types.ElementEntity;
 
@@ -11,23 +10,17 @@
     private static final String GLOBAL_USER = "GLOBAL_USER";
 
     public static void update(SessionContext context,
-                              String itemId, String versionId, String changeRef,
+                              String itemId, String versionId, String revisionId,
                               ElementEntity elementEntity) {
 
         ElementEntityContext elementContext;
         CassandraElementRepository cassandraElementRepository = new CassandraElementRepository();
-        if (changeRef == null) {
+        if (revisionId == null) {
 
             elementContext = new ElementEntityContext(GLOBAL_USER, new Id(itemId),
-                    new Id(versionId));
+                new Id(versionId));
 
-        } else {
-            elementContext = new ElementEntityContext(GLOBAL_USER, new ElementContext(new Id(itemId),
-                    new Id(versionId),
-                    changeRef));
         }
-        cassandraElementRepository.update(context, elementContext, elementEntity);
-
     }
 }
 
diff --git a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/store/HealingHandler.java b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/store/HealingHandler.java
new file mode 100644
index 0000000..78bbdf0
--- /dev/null
+++ b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/store/HealingHandler.java
@@ -0,0 +1,54 @@
+package org.openecomp.core.tools.store;
+
+import com.datastax.driver.core.ResultSet;
+import com.datastax.driver.mapping.annotations.Accessor;
+import com.datastax.driver.mapping.annotations.Query;
+import org.openecomp.core.nosqldb.api.NoSqlDb;
+import org.openecomp.core.nosqldb.factory.NoSqlDbFactory;
+import org.openecomp.core.tools.store.zusammen.datatypes.HealingEntity;
+
+import java.util.ArrayList;
+
+/**
+ * Created by ayalaben on 10/15/2017
+ */
+public class HealingHandler {
+
+  private static NoSqlDb nnoSqlDb = NoSqlDbFactory.getInstance().createInterface();
+  private static HealingAccessor accessor =
+      nnoSqlDb.getMappingManager().createAccessor(HealingAccessor.class);
+
+
+  public void populateHealingTable(ArrayList<HealingEntity> healingEntities) {
+    healingEntities.forEach(healingEntity -> {
+      if (isHealingRecordExist(healingEntity)) {
+        accessor.updateFlag(healingEntity.getHealingFlag(), healingEntity.getSpace(),
+            healingEntity.getItemId(), healingEntity.getVersionId());
+      } else {
+        accessor.create(healingEntity.getSpace(), healingEntity.getItemId(),
+            healingEntity.getVersionId(), healingEntity.getHealingFlag(),
+            healingEntity.getOldVersion());
+      }
+    });
+  }
+
+  private boolean isHealingRecordExist(HealingEntity healingEntity) {
+    return accessor.getFlag(healingEntity.getSpace(), healingEntity.getItemId(),
+        healingEntity.getVersionId()).getAvailableWithoutFetching() == 1;
+  }
+
+  @Accessor
+  interface HealingAccessor {
+
+    @Query("SELECT healing_needed FROM healing WHERE space=? AND item_id=? AND version_id=?")
+    ResultSet getFlag(String space, String itemId, String versionId);
+
+    @Query("Insert into healing (space, item_id, version_id, healing_needed, old_version) " +
+        "values (?,?,?,?,?)")
+    void create(String space, String itemId, String versionId, boolean flag, String oldVersion);
+
+    @Query("UPDATE healing SET healing_needed=? WHERE space=? AND item_id=? AND version_id=?")
+    void updateFlag(boolean flag, String space, String itemId, String versionId);
+  }
+
+}
\ No newline at end of file
diff --git a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/store/VersionCassandraLoader.java b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/store/VersionCassandraLoader.java
index 851e92d..fd9dc25 100644
--- a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/store/VersionCassandraLoader.java
+++ b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/store/VersionCassandraLoader.java
@@ -20,6 +20,7 @@
 
 package org.openecomp.core.tools.store;
 
+import com.datastax.driver.core.ResultSet;
 import com.datastax.driver.mapping.Mapper;
 import com.datastax.driver.mapping.Result;
 import com.datastax.driver.mapping.annotations.Accessor;
@@ -60,6 +61,8 @@
         return accessor.getAll();
     }
 
+    public ResultSet listItemVersion() { return accessor.getAllItemVersion();}
+
     @Accessor
     interface VersionAccessor {
 
@@ -74,5 +77,8 @@
         @Query("select * from zusammen_dox.version ")
         @QueryParameters(fetchSize = 400)
         Result<VersionEntity> getAll();
+
+        @Query("select space,item_id,version_id from zusammen_dox.version ")
+        ResultSet getAllItemVersion();
     }
 }
diff --git a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/store/VspGeneralLoader.java b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/store/VspGeneralLoader.java
index 1d9d2d9..b8620b8 100644
--- a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/store/VspGeneralLoader.java
+++ b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/store/VspGeneralLoader.java
@@ -4,14 +4,13 @@
 import com.amdocs.zusammen.datatypes.SessionContext;
 import com.amdocs.zusammen.datatypes.item.Info;
 import com.amdocs.zusammen.plugin.statestore.cassandra.dao.types.ElementEntityContext;
-import org.openecomp.core.zusammen.plugin.dao.impl.CassandraElementRepository;
 import org.openecomp.core.zusammen.plugin.dao.types.ElementEntity;
 
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
-import java.util.Optional;
 import java.util.Objects;
+import java.util.Optional;
 
 public class VspGeneralLoader {
 
@@ -56,24 +55,24 @@
 
     for (Map.Entry<String, List<String>> entry : vspItemChangeRefssMap.entrySet()) {
 
-      for (String changeRef : entry.getValue()) {
+      for (String revisionId : entry.getValue()) {
 
 
         itemId = new Id(entry.getKey());
 
-        entityId = getEntityIdByInfoNameValue(context, itemId, null, changeRef,null, NAME,
+        entityId = getEntityIdByInfoNameValue(context, itemId, null, revisionId,null, NAME,
                 GENERAL);
         if (entityId != null) {
           ElementEntityContext elementContext = new ElementEntityContext(
                   context.getUser().getUserName(),
                   itemId,
                   null);
-          elementContext.setChangeRef(changeRef);
+          elementContext.setRevisionId(new Id(revisionId));
           Optional<ElementEntity> result =
                   cassandraElementRepository.get(context, elementContext,
                           new ElementEntity(entityId));
           if (result.isPresent()) {
-            elementEntityMap.put(buildKey(context, entry, changeRef), result.get());
+            elementEntityMap.put(buildKey(context, entry, revisionId), result.get());
           }
         }
       }
@@ -90,7 +89,7 @@
   private static Id getEntityIdByInfoNameValue(SessionContext context,
                                                Id itemId,
                                                Id versionId,
-                                               String changeRef,
+                                               String revisionId,
                                                Id elementId,
                                                String name,
                                                String value) {
@@ -100,8 +99,8 @@
             context.getUser().getUserName(),
             itemId,
             versionId);
-    if (changeRef != null) {
-      elementContext.setChangeRef(changeRef);
+    if (revisionId != null) {
+      elementContext.setRevisionId(new Id(revisionId));
     }
     Optional<ElementEntity> result =
             cassandraElementRepository.get(context, elementContext,
@@ -113,8 +112,8 @@
                 context.getUser().getUserName(),
                 itemId,
                 versionId);
-        if(changeRef!= null){
-          subElementContext.setChangeRef(changeRef);
+        if(revisionId!= null){
+          subElementContext.setRevisionId(new Id(revisionId));
         }
         Optional<ElementEntity> subElementEntityOptional =
                 cassandraElementRepository.get(context, subElementContext,
diff --git a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/store/zusammen/datatypes/HealingEntity.java b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/store/zusammen/datatypes/HealingEntity.java
new file mode 100644
index 0000000..8c95f79
--- /dev/null
+++ b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/store/zusammen/datatypes/HealingEntity.java
@@ -0,0 +1,78 @@
+package org.openecomp.core.tools.store.zusammen.datatypes;
+
+import com.datastax.driver.mapping.annotations.Column;
+import com.datastax.driver.mapping.annotations.PartitionKey;
+import com.datastax.driver.mapping.annotations.Table;
+
+/**
+ * Created by ayalaben on 10/15/2017
+ */
+@Table(keyspace = "dox", name = "healing")
+public class HealingEntity {
+  @Column(name = "space")
+  @PartitionKey(0)
+  private String space;
+
+  @Column(name = "item_id")
+  @PartitionKey(1)
+  private String itemId;
+
+  @Column(name = "version_id")
+  @PartitionKey(2)
+  private String versionId;
+
+  @Column(name = "healing_needed")
+  private boolean healingFlag;
+
+  @Column(name = "old_version")
+  private String old_version;
+
+  public String getSpace() {
+    return space;
+  }
+
+  public void setSpace(String space) {
+    this.space = space;
+  }
+
+  public String getItemId() {
+    return itemId;
+  }
+
+  public void setItemId(String itemId) {
+    this.itemId = itemId;
+  }
+
+  public String getVersionId() {
+    return versionId;
+  }
+
+  public void setVersionId(String versionId) {
+    this.versionId = versionId;
+  }
+
+  public boolean getHealingFlag() {
+    return healingFlag;
+  }
+
+  public void setHealingFlag(boolean healingFlag) {
+    this.healingFlag = healingFlag;
+  }
+
+  public HealingEntity(String space, String itemId, String versionId, boolean healingFlag,String
+      oldVersion) {
+    this.space = space;
+    this.itemId = itemId;
+    this.versionId = versionId;
+    this.healingFlag = healingFlag;
+    this.old_version = oldVersion;
+  }
+
+  public String getOldVersion() {
+    return old_version;
+  }
+
+  public void setOldVersion(String old_version) {
+    this.old_version = old_version;
+  }
+}
\ No newline at end of file
diff --git a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/store/zusammen/datatypes/VersionEntity.java b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/store/zusammen/datatypes/VersionEntity.java
index c7280c8..946c05e 100644
--- a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/store/zusammen/datatypes/VersionEntity.java
+++ b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/store/zusammen/datatypes/VersionEntity.java
@@ -1,6 +1,8 @@
 package org.openecomp.core.tools.store.zusammen.datatypes;
 
-import com.datastax.driver.mapping.annotations.*;
+import com.datastax.driver.mapping.annotations.Column;
+import com.datastax.driver.mapping.annotations.PartitionKey;
+import com.datastax.driver.mapping.annotations.Table;
 
 import java.util.Date;
 
diff --git a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/util/Utils.java b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/util/Utils.java
index d1621ad..f48b212 100644
--- a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/util/Utils.java
+++ b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/util/Utils.java
@@ -3,13 +3,36 @@
 import org.openecomp.sdc.logging.api.Logger;
 
 /**
+ * Copyright © 2016-2017 European Support Limited.
  * @author Avrahamg
  * @since April 24, 2017
+ * Since it is a command line tools writing to console will be helpful to users.
  */
 public class Utils {
   public static void printMessage(Logger logger, String message) {
+    /**
+     * Since it is a command line tools writing to console will be helpful to users.
+     */
     System.out.println(message);
     logger.debug(message);
   }
+
+
+  public static void logError(Logger logger, Throwable ex) {
+    /**
+     * Since it is a command line tools writing to console will be helpful to users.
+     */
+    ex.printStackTrace();
+    logger.error(ex.getMessage(),ex);
+  }
+
+  public static void logError(Logger logger, String message, Throwable ex) {
+    /**
+     * Since it is a command line tools writing to console will be helpful to users.
+     */
+    System.out.println(message);
+    ex.printStackTrace();
+    logger.error(message,ex);
+  }
 }
 
diff --git a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/util/ZipUtils.java b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/util/ZipUtils.java
index 2f6693d..e0fd1a7 100644
--- a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/util/ZipUtils.java
+++ b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/util/ZipUtils.java
@@ -1,13 +1,17 @@
 package org.openecomp.core.tools.util;
 
 import com.google.common.io.ByteStreams;
+import org.openecomp.sdc.logging.api.Logger;
+import org.openecomp.sdc.logging.api.LoggerFactory;
 
+import java.io.BufferedOutputStream;
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.FileOutputStream;
 import java.io.IOException;
 import java.nio.file.Files;
 import java.nio.file.Path;
+import java.nio.file.Paths;
 import java.util.Objects;
 import java.util.Scanner;
 import java.util.Set;
@@ -17,12 +21,23 @@
 import java.util.zip.ZipOutputStream;
 
 public class ZipUtils {
-    public static void createZip(String zipFileName, Path dir, Set<String> filterItem) throws Exception {
+
+    private static final Logger logger = LoggerFactory.getLogger(ZipUtils.class);
+
+    public static void createZip(String zipFileName, Path dir) throws IOException {
         File dirObj = dir.toFile();
+        Path zippedFile = Files.createFile(Paths.get(zipFileName));
         try (
-                FileOutputStream fileOutputStream = new FileOutputStream(zipFileName);
-                ZipOutputStream out = new ZipOutputStream(fileOutputStream)) {
-            addDir(dirObj, out, dir.toString(), filterItem);
+                FileOutputStream fileOutputStream = new FileOutputStream(File.separator + zippedFile.toFile());
+                BufferedOutputStream bos = new BufferedOutputStream(fileOutputStream);
+                ZipOutputStream out = new ZipOutputStream(bos)) {
+            File[] files = dirObj.listFiles();
+            for (File file : files) {
+                out.putNextEntry(new ZipEntry(file.getName()));
+                Files.copy(Paths.get(file.getPath()), out);
+                out.closeEntry();
+            }
+            Utils.printMessage(logger, "Zip file was created " + zipFileName);
         }
     }
 
@@ -47,7 +62,7 @@
         for (int i = 0; i < files.length; i++) {
             if (files[i].isDirectory()) {
                 addDir(files[i], out, root, filterItem);
-                String filePath = files[i].getAbsolutePath().replace(root + File.separator, "") + "/";
+                String filePath = files[i].getAbsolutePath().replace(root + File.separator, "") + File.separator;
                 out.putNextEntry(new ZipEntry(filePath));
                 continue;
             }
@@ -57,7 +72,6 @@
                     out.putNextEntry(new ZipEntry(filePath));
                     try {
                         ByteStreams.copy(in, out);
-
                     } finally {
                         out.closeEntry();
                     }
@@ -71,7 +85,7 @@
         if (zipFile == null || outputFolder == null) {
             return;
         }
-        if (!Files.exists(outputFolder)) {
+        if (!outputFolder.toFile().exists()) {
             Files.createDirectories(outputFolder);
         }
 
@@ -83,7 +97,7 @@
                 File newFile = new File(outputFolder.toString() + File.separator + fileName);
                 if (ze.isDirectory()) {
                     Path path = newFile.toPath();
-                    if (!Files.exists(path)) {
+                    if (!path.toFile().exists()) {
                         Files.createDirectories(path);
                     }
                 } else {
diff --git a/openecomp-be/tools/zusammen-tools/src/main/resources/logback.xml b/openecomp-be/tools/zusammen-tools/src/main/resources/logback.xml
index a13dc82..2461aed 100644
--- a/openecomp-be/tools/zusammen-tools/src/main/resources/logback.xml
+++ b/openecomp-be/tools/zusammen-tools/src/main/resources/logback.xml
@@ -1,5 +1,6 @@
 <configuration>
 
+
     <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
         <!-- encoders are assigned the type
              ch.qos.logback.classic.encoder.PatternLayoutEncoder by default -->
diff --git a/openecomp-be/tools/zusammen-tools/src/main/resources/queries.yaml b/openecomp-be/tools/zusammen-tools/src/main/resources/queries.yaml
new file mode 100644
index 0000000..a93a5a4
--- /dev/null
+++ b/openecomp-be/tools/zusammen-tools/src/main/resources/queries.yaml
@@ -0,0 +1,16 @@
+queries:
+  - select * from zusammen_dox.element;
+  - select * from zusammen_dox.element_namespace;
+  - select * from zusammen_dox.item;
+  - select * from zusammen_dox.version;
+  - select * from zusammen_dox.version_elements;
+  - select * from dox.item_permissions;
+  - select * from dox.vsp_merge_hint ;
+item_columns:
+  - item_id
+  - item_id
+  - item_id
+  - item_id
+  - item_id
+  - item_id
+  - item_id
\ No newline at end of file
diff --git a/openecomp-be/tools/zusammen-tools/src/test/java/org/openecomp/core/tools/Commands/exportinfo/serialize/VLMExtractTest.java b/openecomp-be/tools/zusammen-tools/src/test/java/org/openecomp/core/tools/Commands/exportinfo/serialize/VLMExtractTest.java
new file mode 100644
index 0000000..7b43c46
--- /dev/null
+++ b/openecomp-be/tools/zusammen-tools/src/test/java/org/openecomp/core/tools/Commands/exportinfo/serialize/VLMExtractTest.java
@@ -0,0 +1,48 @@
+package org.openecomp.core.tools.Commands.exportinfo.serialize;
+
+import org.openecomp.core.tools.exportinfo.ExportSerializer;
+import org.testng.annotations.Test;
+
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertNotNull;
+import static org.testng.Assert.assertNull;
+public class VLMExtractTest {
+
+
+
+    @Test
+    public void extractVLM(){
+        String vlmId = "979a56c7b2fa41e6a5742137f53a5c1b";
+        String elemenet_info_string = "{\n" +
+                "  \"name\": \"VendorSoftwareProduct\",\n" +
+                "  \"properties\": {\n" +
+                "    \"subCategory\": \"resourceNewCategory.dcae component.collector\",\n" +
+                "    \"name\": \"vsp1\",\n" +
+                "    \"icon\": \"icon\",\n" +
+                "    \"onboardingMethod\": \"NetworkPackage\",\n" +
+                "    \"description\": \"d\",\n" +
+                "    \"vendorId\": \""+vlmId+"\",\n" +
+                "    \"category\": \"resourceNewCategory.dcae component\",\n" +
+                "    \"vendorName\": \"vlm1\",\n" +
+                "    \"elementType\": \"VendorSoftwareProduct\"\n" +
+                "  }\n" +
+                "}\n"    ;
+        String extractedVlmId = new CustomExportSerializer().extractVlm(elemenet_info_string);
+        assertNotNull(extractedVlmId);
+        assertEquals(extractedVlmId,vlmId);
+
+    }
+
+    @Test
+    public void failToExtractVLMBecauseJsonIsCorrupted(){
+        String elemenet_info_string = "gfhhhghgh";
+        String extractedVlmId = new CustomExportSerializer().extractVlm(elemenet_info_string);
+        assertNull(extractedVlmId);
+    }
+
+    private static final class CustomExportSerializer extends ExportSerializer{
+        public String extractVlm(String injson) {
+            return super.extractVlm(injson);
+        }
+    }
+}
diff --git a/openecomp-be/tools/zusammen-tools/src/test/resources/configuration.yaml b/openecomp-be/tools/zusammen-tools/src/test/resources/configuration.yaml
new file mode 100644
index 0000000..6636e20
--- /dev/null
+++ b/openecomp-be/tools/zusammen-tools/src/test/resources/configuration.yaml
@@ -0,0 +1,251 @@
+identificationHeaderFields:
+   - HTTP_IV_USER
+   - HTTP_CSP_FIRSTNAME
+   - HTTP_CSP_LASTNAME
+   - HTTP_IV_REMOTE_ADDRESS
+   - HTTP_CSP_WSTYPE
+
+
+
+# catalog backend http port
+beHttpPort: 8080
+
+# catalog backend http context
+beContext: /sdc/rest/config/get
+
+# catalog backend protocol
+beProtocol: http
+
+# catalog backend ssl port
+beSslPort: 8443
+
+version: 1.0
+released: 2012-11-30
+
+titanCfgFile: /home/vagrant/catalog-be/config/catalog-be/titan.properties
+titanInMemoryGraph: false
+titanLockTimeout: 30
+titanReconnectIntervalInSeconds: 3
+titanHealthCheckReadTimeout: 1
+esReconnectIntervalInSeconds: 3
+uebHealthCheckReconnectIntervalInSeconds: 15
+uebHealthCheckReadTimeout: 4
+
+# Protocols
+protocols:
+   - http
+   - https
+
+# Users
+users:
+    tom: passwd
+    bob: passwd
+
+neo4j:
+    host: neo4jhost
+    port: 7474
+    user: neo4j
+    password: "12345"
+
+cassandraConfig:
+    cassandraHosts: ['localhost']
+    reconnectTimeout : 30000
+    authenticate: true
+    username: asdc_user
+    password: password
+    ssl: false
+    truststorePath : /path/path
+    truststorePassword : password
+    keySpaces:
+        - { name: dox, replicationStrategy: SimpleStrategy, replicationInfo: ['1']}
+        - { name:  zusammen_dox, replicationStrategy: SimpleStrategy, replicationInfo: ['1']}
+        - { name: sdcartifact, replicationStrategy: SimpleStrategy, replicationInfo: ['1']}
+
+#Application-specific settings of ES
+elasticSearch:
+    # Mapping of index prefix to time-based frame. For example, if below is configured:
+    #
+    # - indexPrefix: auditingevents
+    #    creationPeriod: minute
+    #
+    # then ES object of type which is mapped to "auditingevents-*" template, and created on 2015-12-23 13:24:54, will enter "auditingevents-2015-12-23-13-24" index.
+    # Another object created on 2015-12-23 13:25:54, will enter "auditingevents-2015-12-23-13-25" index.
+    # If creationPeriod: month, both of the above will enter "auditingevents-2015-12" index.
+    #
+    # PLEASE NOTE: the timestamps are created in UTC/GMT timezone! This is needed so that timestamps will be correctly presented in Kibana.
+    #
+    # Legal values for creationPeriod - year, month, day, hour, minute, none (meaning no time-based behaviour).
+    #
+    # If no creationPeriod is configured for indexPrefix, default behavour is creationPeriod: month.
+
+    indicesTimeFrequency:
+      - indexPrefix: auditingevents
+        creationPeriod: month
+      - indexPrefix: monitoring_events
+        creationPeriod: month
+
+artifactTypes:
+   - CHEF
+   - PUPPET
+   - SHELL
+   - YANG
+   - YANG_XML
+   - HEAT
+   - BPEL
+   - DG_XML
+   - MURANO_PKG
+   - OTHER
+
+licenseTypes:
+   - User
+   - Installation
+   - CPU
+
+#Deployment artifacts placeHolder
+deploymentResourceArtifacts:
+  heat:
+      displayName: "HEAT Template"
+      type: HEAT
+
+deploymentResourceInstanceArtifacts:
+  heatEnv:
+      displayName: "HEAT ENV"
+      type: HEAT_ENV
+      description: "Auto-generated HEAT Environment deployment artifact"
+      fileExtension: "env"
+
+#Informational artifacts placeHolder
+excludeResourceCategory:
+  - Generic
+informationalResourceArtifacts:
+  features:
+      displayName: Features
+      type: OTHER
+  capacity:
+      displayName: Capacity
+      type: OTHER
+  vendorTestResult:
+      displayName: Vendor Test Result
+      type: OTHER
+  testScripts:
+      displayName: Test Scripts
+      type: OTHER
+  cloudQuestionnaire:
+      displayName: Cloud Questionnaire (completed)
+      type: OTHER
+  HEATTemplateFromVendor:
+      displayName: HEAT Template from Vendor
+      type: HEAT
+
+excludeServiceCategory:
+
+informationalServiceArtifacts:
+  messageFlows:
+      displayName: Message Flows
+      type: OTHER
+  instantiationFlows:
+      displayName: Management Flows
+      type: OTHER
+  serviceArtifactPlan:
+      displayName: Service Artifact Plan
+      type: OTHER
+  summaryOfImpactsToECOMPElements:
+      displayName: Summary of impacts to OPENECOMP elements,OSSs, BSSs
+      type: OTHER
+  controlLoopFunctions:
+      displayName: Control Loop Functions
+      type: OTHER
+  dimensioningInfo:
+      displayName: Dimensioning Info
+      type: OTHER
+  affinityRules:
+      displayName: Affinity Rules
+      type: OTHER
+  operationalPolicies:
+      displayName: Operational Policies
+      type: OTHER
+  serviceSpecificPolicies:
+      displayName: Service-specific Policies
+      type: OTHER
+  engineeringRules:
+      displayName: Engineering Rules (ERD)
+      type: OTHER
+  distributionInstructions:
+      displayName: Distribution Instructions
+      type: OTHER
+  certificationTestResults:
+      displayName: TD Certification Test Results
+      type: OTHER
+  deploymentVotingRecord:
+      displayName: Deployment Voting Record
+      type: OTHER
+  serviceQuestionnaire:
+      displayName: Service Questionnaire
+      type: OTHER
+
+serviceApiArtifacts:
+  configuration:
+      displayName: Configuration
+      type: OTHER
+  instantiation:
+      displayName: Instantiation
+      type: OTHER
+  monitoring:
+      displayName: Monitoring
+      type: OTHER
+  reporting:
+      displayName: Reporting
+      type: OTHER
+  logging:
+      displayName: Logging
+      type: OTHER
+  testing:
+      displayName: Testing
+      type: OTHER
+
+
+additionalInformationMaxNumberOfKeys: 50
+
+systemMonitoring:
+    enabled: false
+    isProxy: false
+    probeIntervalInSeconds: 15
+
+defaultHeatArtifactTimeoutMinutes: 60
+
+serviceDeploymentArtifacts:
+
+resourceDeploymentArtifacts:
+    HEAT:
+        acceptedTypes:
+            - yaml
+            - yml
+
+resourceInformationalDeployedArtifacts:
+    YANG_XML:
+        acceptedTypes:
+            - xml
+
+
+unLoggedUrls:
+   - /sdc2/rest/healthCheck
+
+cleanComponentsConfiguration:
+    cleanIntervalInMinutes: 1440
+    componentsToClean:
+       - Resource
+
+artifactsIndex: resources
+
+heatEnvArtifactHeader:
+    " # _______________________________________________________________________________________________________________________________________\n
+  #|                                    					    AT&T Proprietary (Restricted)           								 	  |\n
+  #|                                     Only for use by authorized individuals or any above-designated team(s)                            |\n
+  #|                                          within the AT&T companies and not for general distribution      							  |\n
+  #|_______________________________________________________________________________________________________________________________________|\n"
+heatEnvArtifactFooter:
+    " # _______________________________________________________________________________________________________________________________________\n
+  #|                                    					    AT&T Proprietary (Restricted)           								 	  |\n
+  #|                                     Only for use by authorized individuals or any above-designated team(s)                            |\n
+  #|                                          within the AT&T companies and not for general distribution      							  |\n
+  #|_______________________________________________________________________________________________________________________________________|\n"
diff --git a/openecomp-be/tools/zusammen-tools/src/test/resources/queries.yaml b/openecomp-be/tools/zusammen-tools/src/test/resources/queries.yaml
new file mode 100644
index 0000000..6ca8cd6
--- /dev/null
+++ b/openecomp-be/tools/zusammen-tools/src/test/resources/queries.yaml
@@ -0,0 +1,16 @@
+queries:
+  - select * from zusammen_dox.element;
+  - select * from zusammen_dox.element_namespace;
+  - select * from zusammen_dox.item;
+  - select * from zusammen_dox.version;
+  - select * from zusammen_dox.version_elements;
+  - select * from dox.item_permissions;
+  - select * from dox.vsp_merge_hint;
+item_columns:
+  - item_id
+  - item_id
+  - item_id
+  - item_id
+  - item_id
+  - item_id
+  - item_id
\ No newline at end of file
