summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--apps/files_encryption/command/migratekeys.php12
-rw-r--r--apps/files_encryption/lib/migration.php13
2 files changed, 18 insertions, 7 deletions
diff --git a/apps/files_encryption/command/migratekeys.php b/apps/files_encryption/command/migratekeys.php
index 200d7367da6..d6db1f70892 100644
--- a/apps/files_encryption/command/migratekeys.php
+++ b/apps/files_encryption/command/migratekeys.php
@@ -62,11 +62,17 @@ class MigrateKeys extends Command {
}
$output->writeln("Migrating keys for users on backend <info>$name</info>");
- $users = $backend->getUsers();
- foreach ($users as $user) {
+
+ $limit = 500;
+ $offset = 0;
+ do {
+ $users = $backend->getUsers('', $limit, $offset);
+ foreach ($users as $user) {
$output->writeln(" <info>$user</info>");
$migration->reorganizeFolderStructureForUser($user);
- }
+ }
+ $offset += $limit;
+ } while(count($users) >= $limit);
}
}
diff --git a/apps/files_encryption/lib/migration.php b/apps/files_encryption/lib/migration.php
index 8af633aeaff..7a036ade3fc 100644
--- a/apps/files_encryption/lib/migration.php
+++ b/apps/files_encryption/lib/migration.php
@@ -42,10 +42,15 @@ class Migration {
public function reorganizeFolderStructure() {
$this->reorganizeSystemFolderStructure();
- $users = \OCP\User::getUsers();
- foreach ($users as $user) {
- $this->reorganizeFolderStructureForUser($user);
- }
+ $limit = 500;
+ $offset = 0;
+ do {
+ $users = \OCP\User::getUsers('', $limit, $offset);
+ foreach ($users as $user) {
+ $this->reorganizeFolderStructureForUser($user);
+ }
+ $offset += $limit;
+ } while(count($users) >= $limit);
}
public function reorganizeSystemFolderStructure() {