feat: mgmt cmd to replace v1 libr refs in courses (#32904)

This PR adds a management command to, given a mapping of V1 content libraries to matching v2 content libraries, replaces references to v1 libs in courses (in library source xblocks) with V2 libraries. It does so by manipulating the mongo document directly.

it also offers some improvements to the management command which copies all v1 libraries into v2 libraries.
This commit is contained in:
connorhaugh
2023-08-11 09:48:34 -04:00
committed by GitHub
parent 1b35bf716e
commit 4b38b1f750
4 changed files with 290 additions and 27 deletions

View File

@@ -1951,6 +1951,7 @@ class SplitMongoModuleStore(SplitBulkWriteMixin, ModuleStoreWriteBase):
The implementation tries to detect which, if any changes, actually need to be saved and thus won't version
the definition, structure, nor course if they didn't change.
"""
partitioned_fields = self.partition_xblock_fields_by_scope(block)
definition_locator = getattr(block, "definition_locator", None)
if definition_locator is None and not allow_not_found: