Spring Boot 1.5.x uses Flyway 3 while Spring Boot 2.x uses Flyway 5. According to the official migration guide for Spring Boot 2, you need to do 2 releases to be able to migrate an application from Spring Boot 1 to Spring Boot 2 if you are using Flyway:
First upgrade your 1.5.x Spring Boot application to Flyway 4 (4.2.0 at the time of writing), see the instructions for Maven and Gradle.
Once your schema has been upgraded to Flyway 4, upgrade to Spring Boot 2 and run the migration again to port your application to Flyway 5.
While this certainly works, it might not always be convenient to do 2 releases. If you don’t want to do this, follow these steps as a workaround (Assuming you have access to the database):
Migrate your Spring Boot application to Spring Boot 2 and release it so it can be deployed after running the following steps.
Download the command line zip file of Flyway 4.2.0 from https://repo1.maven.org/maven2/org/flywaydb/flyway-commandline/4.2.0/
Extract the zip file
Copy the jar file of your 1.5.x Spring Boot application (NOT your Spring Boot 2 version!) to
<flyway-path>/jars. NOTE: You need to copy the .original jar file that is generated by Maven or Gradle, if you use the repackage feature. Don’t forget to rename it to end in
.jar after copying, otherwise Flyway will not find it
Set 'flyway.url' to the value of 'spring.datasource.url' of the Spring Boot application
Set 'flyway.locations' to the value also used in the Spring Boot application
After this, upgrade the server to use your Spring Boot 2 migrated application.