We're updating the issue view to help you get more done. 

[Publisher] [Spike] Migrate Command and Course Runs with different Course numbers


During initial testing of the Migrate Publisher to Course Metadata command, we came across scenarios where there were multiple course runs in Publisher pointing at Courses with different course numbers. This scenario can happen when we remap a course run because of an incorrect course to the course with the correct course number so the course run's number does not match with the course number.

I will describe the two scenarios we came across that are in the attached image as well as an additional scenario that could cause issues:

Scenario 1 (seen in Stage under ArbiRaees org and course number Spt1.3):

  • [Publisher] Course Spt1.3 has two course runs, Spt1.3+1T2019 and Spt1.1+1T2019. Course Spt1.1 does not exist.

  • [Course Metadata] Course Spt1.3 had one course run Spt1.3+1T2019 and Course Spt1.1 has one course run Spt1.1+1T2019.

  • [Running the command - Course Metadata] This will create a Draft Course Spt1.3 with two Draft course runs, Spt1.3+1T2019 and Spt1.1+1T2019.

  • This has the potential of causing issues since we now have a Draft Spt1.1+1T2019 and an official Spt1.1+1T2019, but they aren't linked. If the Draft Spt1.1+1T2019 ever tries to create an official, it will error with a duplicate entry error.

Scenario 2 (seen in Prod under CurtinX org and MKT1x Course number):

  • [Publisher] Course MKT1x (with a title that includes T3 2015) had one course run, DBAEx+3T2015. This is the course that has been renumbered to match the desired course number. Then there is the actual Course MKT1x with multiple course runs, MKT1x+1T2017, etc.

  • [Course Metadata] Course DBAEx with 0 course runs. Course MKT1x with multiple course runs (MKT1x+1T2017, etc.) including DBAEx+3T2015.

  • [Running the command - Course Metadata] Draft Course MKT1x with entire draft world, including Draft course run DBAEx+3T2015. No Draft is created for Course DBAEx.

  • This is a good scenario since everything is properly connected and it shouldn't run into any issues.

Scenario 3 (seen in Prod under UCSanDiegoX org and DSE220x course):

  • [Publisher] Course DSE220x with multiple course runs (DSE220x+3T2019, etc.) including DS220x+1T2018. Course DS220x does not exist.

  • [Course Metadata] Course DSE220x has two course runs, DSE220x+3T2018a and DSE220x+1T2020, but neither are in Publisher. Course DS220x has all of the course runs from Publisher, including DS220x+1T2018 and DSE220x+3T2019.

  • [Running the Command] Will create Draft Course DSE220x with all of the Draft course runs from Publisher. DS220x will not have a draft version created.

  • This is now putting us in an incorrect state since we want all of these draft course runs to be pointing at a draft version of DS220x and they are not. These course runs can also cause issues because if they are turned into official versions, there will be a duplicate entry error.


  • Look into how often these scenarios come up. Scenario 2 shouldn't cause issues, but Scenario 1 could.

  • Investigate into other possible scenarios where we have mismatched course run keys and document how they could cause issues.

  • Speak with PCs about if these still arise and if we need to handle these.

Steps to Reproduce



Story Points



Michael Terry


Dillon Dumesnil








Partner Manager




Contributor Name


Groups with Read-Only Access


Actual Points


Category of Work