How can I backup & import/export discovery programs?

Hi,

I realize there is a way to import/export courses easily using:

  • tutor local run cms ./manage.py cms export_all_courses /openedx/edx-platform/exported_courses
  • tutor local run cms ./manage.py cms import /openedx/exported_courses

Now, I’d like to be able to export all of my programs (created using the discovery plugin) and then later import them, how could I do that? Is there a command?

Thank you.

As far as I know, discovery does not contain any management command for importing and exporting programs. One way would be to use Django’s dumpdata (django-admin and manage.py | Django documentation | Django) and loaddata(django-admin and manage.py | Django documentation | Django). When in discovery shell, something like ./manage.py dumpdata course_metadata.Program can generate the dump, which can be later loaded using loaddata. You would need to copy the dump out of container though.
P.S. the commands might need one or two more argument depending, I am just adding it based on prior long time ago experience.