'Copy all of the modules from the \'direct\' version of the course to the new split course.'

def _copy_published_modules_to_course(self, new_course, old_course_loc, source_course_key, user_id, **kwargs):

    course_version_locator = new_course.id.version_agnostic()
    for module in self.source_modulestore.get_items(source_course_key, revision=ModuleStoreEnum.RevisionOption.published_only, **kwargs):
        if (module.location != old_course_loc):
            _new_module = self.split_modulestore.create_item(user_id, course_version_locator, module.location.block_type, block_id=module.location.block_id, fields=self._get_fields_translate_references(module, course_version_locator, new_course.location.block_id), skip_auto_publish=True, **kwargs)
    index_info = self.split_modulestore.get_course_index_info(course_version_locator)
    versions = index_info['versions']
    versions[ModuleStoreEnum.BranchName.draft] = versions[ModuleStoreEnum.BranchName.published]
    self.split_modulestore.update_course_index(course_version_locator, index_info)
    self.split_modulestore.fix_not_found(course_version_locator, user_id)
