REST API for course import / export

mitx
interoperability

#1

An API for course import and export would make moving courses between edX instances easier and more reliable. It would also make it possible to automate sharing of courseware between content authors and integration with other tools for editing and archiving (e.g. git).

A number of developers have come up with ad hoc ways to automate import and export, but a proper API would provide a stable interface.


#2

Yeah, the manual export of tarball and importing it again is a dance that can’t easily be automated right now. A REST API would be very useful!


#3

@pdpinch There has been work done on this, which was even merged and reverted, and then abandoned - it could be picked up: https://github.com/edx/edx-platform/pull/10357

I also see in the open PRs at the moment that Joel has started some work on this too: https://github.com/edx/edx-platform/pull/14899 - I’ll post there to ask for details and point him to this thread.


#4

Definitely planning to continue this work, yes


#5

@jbarciauskas Cool, I see that you pushed some more code there - great to see this moving forward!


#6

@pdpinch Seeing that @jbarciauskas got this API merged into Ginkgo (kudos! Cf https://github.com/edx/edx-platform/pull/15547 ), if you get to have a look at it, can you say if that ends up covering the import part of your use-case?


#7

It’s not a REST API, but thought I’d mention that we’ve been using this script for bulk importing courses into Open edX. https://github.com/appsembler/openedx-course-migration-tool


#8

The API is interesting. Much better than manual imports for sure. The tasks and celery integration can be tricky to manage for batch imports.

As @Natea mentioned, we’ve been using that script and would possibly do a major revamp to it to help us import 50+ courses at once. A use-case that some of our customers needed.

Also the API don’t seem to have library import support, right? Which is something that we also need.


#9

Hi,

Any news with this one? We are currently struggling in Campus with Import/Export of courses between environments…

Anna


#10

I don’t think much has changed since this was last discussed, but if you’re having specific issues with import & export, I know some workarounds (and a few things that just don’t work).

For example, besides importing and exporting through studio, there are Django management commands to do the same. And there’s a little know feature to export and import courses to git.


#11

We looked into the current state of affairs at OpenCraft, and this is what already exists:

  • A REST API to import course tarballs. This API allows to import a course from a tarball. It doesn’t seem to work with OpenStack Swift at the moment, but I don’t think anyone except for us is using this for object storage. Another thing to be aware of is that the Open edX default configuration for nginx only allows uploads up to 100 MB in size, so if you want to import bigger courses you need to tweak your configuration.
  • The import and export_course Django management commands to import a directory structure and export tarballs from the command line.
  • The git_add_course Django management command that accepts a Git repository URL and imports a course from there.

So the only thing that is missing is a REST API for course export, but implementing this would be relatively straight-forward.


#12

That is great actually. BTW, we are still having some Unicode issues with the import/export tool.
A question: is there any need in importing/exporting components between courses? We’ve had a couple of customers asking for that.