Skip to content

Migration tool: convert block_configurable_reports block instances to block_sqlreports #49

Not planned

Description

@keevan

Summary

report_sql can import Configurable Reports (block_configurable_reports) SQL reports via cr_import, but nothing migrates the block instances themselves. Sites replacing BCR with block_sqlreports must re-add every block by hand.

Proposed

  • Script/CLI (and/or admin action) that, for each block_configurable_reports row in block_instances, creates a block_sqlreports instance in the same parentcontextid, defaultregion, defaultweight, pagetypepattern, subpagepattern, then removes the old instance.
  • Use the old→new report id map produced by cr_import to point the new block at the imported query (config_queryid).
  • Imports are created as drafts, so provide a bulk publish step (or clear reporting of what still needs publishing + an audience).
  • Carry over courseid and visible (already done in import); document that BCR global and permissions are not migrated and need audiences set.
  • Make it idempotent and support a dry-run.

Verify

  • Confirm cr_import works with the BCR plugin code removed but its tables/data retained (it only reads block_configurable_reports; add a test for this).

Related

Old BCR blocks listed multiple reports; see the block_sqlreports "list of reports" issue for the display side of the migration.

Activity

  1. self-assigned this
    on Nov 30, 2026
  2. linked a pull request that will close this issuefeature/49 bcr block migration #53on Dec 2, 2026
  3. keevan commented on Dec 2, 2026

    @keevan
    ContributorAuthor

    Moved to catalyst/moodle-block_sqlreports#9, because the block plugin should create and migrate its own block instances. Resolved there by catalyst/moodle-block_sqlreports#8. Closing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions