DbUp vs Flyway for .NET: which migration tool to use (2026)
DbUp and Flyway work the same way at heart: ordered SQL files and a journal table recording what has run. The real difference is that DbUp is a .NET library and Flyway is a Java tool you shell out to. Pick DbUp for a .NET-only team; pick Flyway if you already use it elsewhere. This page is part of our wider .NET database migration tool comparison.
| DbUp | Flyway | |
|---|---|---|
| Language / runtime | .NET library (NuGet), runs inside your own app or a small console tool | Java-based CLI and Docker image (flyway/flyway); no official .NET library |
| How migrations are written | Plain .sql files (or C# scripts), run in filename order | Plain .sql files named V<version>__<description>.sql, plus repeatable R__ scripts |
| Journal table | SchemaVersions, managed by DbUp | flyway_schema_history, managed by Flyway |
| Rollback / undo | None built in; write a new forward migration | Undo migrations (U prefix) are listed as an Enterprise feature; Community has none |
| CI/CD use | Call PerformUpgrade() from a console project or at app startup | Run the CLI or Docker image as a deploy step |
| Licensing | Open source (MIT) | Community edition free (Apache 2.0 repository); Enterprise is commercial with quote-based pricing |
| EF Core interop | Independent of EF Core; works alongside it, or with Dapper / ADO.NET | Independent of EF Core; it only sees your SQL files |
| PostgreSQL and SQL Server | Both supported (separate NuGet packages per database) | Both supported, among many other databases |
Flyway edition details checked October 3, 2026 on Redgate's Flyway editions page and the Flyway GitHub repository. DbUp is documented at dbup.readthedocs.io.
Using Flyway from C# / .NET
There is no official Flyway library for .NET. Flyway is a Java application, so from a .NET
project you run its command line or its Docker image as a step in your deploy. Keep your
scripts in a folder such as db/, named V1__create_orders.sql,
V2__add_index.sql, and so on:
docker run --rm -v "$PWD/db:/flyway/sql" flyway/flyway \
-url=jdbc:postgresql://localhost:5432/myapp \
-user=myapp_migrator -password="$DB_PASSWORD" \
migrate
Note the JDBC-style URL: Flyway does not take an Npgsql connection string. To launch it from
C#, start the same command with System.Diagnostics.Process and check the exit
code:
var psi = new ProcessStartInfo("flyway", "-url=jdbc:postgresql://localhost:5432/myapp -user=myapp_migrator migrate")
{
RedirectStandardOutput = true,
};
psi.Environment["FLYWAY_PASSWORD"] = password;
using var p = Process.Start(psi)!;
Console.WriteLine(await p.StandardOutput.ReadToEndAsync());
await p.WaitForExitAsync();
if (p.ExitCode != 0) throw new Exception("Flyway migrate failed"); When to pick each
Pick DbUp when everyone on the team writes C#, you want migrations applied by a .NET process you already build and test, and you do not want a JVM or Docker image in the deploy path. Pick Flyway when your company already uses it for Java or Node services and wants one tool and one history table format everywhere, or when you want the option of Redgate's paid edition. If you want migrations generated from your model instead, see EF Core Migrations in the full .NET database migrations comparison.
FAQ
DbUp vs Flyway: which should I use for a .NET app?
Can I use Flyway from C#?
Is Flyway free?
Runs your migrations on every deploy
DotDeployer applies your DbUp, EF Core or shell-command migration before each release goes live.
Join the waitlist