Skip to content

Course Sync Tutorial

Learn how to synchronize courses between Canvas instances.

Overview

Canvas CLI's sync feature allows you to:

  • Copy course content between instances (production ↔ sandbox)
  • Migrate courses between semesters
  • Maintain course templates

Prerequisites

  • Canvas CLI installed
  • Access to both source and destination Canvas instances
  • Appropriate permissions on both instances

Step 1: Configure Multiple Instances

First, set up both Canvas instances:

# Add production instance
canvas config add production --url https://canvas.example.com

# Add sandbox instance
canvas config add sandbox --url https://canvas-sandbox.example.com

Then authenticate with each:

canvas auth login --instance production
canvas auth login --instance sandbox

Verify your instances:

canvas config list

Output:

NAME         URL                                  DEFAULT
production   https://canvas.example.com           *
sandbox      https://canvas-sandbox.example.com

Step 2: Identify Source Course

Find the course you want to sync:

canvas courses list --instance production

Note the course ID you want to sync.

Step 3: Create Destination Course

If needed, create a new course on the destination:

canvas courses create \
  --instance sandbox \
  --name "CS101 - Test Copy" \
  --code "CS101-TEST"

Or identify an existing course:

canvas courses list --instance sandbox

Step 4: Sync Course Content

Sync the course using the following syntax:

canvas sync course <source-instance> <source-course-id> <target-instance> <target-course-id>

Example - sync course 123 from production to course 456 on sandbox:

canvas sync course production 123 sandbox 456

Interactive Mode

For conflict resolution during sync:

canvas sync course production 123 sandbox 456 --interactive

Step 5: Verify Sync

Check the destination course:

canvas modules list --course-id 456 --instance sandbox
canvas assignments list --course-id 456 --instance sandbox

Use Cases

Development Testing

Sync a production course to sandbox for testing changes:

canvas sync course production 123 sandbox 456

Semester Rollover

Copy a course template to create a new semester's course:

canvas sync course production 100 production 200

Multi-Institution Deployment

Sync course content between institutions:

# Configure second institution
canvas config add partner --url https://partner.instructure.com
canvas auth login --instance partner

# Sync course
canvas sync course production 123 partner 456

Syncing Assignments Only

To sync only assignments between courses:

canvas sync assignments <source-instance> <source-course-id> <target-instance> <target-course-id>

Example:

canvas sync assignments production 123 sandbox 456

Tips

Enrollment Data

Sync does not copy enrollment or grade data. Only course structure and content are synced.

Verify Before Production

Always sync to a sandbox first to verify the results before syncing to production.

Verbose Mode

Use --verbose to see detailed progress during sync:

canvas sync course production 123 sandbox 456 --verbose

Troubleshooting

Permission Denied

Ensure you have the required permissions: - Source: Read access to course content - Destination: Write access to create/update content

Content Not Syncing

Some content types have dependencies: - Module items require modules to exist first - Assignment groups should sync before assignments

Rate Limiting

For large syncs, Canvas CLI automatically handles rate limiting. If you see rate limit errors, the CLI will retry automatically.