diff --git a/datastore_server/source/java/ch/ethz/sis/openbis/generic/server/dss/plugins/DataSetRegistrationTask.java b/datastore_server/source/java/ch/ethz/sis/openbis/generic/server/dss/plugins/DataSetRegistrationTask.java
index e3a590c3b243391d980b4fe8980e2cc14b2c410a..8a340cb501b6a1e3a6112f86f2becfe7b9eab6f6 100644
--- a/datastore_server/source/java/ch/ethz/sis/openbis/generic/server/dss/plugins/DataSetRegistrationTask.java
+++ b/datastore_server/source/java/ch/ethz/sis/openbis/generic/server/dss/plugins/DataSetRegistrationTask.java
@@ -69,6 +69,15 @@ import org.xml.sax.SAXException;
 
 import ch.ethz.sis.openbis.generic.asapi.v3.IApplicationServerApi;
 import ch.ethz.sis.openbis.generic.asapi.v3.dto.common.search.SearchResult;
+import ch.ethz.sis.openbis.generic.asapi.v3.dto.dataset.delete.DataSetDeletionOptions;
+import ch.ethz.sis.openbis.generic.asapi.v3.dto.dataset.id.DataSetPermId;
+import ch.ethz.sis.openbis.generic.asapi.v3.dto.deletion.id.IDeletionId;
+import ch.ethz.sis.openbis.generic.asapi.v3.dto.experiment.delete.ExperimentDeletionOptions;
+import ch.ethz.sis.openbis.generic.asapi.v3.dto.experiment.id.ExperimentPermId;
+import ch.ethz.sis.openbis.generic.asapi.v3.dto.project.delete.ProjectDeletionOptions;
+import ch.ethz.sis.openbis.generic.asapi.v3.dto.project.id.ProjectPermId;
+import ch.ethz.sis.openbis.generic.asapi.v3.dto.sample.delete.SampleDeletionOptions;
+import ch.ethz.sis.openbis.generic.asapi.v3.dto.sample.id.SamplePermId;
 import ch.ethz.sis.openbis.generic.dssapi.v3.IDataStoreServerApi;
 import ch.ethz.sis.openbis.generic.dssapi.v3.dto.datasetfile.DataSetFile;
 import ch.ethz.sis.openbis.generic.dssapi.v3.dto.datasetfile.download.DataSetFileDownload;
@@ -77,12 +86,15 @@ import ch.ethz.sis.openbis.generic.dssapi.v3.dto.datasetfile.download.DataSetFil
 import ch.ethz.sis.openbis.generic.dssapi.v3.dto.datasetfile.fetchoptions.DataSetFileFetchOptions;
 import ch.ethz.sis.openbis.generic.dssapi.v3.dto.datasetfile.id.IDataSetFileId;
 import ch.ethz.sis.openbis.generic.dssapi.v3.dto.datasetfile.search.DataSetFileSearchCriteria;
+import ch.ethz.sis.openbis.generic.server.EntityRetriever;
 import ch.ethz.sis.openbis.generic.server.dss.plugins.ResourceListParserData.Connection;
 import ch.ethz.sis.openbis.generic.server.dss.plugins.ResourceListParserData.DataSetWithConnections;
 import ch.ethz.sis.openbis.generic.server.dss.plugins.ResourceListParserData.ExperimentWithConnections;
 import ch.ethz.sis.openbis.generic.server.dss.plugins.ResourceListParserData.MaterialWithLastModificationDate;
 import ch.ethz.sis.openbis.generic.server.dss.plugins.ResourceListParserData.ProjectWithConnections;
 import ch.ethz.sis.openbis.generic.server.dss.plugins.ResourceListParserData.SampleWithConnections;
+import ch.ethz.sis.openbis.generic.shared.entitygraph.EntityGraph;
+import ch.ethz.sis.openbis.generic.shared.entitygraph.Node;
 import ch.systemsx.cisd.common.concurrent.ITaskExecutor;
 import ch.systemsx.cisd.common.concurrent.ParallelizedExecutor;
 import ch.systemsx.cisd.common.exceptions.ConfigurationFailureException;
