Skip to content

Flutter migrate #40460

Description

@blasten

Use case

The platforms that Flutter supports introduce new features every year. To support these features, the Flutter tool may need to change the files in an existing project.

Features introduced in Flutter may also require changes to the underlaying project structure.

Because developers may configure project files in ways that we don't see ahead of time, changes to the project files may cause issues that are hard to revert. Even when the files are source controlled, the developer could have unstaged changes.

As a result, changes performed by the tool must ensure that they won't disrupt the developer's workflow.

Proposal

Create a new subcommand: flutter migrate that tracks all the migrations performed to an existing project and provides an option to revert the change.

DevX: If flutter build apk updated some files, the changes can be reverted by using flutter migrate --revert.

There are still more details to figure out:

  1. What happen if they are multiple migrations?
  2. Can a migration depend on another migration?
  3. Can the order of the migrations cause issues?

Design doc

https://flutter.dev/go/flutter-migrate

Sub-issues to track progress

Activity

  1. added
    toolAffects the "flutter" command-line tool. See also t: labels.
    on Jan 16, 2020
  2. jmagman commented on Jan 16, 2020

    @jmagman
    Member

    @blasten Is this a duplicate of #12573?
    See also #12983.

  3. blasten commented on Jan 16, 2020

    @blasten
    Author

    @jmagman they are related, but not a full duplicate.

  4. Jonas-Sander commented on Mar 11, 2020

    @Jonas-Sander

    One example we had with our app was that we could not build it reliably with XCode on codemagic.
    Our app was created about 1 1/2 years ago which meant that new configurations of projects created with a recent flutter version were not in our project.

    In the end we fixed it by making a new flutter project and replacing the old files with these.

    flutter migrate would be way easier in this regard.

  5. jmagman commented on Mar 11, 2020

    @jmagman
    Member

    Examples of Xcode project changes with automatic migration:
    #51453 (bonus doc: https://flutter.dev/docs/development/ios-project-migration)
    #52288
    #13011

    Examples of updating template for new Xcode projects, no migration for existing projects:
    #33684
    #49654
    #34293
    #41882
    #8971

  6. added
    P3Issues that are less important to the Flutter project
    on Aug 18, 2020
  7. self-assigned this
    on Dec 15, 2021
  8. GaryQian commented on Feb 17, 2022

    @GaryQian
    Contributor
  9. GaryQian commented on Mar 29, 2022

    @GaryQian
    Contributor
  10. GaryQian commented on Apr 19, 2022

    @GaryQian
    Contributor

    #101937 - Utils PR

  11. reke592 commented on May 26, 2022

    @reke592

    Hi, We have an app created from the old sdk version, then we upgrade the sdk and run the migration.

    what we notice is the /web/index.html has no changes and is different compare to the updated sdk web/index when creating a new project.

    will it be possible for the migration tool to upgrade also the web build process

    regards,

  12. reidbaker commented on Feb 9, 2023

    @reidbaker
    Contributor

    Gary is no longer working on flutter issues. Removing him to correctly reflect bug status.

  13. added a commit that references this issue on Mar 21, 2023
  14. github-actions commented on Jul 11, 2025

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  15. locked as resolved and limited conversation to collaborators on Jul 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Issues that are less important to the Flutter projectc: new featureNothing broken; request for a new capabilityteam-toolOwned by Flutter Tool teamtoolAffects the "flutter" command-line tool. See also t: labels.triaged-toolTriaged by Flutter Tool team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions