def transfer_item_data(portal, src_item_id, target_item_id):
    
    resp = None
    
    src_item = portal.item(src_item_id)
    if src_item['type'] in TEXT_BASED_ITEM_TYPES:
        try:
            src_item_data = portal.item_data(src_item_id)
        except Exception as err:
            print('ERROR: Exception: transfer_item_data function could not ' \
                  'retrieve item data for item: "{} - {}"'.format(
                                str(src_item.get('id')),
                                str(src_item.get('title'))))
            src_item_data = None
        if src_item_data:
            resp = portal.update_item(target_item_id, {'text': src_item_data})
        return resp
Transfer item data from source item to target item
dataset/ETHPy150Open Esri/ops-server-config/Publish/Portal/PublishHostedServices.py/transfer_item_data