@Override
  @Transactional
  public void copyAllObjects(Class originEntityClass, Class currentEntityClass, EntityConverter entityConverter)
      throws ViewDataMigrationException {
    try{
      for (Object origInstance : getOriginDataStore().findAll(originEntityClass, null)) {
        Object newInstance = currentEntityClass.newInstance();
        entityConverter.convert(origInstance, newInstance);
        getCurrentDataStore().store(newInstance);
      }
    } catch (PersistenceException | InstantiationException | IllegalAccessException e) {
      String msg = "Error occured during copying data. Persistence entities are not compatible.";
      LOG.error(msg);
      throw new ViewDataMigrationException(msg, e);
    }
  }
Instantiates the data store associated with the instance.

@param instanceDefinition the view instance definition
@return the data store object associated with view instance
ambari-server/src/main/java/org/apache/ambari/server/view/ViewDataMigrationContextImpl.java