Tutorial - Cherry pick pending migrations
Published 22 September 2025
Pre-requisites
- Ensure that Flyway is installed and available on your path
- Ensure that Flyway is authenticated to use enterprise features
- Ensure that any secrets necessary for database connection auth are avaialbale
Commands to run
Ensure the target environment is baselined, or skip this step and append -baselineOnMigrate=true
to the command in the next step
If your target environment, here with id production, is defined in your toml configuration run the following
flyway migrate -environment=production -cherryPick=V002,V004 -outOfOrder=true
Related command reference
Related configuration reference
- Navigate to the migrations tab
- Add a target database, to see exactly which scripts have been applied to that target, how long they took to execute, and what scripts are pending.
- Expand the Advanced settings.
- Select cherryPick from the drop down. You can start typing to limit the results and find the parameter easier.
- Enter a value for the parameter. This is a comma-separated list of version numbers. As you're entering a version number, remember to include the whole version number, even the timestamp if you're using the default Flyway Desktop naming convention. You can highlight the version number in the table and Ctrl-C to copy it.
- Click Add parameter.
- Click Save.
- Click View Dry Run script to see the exact deployment script, which concatenates all the pending scripts together, for that target database.
- Click Run migrate to execute the script on the target.