diff --git a/ardumont/azure/deposit_migrate_data.py b/ardumont/azure/deposit_migrate_data.py
index a3ca535c6076dcdcdb192ba3d9dd656a1f2518f5..d09eb293bee628fe8b3bcf79a14a22837c43ff57 100644
--- a/ardumont/azure/deposit_migrate_data.py
+++ b/ardumont/azure/deposit_migrate_data.py
@@ -92,7 +92,10 @@ def migrate(config_file, path_files_to_migrate, already_migrated_files, limit, d
             assert blob_path.exists()
             count += 1
             blob_path_str = blob_path.as_posix()
-            blob_filename = blob_path_str.lstrip(path_files_to_migrate)
+            if path_files_to_migrate in blob_path_str:
+                blob_filename = blob_path_str.lstrip(path_files_to_migrate)
+            else:
+                blob_filename = blob_path_str
             if blob_path.exists() and blob_filename in already_migrated:
                 # Skipping already pushed blob
                 continue