diff --git a/migration/20.03/migrateFileplans.php b/migration/20.03/migrateFileplans.php
index 8723c88dab4d381b82ba655f66526d3f1555fb74..4fe647c43d8e3e47328d9bdbfc3ae1d34eab7134 100644
--- a/migration/20.03/migrateFileplans.php
+++ b/migration/20.03/migrateFileplans.php
@@ -39,7 +39,6 @@ foreach ($customs as $custom) {
             'level'     => 0
         ]);
 
-        $GLOBALS['entities'] = \Entity\models\EntityModel::get(['select' => ['id']]);
         fillEntities($masterFolderId);
 
         foreach ($fileplans as $fileplan) {
@@ -151,13 +150,12 @@ function runPositionsForPrivate($positions, $parentPositionId, $parentFolderId,
 
 function fillEntities($folderId)
 {
-    foreach ($GLOBALS['entities'] as $entity) {
-        \Folder\models\EntityFolderModel::create([
-            'folder_id' => $folderId,
-            'entity_id' => $entity['id'],
-            'edition'   => true,
-        ]);
-    }
+    \Folder\models\EntityFolderModel::create([
+        'folder_id' => $folderId,
+        'entity_id' => null,
+        'edition'   => true,
+        'keyword'   => 'ALL_ENTITIES'
+    ]);
 }
 
 function fillResources($folderId, $positionId)
diff --git a/migration/20.03/migrateFolders.php b/migration/20.03/migrateFolders.php
index 6ef77d43f8a6348a2c969544fd852dbed5f5f14f..2a1dfc5db15e9d65800d42d1f3ce17c1626d2fb5 100644
--- a/migration/20.03/migrateFolders.php
+++ b/migration/20.03/migrateFolders.php
@@ -38,7 +38,6 @@ foreach ($customs as $custom) {
             'level'     => 0
         ]);
 
-        $GLOBALS['entities'] = \Entity\models\EntityModel::get(['select' => ['id']]);
         fillEntities($masterFolderId);
 
         $aFolderIdMap = [];
@@ -92,13 +91,12 @@ foreach ($customs as $custom) {
 
 function fillEntities($folderId)
 {
-    foreach ($GLOBALS['entities'] as $entity) {
-        \Folder\models\EntityFolderModel::create([
-            'folder_id' => $folderId,
-            'entity_id' => $entity['id'],
-            'edition'   => true,
-        ]);
-    }
+    \Folder\models\EntityFolderModel::create([
+        'folder_id' => $folderId,
+        'entity_id' => null,
+        'edition'   => true,
+        'keyword'   => 'ALL_ENTITIES'
+    ]);
 }
 
 function fillResources($folderId, $folderSystemId)