@@ -625,18 +637,13 @@ public class DataSetRegistrationTask<T extends DataSetInformation> implements IM
             data = parser.parseResourceListDocument(doc);
 
             // go through the resources returned by the parser and decide on add/update/delete operations
-            Map<String, ProjectWithConnections> projectsToProcess = data.projectsToCreate;
-            Map<String, ExperimentWithConnections> experimentsToProcess = data.experimentsToCreate;
-            Map<String, SampleWithConnections> samplesToProcess = data.samplesToCreate;
-            Map<String, DataSetWithConnections> dataSetsToProcess = data.datasetsToCreate;
-            List<MaterialWithLastModificationDate> materialsToProcess = data.materialsToCreate;
+            Map<String, ProjectWithConnections> projectsToProcess = data.projectsToProcess;
+            Map<String, ExperimentWithConnections> experimentsToProcess = data.experimentsToProcess;
+            Map<String, SampleWithConnections> samplesToProcess = data.samplesToProcess;
+            Map<String, DataSetWithConnections> dataSetsToProcess = data.datasetsToProcess;
+            List<MaterialWithLastModificationDate> materialsToProcess = data.materialsToProcess;
 
             AtomicEntityOperationDetailsBuilder builder = new AtomicEntityOperationDetailsBuilder();
-
-            // EntityRetriever entityRetriever =
-            // EntityRetriever.createWithSessionToken(ServiceProvider.getV3ApplicationService(), ServiceProvider.getOpenBISService()
-            // .getSessionToken());
-            // EntityGraph<Node<?>> harvesterEntityGraph = entityRetriever.getEntityGraph(harvesterSpace);
                     
             processProjects(projectsToProcess, experimentsToProcess, builder);
         
@@ -772,7 +779,10 @@ public class DataSetRegistrationTask<T extends DataSetInformation> implements IM
             operationResult = service.performEntityOperations(builder.getDetails());
             System.err.println("entity operation result: " + operationResult);
 
-            operationLog.info("Saving the timestamp of synn start into file");
+            operationLog.info("Processing deletions");
+            processDeletions(data);
+
+            operationLog.info("Saving the timestamp of sync start to file");
             saveSyncTimestamp();
 
             operationLog.info("Done and dusted...");
@@ -785,6 +795,92 @@ public class DataSetRegistrationTask<T extends DataSetInformation> implements IM
         }
     }
 
