Move existing documents into the document store
Installations that ran before the document store existed still keep import originals, frozen schemas and export downloads in the database. A new job moves them into the store you have configured, checks every file it writes, and removes the database copies only when you ask, as a separate step.
scripts/migrate_documents_to_store.py: copiesformat_metadata.sourceContent,version_import_snapshots.source_text,version_spec_snapshots.contentand unexpired export downloads into the store, reads each object back and checks it, then links it to its version.- Removal is a separate step:
--purge-db-copiesre-reads each stored file, compares it byte for byte with the database copy, and only then removes the copy. It is refused on thedbbackend. - Safe to stop and run again: progress is checkpointed after every batch, an interrupted run resumes where it stopped, and a run with nothing left to do changes nothing.
- Gentle by default: one worker, 20 rows a second,
--dry-runand--tenantto try it on one workspace first. - From the REST API: platform administrators can start a step with
POST /v1/ops/document-migrationand follow it withGET /v1/ops/document-migration.
Migration V405 adds the checkpoint table. See Move documents to object storage.
