def migrate_to_blob(context, portal_type, query={}, remove_old_value=True):
    """Migrates FileFields fields to blob ones for a given portal_type.
    The wueries are done against 'portal_catalog', 'uid_catalog' and
    'reference_catalog'

    :param context: portal root object as context
    :param query: an expression to filter the catalog by other filters than
    the portal_type.
    :param portal_type: The portal type name the migration is migrating *from*
    """
    migrator = makeMigrator(
        context, portal_type, remove_old_value=remove_old_value)
    walker = BikaCustomQueryWalker(context, migrator, query=query)
    savepoint(optimistic=True)
    walker.go()
    return walker.getOutput()
Migrates FileFields fields to blob ones for a given portal_type.
    The wueries are done against 'portal_catalog', 'uid_catalog' and
    'reference_catalog'

    :param context: portal root object as context
    :param query: an expression to filter the catalog by other filters than
    the portal_type.
    :param portal_type: The portal type name the migration is migrating *from*