+    private void processDeletions(ResourceListParserData data)
+    {
+        String sessionToken = ServiceProvider.getOpenBISService().getSessionToken();
+        EntityRetriever entityRetriever =
+                EntityRetriever.createWithSessionToken(ServiceProvider.getV3ApplicationService(), sessionToken);
+
+        Set<String> incomingProjectPermIds = data.projectsToProcess.keySet();
+        Set<String> incomingExperimentPermIds = data.experimentsToProcess.keySet();
+        Set<String> incomingSamplePermIds = data.samplesToProcess.keySet();
+        Set<String> incomingDataSetCodes = data.datasetsToProcess.keySet();
+
+        // find projects, experiments, samples and data sets to be deleted
+        List<ProjectPermId> projectPermIds = new ArrayList<ProjectPermId>();
+        List<ExperimentPermId> experimentPermIds = new ArrayList<ExperimentPermId>();
+        List<SamplePermId> samplePermIds = new ArrayList<SamplePermId>();
+        List<DataSetPermId> dsPermIds = new ArrayList<DataSetPermId>();
+
+        for (String harvesterSpaceId : spaceMappings.values())
+        {
+            EntityGraph<Node<?>> harvesterEntityGraph = entityRetriever.getEntityGraph(harvesterSpaceId);
+            List<Node<?>> entities = harvesterEntityGraph.getNodes();
+            for (Node<?> entity : entities)
+            {
+                if (entity.getEntityKind().equals("PROJECT"))
+                {
+                    if (incomingProjectPermIds.contains(entity.getPermId()) == false)
+                    {
+                        projectPermIds.add(new ProjectPermId(entity.getPermId()));
+                    }
+                }
+                else if (entity.getEntityKind().equals("EXPERIMENT"))
+                {
+                    if (incomingExperimentPermIds.contains(entity.getPermId()) == false)
+                    {
+                        experimentPermIds.add(new ExperimentPermId(entity.getPermId()));
+                    }
+                }
+                else if (entity.getEntityKind().equals("SAMPLE"))
+                {
+                    if (incomingSamplePermIds.contains(entity.getPermId()) == false)
+                    {
+                        samplePermIds.add(new SamplePermId(entity.getPermId()));
+                    }
+                }
+                else if (entity.getEntityKind().equals("DATA_SET"))
+                {
+                    if (incomingDataSetCodes.contains(entity.getPermId()) == false)
+                    {
+                        dsPermIds.add(new DataSetPermId(entity.getPermId()));
+                    }
+                }
+            }
+        }
+
+        IApplicationServerApi v3Api = ServiceProvider.getV3ApplicationService();
+
+        // delete data sets
+        DataSetDeletionOptions dsDeletionOpts = new DataSetDeletionOptions();
+        dsDeletionOpts.setReason("sync data set deletions"); // TODO maybe mention data source space id in the reason
+
+        IDeletionId dsDeletionId =
+                v3Api.deleteDataSets(sessionToken, dsPermIds, dsDeletionOpts);
+
+        // delete samples
+        SampleDeletionOptions deletionOptions = new SampleDeletionOptions();
+        deletionOptions.setReason("sync sample deletions");
+        IDeletionId smpDeletionId = v3Api.deleteSamples(sessionToken, samplePermIds, deletionOptions);
+
+        // delete experiments
+
+        ExperimentDeletionOptions expDeletionOpts = new ExperimentDeletionOptions();
+        expDeletionOpts.setReason("sync experiment deletions");
+        IDeletionId expDeletionId = v3Api.deleteExperiments(sessionToken, experimentPermIds, expDeletionOpts);
+
+        // delete projects
+        ProjectDeletionOptions prjDeletionOpts = new ProjectDeletionOptions();
+        prjDeletionOpts.setReason("Sync projects");
+        v3Api.deleteProjects(sessionToken, projectPermIds, prjDeletionOpts);
+
+        // confirm deletions
+        // TODO confirm
+        // v3Api.confirmDeletions(sessionToken, Arrays.asList(expDeletionId, dsDeletionId, smpDeletionId));
+
+        // TODO sync material deletions
+    }
+
     private void saveSyncTimestamp()
     {
         newLastSyncTimeStampFile.renameTo(lastSyncTimestampFile);
diff --git a/datastore_server/source/java/ch/ethz/sis/openbis/generic/server/dss/plugins/ResourceListParser.java b/datastore_server/source/java/ch/ethz/sis/openbis/generic/server/dss/plugins/ResourceListParser.java
index 296b79fa4dd18875de22c61e2446632777e51f04..ffa4720b0d50cc0a4dcd396ba33dc9b1a07cd596 100644
--- a/datastore_server/source/java/ch/ethz/sis/openbis/generic/server/dss/plugins/ResourceListParser.java
+++ b/datastore_server/source/java/ch/ethz/sis/openbis/generic/server/dss/plugins/ResourceListParser.java
@@ -292,7 +292,7 @@ public class ResourceListParser
             }
         }
         DataSetWithConnections newDsWithConns = data.new DataSetWithConnections(ds, lastModificationDate);
-        data.datasetsToCreate.put(permId, newDsWithConns);
+        data.datasetsToProcess.put(permId, newDsWithConns);
         newDsWithConns.setConnections(parseConnections(xpath, xdNode));
         ds.setDataSetProperties(parseDataSetProperties(xpath, xdNode));
     }
@@ -325,7 +325,7 @@ public class ResourceListParser
         newProject.setPermID(permId);
         ProjectWithConnections newPrjWithConns =
                 data.new ProjectWithConnections(newProject, lastModificationDate);
