FREEDOM251

Freedom251 › Database Migration Tools

golang-migrate

Free plan LinuxMacSelf-hostedWindows

Visit golang-migrate Alternatives Pricing

golang-migrate's own site

What golang-migrate is

golang-migrate is a free, open-source tool for applying database migrations in sequence. It reads migrations from a source and applies them to a database; each logical migration has an up file and a down file. Use it as a command-line tool or import it as a Go library. Listed database drivers include PostgreSQL, MySQL/MariaDB, SQLite, MongoDB, Neo4j, CockroachDB, and Google Cloud Spanner. Sources include local files, embedded Go data, GitHub, GitLab, Bitbucket, AWS S3, and Google Cloud Storage. The project supports self-hosting and documents running the CLI in Docker with a mounted migration directory. The CLI handles Ctrl+C gracefully and does not search for configuration files or automatically inject environment variables. The library uses io.Reader streams for low memory overhead and supports thread-safe operation without goroutine leaks. A GracefulStop channel allows controlled stopping to help prevent database corruption. The project uses the MIT License, which requires retaining copyright and permission notices. Its v3 and v4 library APIs are described as stable and frozen; master and 4.x are supported, while 3.x and earlier are not.

Who it suits

It suits Go developers and database operators who need to apply and roll back ordered migrations using supported databases and sources. It can be run as a CLI or used as a Go library.

What it does well

  • Free and open source under the MIT License
  • Available as a CLI or Go library
  • Supports multiple database drivers and migration sources
  • Includes up and down migration files

What to know first

  • 3.x and earlier are unsupported
  • MIT License requires retaining copyright and permission notices
  • No configuration-file search or automatic environment-variable injection

Limits

The project lists a free Open source plan at no cost. No paid plans or usage limits are stated on the project pages opened.

Plans

PlanBilled and limitsPrice
Open sourceNo paid plans or usage limits stated on the project pages openedFree

As github.com lists them, read 4 Oct 2026. The maker's own page has the final word.

Getting started

  1. Open the golang-migrate GitHub project website.
  2. Choose a command-line workflow or import the project as a Go library.
  3. Select a listed database driver and a migration source.
  4. Create an up file and a down file for each logical migration.
  5. Run the CLI directly or follow the documented Docker approach with a mounted migration directory.

golang-migrate is a migration engine for teams that need database changes applied in a controlled sequence. It suits Go developers and operators who want both a command-line workflow and an embeddable library, particularly when their databases or migration files live across varied systems. Its strongest case is broad driver and source coverage without a subscription; its trade-offs are operational responsibility and the need to track supported releases and license obligations.

Overview

The project reads SQL migrations from a source and applies them to a database in order. Each logical migration is split into an up file and a down file, so rollback is part of the format rather than an afterthought. You can run the migrate CLI or import the Go library into an application, giving teams a choice between a standalone deployment step and migration control inside Go code.

This is a practical fit for engineering teams that already manage deployment infrastructure and want an open-source component rather than a hosted migration service. It is less suitable for organizations seeking a graphical administration layer or a vendor-managed workflow; the project’s documented model centers on a CLI, library, and self-managed data sources.

Key features

Drivers and sources

Supported database drivers include PostgreSQL, MySQL and MariaDB, SQLite, MongoDB, Neo4j, CockroachDB, and Google Cloud Spanner. That range makes one migration approach viable across heterogeneous stacks, although each team still needs to confirm that its chosen driver matches its database version and operational requirements.

Migration sources cover a local filesystem, embedded Go data, GitHub, GitLab, Bitbucket, AWS S3, and Google Cloud Storage. Local and embedded options suit application packaging and controlled deployments; hosted repository and object-storage sources can fit centralized release pipelines without forcing every migration into a local directory.

Operational controls

The library uses io.Reader streams for low memory overhead and is thread-safe without goroutine leaks. Its GracefulStop channel supports orderly shutdown, which can reduce the risk of leaving a database in a damaged intermediate state during interruption. The CLI handles Ctrl+C gracefully as well.

The CLI deliberately has no configuration search paths, configuration files, or automatic environment-variable injection. That predictable behavior limits hidden configuration, but it also means deployment scripts must provide settings explicitly. Docker use is documented with a mounted migration directory, making containerized execution straightforward for self-hosted pipelines.

Compatibility and maintenance

The v3 and v4 library APIs are described as stable and frozen for those releases, which helps teams avoid churn when embedding the library. The security policy treats master and 4.x as supported, while 3.x and earlier are unsupported, so older integrations should be planned for upgrade rather than assumed to receive security attention. Rollback support is included through the down migration files.

Pricing

Open source — free. The project is MIT-licensed and has no paid plans or stated usage limits. That makes it suitable for individual developers, startups, and enterprises that can operate migration jobs themselves without per-seat or usage charges.

The MIT license requires retaining copyright and permission notices. Teams incorporating or redistributing the software should account for that obligation in their packaging and compliance process. The zero price does not remove the cost of maintaining database credentials, deployment automation, backups, or upgrade discipline.

Platforms

golang-migrate supports Linux, macOS, Windows, and self-hosted deployments. That combination works for local development and cross-platform build environments while leaving production hosting under your control. There is no stated hosted SaaS tier, so teams wanting managed execution should look elsewhere.

Who it's for

