Canvas Component Migrator
This module provides a browser-based interface to migrate Canvas JavaScript components and global CSS between Drupal sites. It allows you to export components from one site and import them into another, with options to include or exclude CSS and validate components before migration.
Introduction
Canvas Component Migrator provides a browser-based admin interface for moving Canvas JavaScript components and global CSS between Drupal sites.
- Export - push components from this site to a remote destination.
- Import - pull components from a remote source into this site.
Only the site running the migration needs this module. The other site only needs Canvas and a configured OAuth consumer.
This module wraps the @drupal-canvas/cli npm package. Features and supported commands track that package - new CLI capabilities will be reflected in module updates.
Features
- Select individual components or migrate all at once
- Three CSS modes: include global CSS, skip CSS, or CSS only
- Auto-selects the optimal CLI strategy (pull/push vs download/upload)
- Optional pre-send ESLint validation via canvas validate
- Dependency warnings - flags components whose dependencies are missing on the source site
- Configurable CLI timeout for large sets or slow connections
- All activity logged to Drupal watchdog (canvas_migrator channel)
- No global config stored - credentials are entered per operation
- No terminal access needed on the server running the migration.
Post-Installation
Go to Admin → Configuration → Canvas to find the Export and Import forms. Before running a migration, configure an OAuth consumer on both sites with scopes enabled such as canvas:js_component, canvas:asset_library, and ensure Node.js (v18+) and the @drupal-canvas/cli package are installed on the server. Full setup instructions are in the module README.
Additional Requirements
- Drupal 10 or 11
- Canvas module
- Simple OAuth 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
No direct equivalent exists. This module is the only admin UI wrapper for the @drupal-canvas/cli migration toolchain.
Supporting this Module
NA
Community Documentation
NA