'Internal method with additional internal parameters to convert a subtree to draft.
Args:
location: the location of the source (its revision must be MongoRevisionKey.published)
user_id: the ID of the user doing the operation
delete_published (Boolean): intended for use by unpublish
ignore_if_draft(Boolean): for internal use only as part of depth first change
Raises:
InvalidVersionError: if the source can not be made into a draft
ItemNotFoundError: if the source does not exist
DuplicateItemError: if the source or any of its descendants already has a draft copy. Only
useful for unpublish b/c we don\'t want unpublish to overwrite any existing drafts.'

def _convert_to_draft(self, location, user_id, delete_published=False, ignore_if_draft=False):

    self._verify_branch_setting(ModuleStoreEnum.Branch.draft_preferred)
    _verify_revision_is_published(location)
    if (location.category in DIRECT_ONLY_CATEGORIES):
        raise InvalidVersionError(location)
    def convert_item(item, to_be_deleted):
        '\n                                                Convert    the    subtree\n                                                '
        next_tier = []
        for child in item.get('definition', {}).get('children', []):
            child_loc = Location.from_deprecated_string(child)
            next_tier.append(child_loc.to_deprecated_son())
        item['_id']['revision'] = MongoRevisionKey.draft
        item['_id'] = self._id_dict_to_son(item['_id'])
        bulk_record = self._get_bulk_ops_record(location.course_key)
        bulk_record.dirty = True
        try:
            self.collection.insert(item)
        except pymongo.errors.DuplicateKeyError:
            if (not ignore_if_draft):
                raise DuplicateItemError(item['_id'], self, 'collection')
        if delete_published:
            item['_id']['revision'] = MongoRevisionKey.published
            to_be_deleted.append(item['_id'])
        return next_tier
    self._breadth_first(convert_item, [location])
