"source /edx/app/edxapp/edxapp_env && \
python /edx/app/edxapp/edx-platform/manage.py \
cms --settings=devstack_docker export_all_courses /edx/app/courses/export/"
manage.py export_all_courses: error: unrecognized arguments: /edx/app/courses/export/
class Command(BaseCommand):
"""
Export all courses from mongo to the specified data directory and list the courses which failed to export
"""
help = 'Export all courses from mongo to the specified data directory and list the courses which failed to export'
def add_arguments(self, parser):
parser.add_argument(
'output_path',
type=str,
help="output path for the course export")
def handle(self, *args, **options):
"""
Execute the command
"""
# if len(args) != 1:
# raise CommandError("export requires maarten one argument: <output path>")
output_path = options['output_path']
courses, failed_export_courses = export_courses_to_output_path(output_path)
print "=" * 80
print u"=" * 30 + u"> Export summary"
print u"Total number of courses to export: {0}".format(len(courses))
print u"Total number of courses which failed to export: {0}".format(len(failed_export_courses))
print u"List of export failed courses ids:"
print u"\n".join(failed_export_courses)
print "=" * 80
Traceback (most recent call last):
File "/edx/app/edxapp/edx-platform/manage.py", line 116, in <module>
execute_from_command_line([sys.argv[0]] + django_args)
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 354, in execute_from_command_line
utility.execute()
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 346, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/core/management/base.py", line 394, in run_from_argv
self.execute(*args, **cmd_options)
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/core/management/base.py", line 445, in execute
output = self.handle(*args, **options)
File "/edx/app/edxapp/edx-platform/cms/djangoapps/contentstore/management/commands/export_all_courses.py", line 30, in handle
courses, failed_export_courses = export_courses_to_output_path(output_path)
File "/edx/app/edxapp/edx-platform/cms/djangoapps/contentstore/management/commands/export_all_courses.py", line 48, in export_courses_to_output_path
courses = module_store.get_courses()
File "/edx/app/edxapp/edx-platform/common/lib/xmodule/xmodule/modulestore/mixed.py", line 90, in inner
retval = func(field_decorator=strip_key_collection, *args, **kwargs)
File "/edx/app/edxapp/edx-platform/common/lib/xmodule/xmodule/modulestore/mixed.py", line 322, in get_courses
course_id = self._clean_locator_for_mapping(course.id)
AttributeError: 'HiddenDescriptorWithMixins' object has no attribute 'id'