-        data.projectsToCreate.put(permId, newPrjWithConns);
+        data.projectsToProcess.put(permId, newPrjWithConns);
         newPrjWithConns.setConnections(parseConnections(xpath, xdNode));
     }
 
@@ -336,7 +336,7 @@ public class ResourceListParser
         NewMaterialWithType newMaterial = new NewMaterialWithType(code, type);
         MaterialWithLastModificationDate materialWithLastModDate =
                 data.new MaterialWithLastModificationDate(newMaterial, lastModificationDate);
-        data.materialsToCreate.add(materialWithLastModDate);
+        data.materialsToProcess.add(materialWithLastModDate);
         newMaterial.setProperties(parseProperties(xpath, xdNode));
     }
 
@@ -423,7 +423,7 @@ public class ResourceListParser
         NewExperiment newExp = new NewExperiment("/" + spaceMappings.get(space) + "/" + project + "/" + code, type);
         newExp.setPermID(permId);
         ExperimentWithConnections newExpWithConns = data.new ExperimentWithConnections(newExp, lastModificationDate);
-        data.experimentsToCreate.put(permId, newExpWithConns);
+        data.experimentsToProcess.put(permId, newExpWithConns);
         newExpWithConns.setConnections(parseConnections(xpath, xdNode));
         newExp.setProperties(parseProperties(xpath, xdNode));
     }
@@ -442,7 +442,7 @@ public class ResourceListParser
                 new ArrayList<NewAttachment>());
         newSample.setPermID(permId);
         SampleWithConnections newSampleWithConns = data.new SampleWithConnections(newSample, lastModificationDate);
-        data.samplesToCreate.put(permId, newSampleWithConns);
+        data.samplesToProcess.put(permId, newSampleWithConns);
         newSampleWithConns.setConnections(parseConnections(xpath, xdNode));
         newSample.setProperties(parseProperties(xpath, xdNode));
     }
diff --git a/datastore_server/source/java/ch/ethz/sis/openbis/generic/server/dss/plugins/ResourceListParserData.java b/datastore_server/source/java/ch/ethz/sis/openbis/generic/server/dss/plugins/ResourceListParserData.java
index ef073481bb6f059dc3abcb1c767bab8c0d164351..eef5a44ed6db78ca0840efe34c5510b8869d1005 100644
--- a/datastore_server/source/java/ch/ethz/sis/openbis/generic/server/dss/plugins/ResourceListParserData.java
+++ b/datastore_server/source/java/ch/ethz/sis/openbis/generic/server/dss/plugins/ResourceListParserData.java
@@ -30,31 +30,28 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.dto.NewSample;
 import ch.systemsx.cisd.openbis.generic.shared.dto.NewContainerDataSet;
 import ch.systemsx.cisd.openbis.generic.shared.dto.NewExternalData;
 import ch.systemsx.cisd.openbis.generic.shared.dto.NewLinkDataSet;
