docs: add how-to for merging V1 library OLX exports into a V2 ZIP - #3087
docs: add how-to for merging V1 library OLX exports into a V2 ZIP#3087irfanuddinahmad wants to merge 4 commits into
Conversation
Operators who hold multiple legacy (V1) library exports and want to import them into a V2 content library previously had no documented path. This how-to walks through the manual merge process step-by-step: extracting V1 archives, scaffolding the V2 directory layout, converting each component (block XML + static assets + entity TOML), optionally creating collections, and loading the resulting ZIP via lp_load. Closes openedx#2877 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Thanks for the pull request, @irfanuddinahmad! This repository is currently maintained by Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review. 🔘 Get product approvalIf you haven't already, check this list to see if your contribution needs to go through the product review process.
🔘 Provide contextTo help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:
🔘 Get a green buildIf one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green. DetailsWhere can I find more information?If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources: When can I expect my changes to be merged?Our goal is to get community contributions seen and reviewed as efficiently as possible. However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:
💡 As a result it may take up to several weeks or months to complete a review and merge your PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3087 +/- ##
========================================
Coverage 95.61% 95.62%
========================================
Files 1391 1392 +1
Lines 33077 33131 +54
Branches 7444 7707 +263
========================================
+ Hits 31628 31681 +53
+ Misses 1396 1385 -11
- Partials 53 65 +12 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
002ff55 to
ceb411e
Compare
ceb411e to
214bb68
Compare
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds operator-facing documentation for manually merging legacy (V1) library exports into a V2 backup ZIP format, and updates CI coverage upload tooling.
Changes:
- Added a step-by-step how-to for converting V1 OLX exports into a V2 library backup archive.
- Updated Codecov GitHub Action pin from v6.0.0 to v7.0.0 in CI validation workflow.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| docs/how_tos/migrate_v1_libraries_to_v2.rst | New migration how-to documentation for merging V1 library exports into a V2 archive. |
| .github/workflows/validate.yml | Bumps Codecov Action to v7.0.0 for coverage upload. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Replace incomplete Atlassian /pages/ URL with the public GitHub DEPR issue (edx-platform#32457) for the V1 library deprecation timeline - Add conditional cp command to handle both V1 XML export layouts (subdirectory definition.xml and flat <block_id>.xml) - Clarify that the <type>/ directory for the entity TOML is already created by step 4b's mkdir -p Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
| @@ -0,0 +1,228 @@ | |||
| Merging V1 Library Exports into a V2 Archive | |||
There was a problem hiding this comment.
@irfanuddinahmad Could you share how you generated these details and what sources or references you used? Also, how can I verify that all of this information is accurate?
There was a problem hiding this comment.
Thanks for the question, @salman2013!
This document was generated with Claude Code (AI-assisted), and the primary source I relied on was the V2 backup/restore format specification in openedx/openedx-core#492, which documents the package.toml, per-entity TOML layout, and component_versions/v1/block.xml directory structure. The V1 side (OLX export format: library.xml, <type>/<block_id>/definition.xml, static/) is the existing well-known export produced by Studio's Export feature.
How to verify:
- Against the format spec — Cross-check the TOML structure shown in steps 3 and 4e against the schema defined in Document backup/restore format openedx-core#492 (or its merged docs once landed).
- End-to-end on a local instance — Follow the test plan in the PR description: export a real V1 library from a local Studio, walk through the merge steps, run
lp_load, and confirm the library appears in the V2 library list with all expected components. This is the most reliable verification. - Spot-check the TOML files against an actual V2 backup ZIP exported from a working V2 library instance — the structure should match exactly.
I'm happy to update any steps if you find discrepancies during testing.
|
@irfanuddinahmad Could you please verify the migration plan updated in the doc? |
Test: two V1 libraries merged into one V2The guide's central use-case is merging multiple V1 exports, so here is the end-to-end run. Two V1 source librariesLibrary A — Algebra Basics ( Library B — Geometry Basics ( Step 1 – Extract both archivesunzip v1_lib_A.zip -d v1_extracted_A/
unzip v1_lib_B.zip -d v1_extracted_B/Steps 2–3 – V2 skeleton +
|
| block_type | title | source |
|---|---|---|
| html | Chapter Summary | LibB (Geometry) |
| html | Geometry Introduction | LibB (Geometry) |
| html | Welcome to Algebra | LibA (Algebra) |
| problem | Solve for X | LibA (Algebra) |
Test plan checkboxes — both now verified with the correct two-library merge scenario:
- Walk through the guide end-to-end with two V1 libraries, run
lp_load, confirm all components from both source libraries appear in the merged V2 library ✅ - Verify RST renders correctly (docutils, no errors) ✅
| Merging V1 Library Exports into a V2 Archive | ||
| ============================================= | ||
|
|
||
| V1 (legacy) content libraries exported from Studio produce an XML-based OLX |
There was a problem hiding this comment.
since you mention that the V2 format is packged in a .zip, I would mention that the V1 format is packaged in a .tar.gz
|
|
||
| This guide explains how a savvy operator can combine one or more V1 OLX | ||
| exports into a single V2 backup ZIP, so the content can be imported into a | ||
| V2 library without running a migration script. |
There was a problem hiding this comment.
"without running a migration script" doesn't make sense, as this very workflow is likely to be done using a migration script.
The alternative is to use the migration workflow in the UI, but as of Willow, this will only work on libraries that already exist in the system, as the V1 OLX import is removed.
| @@ -0,0 +1,229 @@ | |||
| Merging V1 Library Exports into a V2 Archive | |||
There was a problem hiding this comment.
The V1/V2 terminology is only for developers. In user-facing docs and UI, we say "legacy library" for V1 and just "library" for V2 (can be disambiguated by saying "new library" where necessary).
Check out the UI-based migration docs as an example: https://docs.openedx.org/en/latest/educators/how-tos/course_development/migrate_legacy_libraries.html
| ============================================= | ||
|
|
||
| V1 (legacy) content libraries exported from Studio produce an XML-based OLX | ||
| archive. V2 libraries use the ``openedx-core`` backup/restore format — a ZIP |
There was a problem hiding this comment.
openedx-core is a repository, shouldn't be mentioned in user-facing docs.
| - V1 OLX export | ||
| - V2 backup ZIP | ||
| * - Container format | ||
| - ``.tar.gz`` or ``.zip`` |
| If you want to group blocks from different source libraries, create a TOML | ||
| file in ``v2_library/collections/``: |
There was a problem hiding this comment.
I would say that for each source library, create one of these collection files. I would also mention that the entries in entities correspond to the key field from the previous step.
| ------------- | ||
|
|
||
| * The V1 library export ZIP(s) produced by Studio's *Export* feature. | ||
| * Access to the target Open edX instance with ``lp_load`` permissions. |
There was a problem hiding this comment.
I would recommend the REST API, not the Python API. It's not normal for operators to be calling Python APIs on a production instance.
There si no such thing as lp_load permissions. You could say "permission to create libraries".
| archive. V2 libraries use the ``openedx-core`` backup/restore format — a ZIP | ||
| of TOML metadata files plus the same XBlock XML. | ||
|
|
||
| This guide explains how a savvy operator can combine one or more V1 OLX |
There was a problem hiding this comment.
This paragraph explains that we are merging many legacy archives into one new archive, which is good, but it doesn't explain why one should merge rather than do a 1:1 migration. You could add the context that legacy libraries were only suitable for small banks of content, whereas new libraries can hold thousands of items and internally organize them into smaller banks of content (collections).
| * ``openedx-core`` backup/restore format reference — full schema for the V2 | ||
| archive (``docs/openedx_content/backup_restore.rst`` in the ``openedx-core`` | ||
| repository). |
There was a problem hiding this comment.
The Library Archive Format reference doc has been moved to docs.openedx.org. Once this PR is re-opened in docs.openedx.org, you can use an rst reference to connect it to https://docs.openedx.org/en/latest/educators/references/library_archive_format.html
Could you also add a back-reference from the Library Archive Format to this new doc?
| @@ -0,0 +1,229 @@ | |||
| Merging V1 Library Exports into a V2 Archive | |||
There was a problem hiding this comment.
Could you migrate this document to https://github.com/openedx/docs.openedx.org ? I would place in the course_development how-tos, similar to https://docs.openedx.org/en/latest/educators/how-tos/course_development/migrate_legacy_libraries.html
Summary
docs/how_tos/migrate_v1_libraries_to_v2.rst— a step-by-step operator guide for merging one or more V1 (legacy) library OLX exports into a single V2 backup ZIP.usage_keyreferences not auto-updated).openedx-corebackup/restore format documentation: Document backup/restore format openedx-core#492 (PR: irfanuddinahmad/document-backup-restore-format-492).Closes #2877
Test plan
lp_load, and confirm the library appears in Studio's V2 library list with the expected components.rst2htmlor a local Sphinx build).🤖 Generated with Claude Code