---
name: course-transfer
description: "Copy modules, pages, or assignments from one course to another."
---

# Course Transfer

> **Plugin**: ASU Canvas Course Builder
> **Scripts**: `scripts/canvas_api.py` (content migration helpers), `scripts/course_navigator.py`

## Purpose

Copy content between Canvas courses using the Canvas Content Migrations API. Transfer entire modules, individual pages, assignments, quizzes, or discussions from a source course to a destination course.

## When to Use

- "Copy Module 3 from my dev course to prod"
- "Transfer everything from course 12345 to this course"
- "Import the quizzes from another section"

## Workflow

### Step 1 — Identify Source and Destination

Ask: "What would you like to transfer?"
- **Source course**: ID, URL, or "current" (default: current course)
- **Destination course**: ID, URL, or "current"

At least one must be different from the current course.

### Step 2 — Browse Source Content

Display the source course tree:
```bash
${ASUCB_PLUGIN_ROOT:-${CODEX_PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT}}}/bin/python3 scripts/course_navigator.py --course-id {SOURCE_COURSE_ID} --tree
```

### Step 3 — Select What to Copy

Ask: "What should I copy?"
- **Everything** — full course copy
- **Specific modules** — "modules 1, 3, and 5"
- **Specific items** — "the m2-overview page and Quiz 3"

### Step 4 — Start Migration

Use `canvas_api.create_content_migration()`:

```python
import scripts.canvas_api as ca

config = ca.get_config(course_id=DEST_COURSE_ID)

# Full copy
migration = ca.create_content_migration(config, SOURCE_COURSE_ID)

# Selective copy
migration = ca.create_content_migration(config, SOURCE_COURSE_ID, select={
    "modules": {"1234": True, "5678": True},
})
```

### Step 5 — Monitor Progress

Poll `canvas_api.check_migration_progress()` every 5 seconds:

```
Transferring content...
  Status: running (45%)
  ...
  Status: completed!
```

### Step 6 — Report

```
Transfer complete!

  Source:      BIO 101 (ID: 255160)
  Destination: BIO 101 Sandbox (ID: 98765)
  Copied:      3 modules, 21 items

Run /canvas-nav to see the updated course structure.
```

## Cross-Instance Transfer

Canvas Content Migrations only work within the same Canvas instance. For cross-instance transfers, use Canvas's own export-to-Common-Cartridge feature from the source course UI, then import the resulting `.imscc` file into the destination course via Canvas's import UI. The plugin does not build cartridges itself.

This is a Canvas limitation, not a plugin limitation.

## Error Handling

| Error | Resolution |
|---|---|
| Source course not accessible | Check permissions; may need a different token |
| Migration failed | Show Canvas error message; suggest retrying |
| Cross-instance transfer | Explain limitation; direct to Canvas's native export/import UI |
