canvas_component_migrator
Introduction
Canvas Component Migrator provides a browser-based admin interface for moving Canvas JavaScript components and global CSS between Drupal sites. Instead of using the terminal or manually running CLI commands, site administrators can select which components to export or import, enter OAuth credentials, and run the migration from a standard Drupal admin form. Only the site initiating the migration needs this module installed. This module wraps the @drupal-canvas/cli npm package, its capabilities evolve alongside that package and module releases track CLI updates.
Features
- Export components from the current site to a remote destination site.
- Import components from a remote source site into the current site.
- Selective migration: pick individual components or migrate all at once.
- Three CSS modes: include global CSS, skip CSS, or CSS only.
- Optional pre-send validation using the CLI's built-in ESLint rules.
- Configurable CLI timeout for large component sets or slow connections.
- Dependency warnings: flags components whose dependencies are missing on the source site.
- All CLI activity logged to Drupal's watchdog under the canvas_migrator channel.
- No terminal access needed on the server running the migration.
Use cases: Content teams migrating a design system between staging and production, agencies deploying Canvas component libraries to client sites, developers who want to audit component dependencies before pushing.
Post-Installation
- Install Node.js (v18+) and npm on the web server - see the README for platform-specific options (module-local, home directory, or explicit path via settings.php).
- Configure an OAuth consumer on both the source and destination sites at Admin → Configuration → Services → Consumers.
- The consumer needs canvas:js_component and canvas:asset_library scopes.
- Grant the "Administer Canvas Component Migrator" permission to trusted administrator roles.
- Navigate to Admin → Configuration → Canvas → Export Canvas Components (/admin/config/canvas/export) to push components to another site, or Import Canvas Components (/admin/config/canvas/import) to pull from another site.
No global config is stored - all credentials are entered per operation.
Additional Requirements
- Drupal 10 or 11
- Canvas module
- Simple OAuth (or equivalent) with consumers configured on both source and destination sites
- Node.js v18 or later and npm, available to the web server process
- @drupal-canvas/cli npm package (currently v0.11.2) - this module's feature set tracks the CLI, check the module
release notes when upgrading the package.
Recommended modules/libraries
Canvas OAuth - simplifies OAuth consumer setup for Canvas-specific scopes.
Similar projects
NA
Supporting this Module
NA
Community Documentation
NA