Choose golang-migrate when you need ordered SQL migrations, explicit up/down rollback files, and a Go API alongside a command-line tool. It is especially compelling for Go services spanning several database engines or for infrastructure teams pulling migrations from repositories and cloud storage.

Look elsewhere if your priority is a managed control plane, a visual schema workflow, or a platform that hides deployment configuration. The no-config-file approach is clean for scripted environments but places more responsibility on operators to define and secure every invocation.

Pros and cons

  • Pro: Broad database-driver coverage, including PostgreSQL, MySQL/MariaDB, MongoDB, Neo4j, CockroachDB, and Spanner, reduces the need to standardize on one engine.
  • Pro: Filesystem, embedded, Git hosting, S3, and Google Cloud Storage sources accommodate both application-bundled and centralized release workflows.
  • Pro: A thread-safe, low-memory Go library with graceful stopping supports embedding in long-running services.
  • Pro: Free MIT-licensed software has no stated usage caps or paid tier.
  • Con: Self-hosting means your team owns execution, credentials, backups, and upgrades.
  • Con: The absence of config files and automatic environment injection improves predictability but requires explicit deployment scripting.
  • Con: Releases before 4.x are marked unsupported, and MIT notice-retention requirements add compliance work for redistributors.

Alternatives

Skeema is the better choice when you want a freemium tool with a Community plan covering tables, routines, 18 linter checks, and Linux or macOS support, with a paid Plus tier for expanded needs.

Sqitch suits teams seeking a free, self-hostable change-management application whose license permits broad use, modification, distribution, and sale.

sqlx-cli is worth choosing for a focused free CLI combining database management, migrations, and offline query metadata on Linux, macOS, and Windows.

Atlas fits organizations that prefer an open-core model with an Apache 2.0 core and optional advanced capabilities, plus a free plan and trial.

dbmate offers a free, open-source migration tool across desktop and self-hosted platforms without a stated paid SaaS upsell.

FluentMigrator is a strong alternative for .NET-oriented teams wanting an Apache-2.0 framework distributed through NuGet, with provider packages selected separately.

Goose provides another free, open-source migration option across API, desktop, and self-hosted environments.

pgroll is the narrower pick for PostgreSQL 14 or later when a single cross-platform binary is preferable.

Browse more options in Database Migration Tools.

Verdict

golang-migrate is a strong recommendation for Go teams that want ordered SQL changes, rollback files, broad driver and source support, and a zero-cost self-hosted tool. Choose it for control and integration flexibility; look elsewhere if you need managed operations, visual workflows, or support for legacy 3.x releases.

Verdict

golang-migrate offers ordered database changes through either a command-line tool or Go library, with a broad list of database drivers and migration sources. Check the supported project versions and license notice requirements before adopting it.

Questions

How much does golang-migrate cost?

The Open source plan is free. No paid plans or usage limits are stated on the project pages opened.

Is golang-migrate open source?

Yes. It is distributed under the MIT License, which requires retaining the copyright and permission notices.

Which platforms does it support?

Listed platforms are Linux, macOS, Windows, and self-hosted environments.

Which databases and migration sources are listed?

Database drivers include PostgreSQL, MySQL/MariaDB, SQLite, MongoDB, Neo4j, CockroachDB, and Google Cloud Spanner. Sources include local filesystem, embedded Go data, GitHub, GitLab, Bitbucket, AWS S3, and Google Cloud Storage.

Can golang-migrate roll back changes?

Yes. Each logical migration has an up file and a down file, and rollback support is listed.

Which versions are supported?

The security policy marks master and 4.x as supported. It marks 3.x and earlier unsupported.

Facts from golang-migrate's own pages

CLI behavior
The CLI handles Ctrl+C gracefully and has no config search paths, config files, or automatic environment-variable injections. · github.com, 4 Oct 2026
Database support
Listed database drivers include PostgreSQL, MySQL/MariaDB, SQLite, MongoDB, Neo4j, CockroachDB, and Google Cloud Spanner. · github.com, 4 Oct 2026
Docker
The README documents running the migrate CLI in Docker with a mounted migration directory. · github.com, 4 Oct 2026
Graceful stopping
The library supports graceful stops through a GracefulStop channel to help prevent database corruption. · github.com, 4 Oct 2026
Library compatibility
The README describes the v3 and v4 library API as stable and frozen for those releases. · github.com, 4 Oct 2026
Library properties
The README says the library uses io.Reader streams for low memory overhead and is thread-safe with no goroutine leaks. · github.com, 4 Oct 2026
License
The project is distributed under the MIT License, which requires retaining the copyright and permission notices. · github.com, 4 Oct 2026
Migration files
Each logical migration has an up file and a down file. · github.com, 4 Oct 2026
Migration sources
Sources include local filesystem, embedded Go data, GitHub, GitLab, Bitbucket, AWS S3, and Google Cloud Storage. · github.com, 4 Oct 2026
Purpose
golang-migrate reads database migrations from sources and applies them to a database in order. · github.com, 4 Oct 2026
Security reporting
The security policy asks reporters to start a GitHub security advisory and suggest potential impact and urgency. · github.com, 4 Oct 2026
Supported versions
The security policy marks master and 4.x as supported, while 3.x and earlier are unsupported. · github.com, 4 Oct 2026
Ways to use
The project can be used as a command-line tool or imported as a Go library. · github.com, 4 Oct 2026

Where golang-migrate stands on Freedom251

Look at these too