-import ch.systemsx.cisd.openbis.generic.shared.dto.ProjectUpdatesDTO;
 
 /**
  * @author Ganime Betul Akin
  */
 public class ResourceListParserData
 {
-    public Map<String, ProjectWithConnections> projectsToCreate = new HashMap<String, ResourceListParserData.ProjectWithConnections>();
+    public Map<String, ProjectWithConnections> projectsToProcess = new HashMap<String, ResourceListParserData.ProjectWithConnections>();
 
-    public Map<String, ProjectUpdatesDTO> projectUpdates = new HashMap<String, ProjectUpdatesDTO>();
+    public Map<String, ExperimentWithConnections> experimentsToProcess = new HashMap<String, ResourceListParserData.ExperimentWithConnections>();
 
-    public Map<String, ExperimentWithConnections> experimentsToCreate = new HashMap<String, ResourceListParserData.ExperimentWithConnections>();
+    public Map<String, SampleWithConnections> samplesToProcess = new HashMap<String, ResourceListParserData.SampleWithConnections>();
 
-    public Map<String, SampleWithConnections> samplesToCreate = new HashMap<String, ResourceListParserData.SampleWithConnections>();
+    public Map<String, DataSetWithConnections> datasetsToProcess = new HashMap<String, ResourceListParserData.DataSetWithConnections>();
 
-    public Map<String, DataSetWithConnections> datasetsToCreate = new HashMap<String, ResourceListParserData.DataSetWithConnections>();
-
-    public List<MaterialWithLastModificationDate> materialsToCreate = new ArrayList<MaterialWithLastModificationDate>();
+    public List<MaterialWithLastModificationDate> materialsToProcess = new ArrayList<MaterialWithLastModificationDate>();
 
     public Map<String, DataSetWithConnections> filterPhysicalDataSetsByLastModificationDate(Date lastSyncDate)
     {
         Map<String, DataSetWithConnections> dsMap = new HashMap<String, ResourceListParserData.DataSetWithConnections>();
-        for (String permId : datasetsToCreate.keySet())
+        for (String permId : datasetsToProcess.keySet())
         {
-            DataSetWithConnections ds = datasetsToCreate.get(permId);
+            DataSetWithConnections ds = datasetsToProcess.get(permId);
             if (ds.getKind() == DataSetKind.PHYSICAL && ds.lastModificationDate.after(lastSyncDate))
             {
                 dsMap.put(permId, ds);
@@ -67,9 +64,9 @@ public class ResourceListParserData
     {
         // List<NewDataSetWithConnections> dsList = new ArrayList<ResourceListParserData.NewDataSetWithConnections>();
         Map<String, DataSetWithConnections> dsMap = new HashMap<String, ResourceListParserData.DataSetWithConnections>();
-        for (String permId : datasetsToCreate.keySet())
+        for (String permId : datasetsToProcess.keySet())
         {
-            DataSetWithConnections ds = datasetsToCreate.get(permId);
+            DataSetWithConnections ds = datasetsToProcess.get(permId);
             if (ds.getKind() == DataSetKind.CONTAINER)
             {
                 dsMap.put(permId, ds);
diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/shared/entitygraph/EntityGraph.java b/openbis/source/java/ch/ethz/sis/openbis/generic/shared/entitygraph/EntityGraph.java
index be39a04a156c453ed79e00ad06165cfb52cfd9f6..10f16e5383e379572f8c700f80d14b0c09f61455 100644
--- a/openbis/source/java/ch/ethz/sis/openbis/generic/shared/entitygraph/EntityGraph.java
+++ b/openbis/source/java/ch/ethz/sis/openbis/generic/shared/entitygraph/EntityGraph.java
@@ -121,7 +121,7 @@ public class EntityGraph<N extends Node<?>>
             for (EdgeNodePair edgeNodePair : list)
             {
                 Node<?> neighbourNode = edgeNodePair.getNode();
-                sb.append("\"" + node.getCode() + "(" + node.getEntityKind().charAt(0) + getDifferentiatorStr(node) + ")\" -> "
+                sb.append("\"" + node.getCode() + "(" + getDifferentiatorStr(node) + ")\" -> "
                         + getRightHandNodeRep(neighbourNode));
                 sb.append(System.getProperty("line.separator"));
             }
@@ -131,7 +131,7 @@ public class EntityGraph<N extends Node<?>>
 
     private String getRightHandNodeRep(Node<?> node)
     {
-        return "\"" + node.getCode() + "(" + node.getEntityKind().charAt(0) + getDifferentiatorStr(node) + ")\";";
+        return "\"" + node.getCode() + "(" + getDifferentiatorStr(node) + ")\";";
     }
 
     private String getDifferentiatorStr(Node<?> node)
@@ -139,9 +139,12 @@ public class EntityGraph<N extends Node<?>>
         String differentiatorStr = "";
         if (node.getEntityKind().equals("EXPERIMENT")) // in order to differentiate between experiments in the same space but under different projects
         {
-            differentiatorStr =
+            differentiatorStr = "-" +
                     node.getPermId().substring(node.getPermId().indexOf('-') + 1);
         }
+        else {
+            differentiatorStr = "" + node.getEntityKind().charAt(0);
+        }
         return differentiatorStr;
     }