To Our Amazing Educators Everywhere,
Happy Teacher Appreciation Week!
Found this content helpful? Log in or sign up to leave a like!
I have to make full backup of the Canvas LMS, so I'll backup canvas code (excluding logs), database, and I'd like to backup individual courses also. Is there a way to export canvas course using command line in Linux? I'd like to be able to export courses for example as common cartridge files using terminal, so I could automate the process. And sometimes it's easier to restore a course than to do restoration of the full site.
Solved! Go to Solution.
Hi giddyg,
You can export courses through the Canvas LMS REST API. Using the Content Exports API, you can export a course using the following endpoint: POST /api/v1/courses/:course_id/content_exports . You can track the progress of the export with the Progress API (progress is linked to with the progress_url value of the ContentExport object) and when it is complete use the show content endpoint, GET /api/v1/courses/:course_id/content_exports/:id, to retrieve a download URL for the exported content.
Hi giddyg,
You can export courses through the Canvas LMS REST API. Using the Content Exports API, you can export a course using the following endpoint: POST /api/v1/courses/:course_id/content_exports . You can track the progress of the export with the Progress API (progress is linked to with the progress_url value of the ContentExport object) and when it is complete use the show content endpoint, GET /api/v1/courses/:course_id/content_exports/:id, to retrieve a download URL for the exported content.
Thank you @levi_magnus ! It's unfortunate that I can't do this through the command line. This is more a "pull" approach, and I'd need something like "export through command line and push to backup server" approach
This actually could happen through the command line.
You just write a simple shell script and run it from the command line. You'd use `curl` to call the REST API, and then `curl` again to download the file, then you'd have the file on the machine where the script is called, then you can `ftp` it from there to where you want. would only be a few lines of code i suppose.
Was thinking of this myself. Should work
That's actually a very good idea. Thank you! Although, It's shame that there's no command line utility made by instructure for that. Moodle has such a tool for a long time.
To participate in the Instructure Community, you need to sign up or log in:
Sign In