Skip to content

moving pages around envs#1671

Open
mwvolo wants to merge 2 commits intomainfrom
move-content-btw-envs
Open

moving pages around envs#1671
mwvolo wants to merge 2 commits intomainfrom
move-content-btw-envs

Conversation

@mwvolo
Copy link
Member

@mwvolo mwvolo commented Mar 5, 2026

Changes Made

  1. Removed wagtailimportexport/ — the entire vendored package directory
  2. Added wagtail-transfer==0.11 to requirements/base.txt
  3. Replaced wagtailimportexport with wagtail_transfer in INSTALLED_APPS (openstax/settings/base.py)
  4. Added wagtail-transfer settings to base.py — configurable via env vars:
    - WAGTAILTRANSFER_SECRET_KEY — this instance's auth key
    - WAGTAILTRANSFER_SOURCE_NAME / _URL / _KEY — defines the source to pull from
  5. Added URL route wagtail-transfer/ in openstax/urls.py (above the catch-all wagtail route)

What's Needed Next

Per-environment setup:

On each environment, set these env vars:

On production — pull from staging

WAGTAILTRANSFER_SECRET_KEY=
WAGTAILTRANSFER_SOURCE_NAME=staging
WAGTAILTRANSFER_SOURCE_URL=https://staging.openstax.org/wagtail-transfer/
WAGTAILTRANSFER_SOURCE_KEY=

On staging — the secret key must match what prod uses as SOURCE_KEY

WAGTAILTRANSFER_SECRET_KEY=

The SECRET_KEY on the source must match the SOURCE_KEY configured on the destination.

Run migrations on each environment:
python manage.py migrate wagtail_transfer

Permissions: Superusers get access automatically. For other users, create a group with the "Can import pages and
snippets from other sites" permission.

Usage: In Wagtail admin, there will be a new "Import" option. You browse the source environment's page tree and
select what to pull in — no more zip files.

  Changes Made

  1. Removed wagtailimportexport/ — the entire vendored package directory
  2. Added wagtail-transfer==0.11 to requirements/base.txt
  3. Replaced wagtailimportexport with wagtail_transfer in INSTALLED_APPS (openstax/settings/base.py)
  4. Added wagtail-transfer settings to base.py — configurable via env vars:
    - WAGTAILTRANSFER_SECRET_KEY — this instance's auth key
    - WAGTAILTRANSFER_SOURCE_NAME / _URL / _KEY — defines the source to pull from
  5. Added URL route wagtail-transfer/ in openstax/urls.py (above the catch-all wagtail route)

  What's Needed Next

  Per-environment setup:

  On each environment, set these env vars:

  # On production — pull from staging
  WAGTAILTRANSFER_SECRET_KEY=<prod-secret>
  WAGTAILTRANSFER_SOURCE_NAME=staging
  WAGTAILTRANSFER_SOURCE_URL=https://staging.openstax.org/wagtail-transfer/
  WAGTAILTRANSFER_SOURCE_KEY=<staging-secret>

  # On staging — the secret key must match what prod uses as SOURCE_KEY
  WAGTAILTRANSFER_SECRET_KEY=<staging-secret>

  The SECRET_KEY on the source must match the SOURCE_KEY configured on the destination.

  Run migrations on each environment:
  python manage.py migrate wagtail_transfer

  Permissions: Superusers get access automatically. For other users, create a group with the "Can import pages and
  snippets from other sites" permission.

  Usage: In Wagtail admin, there will be a new "Import" option. You browse the source environment's page tree and
  select what to pull in — no more zip files.
Copilot AI review requested due to automatic review settings March 5, 2026 06:39
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR replaces the vendored wagtailimportexport page import/export implementation with the upstream wagtail-transfer package, wiring it into settings via environment variables and exposing the required transfer endpoint.

Changes:

  • Remove the legacy wagtailimportexport app (code, templates, and tests).
  • Add wagtail-transfer==0.11, enable wagtail_transfer in INSTALLED_APPS, and add env-driven WAGTAILTRANSFER_* settings.
  • Add the wagtail-transfer/ URL route ahead of the Wagtail catch-all route.

Reviewed changes

Copilot reviewed 18 out of 20 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
requirements/base.txt Adds the wagtail-transfer dependency needed for cross-environment imports.
openstax/settings/base.py Swaps installed app to wagtail_transfer and adds env-configurable transfer secrets/sources.
openstax/urls.py Exposes wagtail-transfer/ endpoints (before Wagtail’s catch-all).
wagtailimportexport/admin_urls.py Removes legacy admin URL routing for the vendored tool.
wagtailimportexport/apps.py Removes vendored app config.
wagtailimportexport/config.py Removes vendored config.
wagtailimportexport/exporting.py Removes legacy export implementation.
wagtailimportexport/forms.py Removes legacy import/export forms.
wagtailimportexport/functions.py Removes legacy helper utilities for zips/FKs/media.
wagtailimportexport/importing.py Removes legacy import implementation.
wagtailimportexport/templates/wagtailimportexport/index.html Removes legacy admin templates.
wagtailimportexport/templates/wagtailimportexport/import-page.html Removes legacy admin templates.
wagtailimportexport/templates/wagtailimportexport/export-page.html Removes legacy admin templates.
wagtailimportexport/tests/test_functions.py Removes legacy tests.
wagtailimportexport/tests/tests.py Removes legacy tests.
wagtailimportexport/views.py Removes legacy views.
wagtailimportexport/wagtail_hooks.py Removes legacy Wagtail admin hooks/menu item.
wagtailimportexport/__init__.py Removes vendored package init.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants