def migrate_dataset_if_necessary(
    name,
    destination=None,
    error_level=0,
    verbose=False,
):
    """Migrates the dataset from its current revision to the specified
    destination revision.

    If ``fiftyone.config.database_admin`` is ``False`` and no ``destination``
    is provided, the dataset will only be migrated if its current version is
    not compatible with the client's version.

    Args:
        name: the name of the dataset
        destination (None): the destination revision. By default, the current
            database version is used
        error_level (0): the error level to use. Valid values are:

            -   0: raise error if the dataset cannot be migrated
            -   1: log warning if the dataset cannot be migrated
            -   2: ignore datasets that cannot be migrated
        verbose (False): whether to log incremental migrations that are run
    """
    try:
        _migrate_dataset_if_necessary(name, destination, verbose)
    except Exception as e:
        fou.handle_error(e, error_level=error_level)
Migrates the dataset from its current revision to the specified
    destination revision.

    If ``fiftyone.config.database_admin`` is ``False`` and no ``destination``
    is provided, the dataset will only be migrated if its current version is
    not compatible with the client's version.

    Args:
        name: the name of the dataset
        destination (None): the destination revision. By default, the current
            database version is used
        error_level (0): the error level to use. Valid values are:

            -   0: raise error if the dataset cannot be migrated
            -   1: log warning if the dataset cannot be migrated
            -   2: ignore datasets that cannot be migrated
        verbose (False): whether to log incremental migrations that are run
    
fiftyone/migrations/runner.py