HI Rebecca. This was a change that we were struggling with at MIT for a long 
time. 

When you import a course in studio, the course run is already established. But 
when you import using the management command, it has to determine the course 
run from the course data (OLX). 

Unfortunately, the OLX format has varied slightly over edX releases. In 
particular, in birch, the course run was set in a few locations. But in 
subsequent releases, it was omitted from the OLX*. We (MIT Open Learning) 
submitted a PR to revert to the old export behavior, which will be part of 
Ironwood. 

In the meantime, it’s not too difficult to patch up your OLX export:

1. In the course.xml file at the root of your course data, set the value of the 
`url_name` on the root course node to the name of your run.
2. In the policies directory, change the name of the “course” directory to the 
name of your run. 
3. In the policy.json file, change the root key from “course/course” to 
“course/<name_of_your_run>”

We had to do this enough times that we wrote a post-commit hook for git. If 
that’s helpful, I can see if we can share that. 

Good luck, and let us know if this helps. 

Peter Pinch
Associate Director of Engineering
MIT Open Learning
pdpi...@mit.edu
http://engineering.odl.mit.edu/

* - technically, this didn’t change in a particular named release. It changed 
with the upgrade in modulestore from mongomodulestore to splitmodulestore. At 
MIT, we had delayed the change of modulestore for several releases, so it 
wasn’t until ginkgo that we realized this was an issue. 

> On Feb 7, 2019, at 9:32 PM, Rebecca Buchheit Clayton <rbbuchh...@gmail.com> 
> wrote:
> 
> Hi,
> 
> I'm trying to import a course using this command:
> sudo -u www-data /edx/bin/python.edxapp 
> /edx/app/edxapp/edx-platform/manage.py cms --settings=aws import 
> /edx/var/edxapp/data /tmp/course
> 
> /tmp/course contains the usual subdirectories (static, vertical, sequential, 
> etc.) and course.xml, which looks like this:
> <course url_name="course" org="MyCompany" course="AB301"/>
> The /tmp/course directory was created by expanding a tarball, which was 
> created from the Tools > Export menu in Studio, from a Hawthorne version 
> installation (server is named edx-dev). The course id is:
> course-v1:MyCompany+AB301+Y2018_1
> 
> The original course was created in a pre-release before Birch. It has been 
> imported into Cypress, Ginkgo, and now Hawthorne through the Tools > Import 
> menu in Studio. I've never had any issues exporting/importing from Studio.
> 
> The import succeeds (this is also into a Hawthorne installation, server is 
> named edx-staging), but instead of importing with the correct course id:
> course-v1:MyCompany+AB301+Y2018_1
> it creates a new course on edx-staging with this course id:
> course-v1:MyCompany+AB301+course
> That is, the run should be "Y2018_1", but instead it is "course". 
> 
> I took a look at 
> /edx/app/edxapp/edx-platform/common/lib/xmodule/xmodule/modulestore/xml_importer.py,
>  but my python skills aren't good enough to figure out where it is getting 
> the run value from.
> 
> Any help would be greatly appreciated!
> 
> Thank you,
> Rebecca
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "General Open edX discussion" group.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/edx-code/6f743ca9-5f09-4696-b882-0b06786facc8%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/edx-code/6f743ca9-5f09-4696-b882-0b06786facc8%40googlegroups.com?utm_medium=email&utm_source=footer>.

-- 
You received this message because you are subscribed to the Google Groups 
"General Open edX discussion" group.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/edx-code/F3F9B0FF-302F-478D-9534-F45E78BC92D8%40gmail.com.

Reply via email to