Phase 0: per-user backup/restore through user_migration (spike E)

RepositoryExportDestination / RepositoryImportSource implement the
public OCP\UserMigration interfaces on top of the repository, so
user_migration's migrators (calendar, contacts, trashbin, account,
files) export straight into the encrypted repository.

Spike E (NC34): export 0.8s, unchanged second export stores nothing;
after deleting the user, import restores account, files (bit-identical),
calendar event and contact. Findings: calendars/address books come back
as 'migrated-*' with new object URIs; importing over an existing user
duplicates contacts and adds a migrated birthday calendar; creating the
user on import needs >128 MB (password_policy word list).
This commit is contained in:
2026-10-01 18:36:57 +02:00
parent ab3f0ea948
commit 0b4246b1b3
4 changed files with 369 additions and 0 deletions
+10
View File
@@ -180,6 +180,16 @@ final class Repository {
}
}
/**
* @param list<string> $blobIds
* @return \Generator<string> verified blob contents, in order
*/
public function readBlobs(array $blobIds): \Generator {
foreach ($blobIds as $id) {
yield $this->loadBlob($id);
}
}
/** Small encrypted objects (manifests). */
public function putObject(string $path, string $data): void {
self::putString($this->backend, $path, $this->cipher->encryptString($data, 'object:' . $path));