def METHOD_NAME(struct: Structure, opts: ScaffoldOpts) -> "ActionParams":
    """Update projects that were generated with old versions of PyScaffold"""
    update = opts.get("update")
    if not update:
        return struct, opts
    from .actions import invoke  # delay import to avoid circular dependency error
    curr_version = get_curr_version(opts["project_path"])
    # specify how to migrate from one version to another as ordered list
    v4_plan = [
        replace_find_with_find_namespace,  # need to happen after update_setup_cfg
        handover_setup_requires,
        update_pyproject_toml,
    ]
    migration_plans = [
        (Version("3.1"), [add_entrypoints]),
        (ALWAYS, [update_setup_cfg, add_dependencies]),
        (Version("4.0"), v4_plan),
    ]
    plan_actions: Iterable["Action"] = chain.from_iterable(
        plan_actions
        for plan_version, plan_actions in migration_plans
        if plan_version is ALWAYS or curr_version < plan_version
    )
    # replace the old version with the updated one
    opts["version"] = pyscaffold_version
    return reduce(invoke, plan_actions, (struct, opts))