golang-migrate
github.com
- Free plan
- Windows
- macOS
- Linux
- Self-hosted
What golang-migrate is
golang-migrate is an open-source tool for applying database migrations in sequence. Each logical migration has an up file to apply a change and a down file to reverse it. 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. Migration sources include a local filesystem, embedded Go data, GitHub, GitLab, Bitbucket, AWS S3, and Google Cloud Storage. The CLI handles Ctrl+C gracefully and does not use config search paths, config files, or automatic environment-variable injection. The library uses io.Reader streams for low memory overhead and is described as thread-safe without goroutine leaks. Its GracefulStop channel supports controlled stopping to help prevent database corruption. The project documents running the CLI in Docker with a mounted migration directory. It is self-hosted and distributed under the MIT License, which requires retaining copyright and permission notices. The v3 and v4 library APIs are described as stable and frozen; master and 4.x are supported, while 3.x and earlier are unsupported.
Who it suits
It suits developers and database teams who want a command-line migration tool or a Go library, including teams working with one of its listed database drivers.
Good to know, and what to watch
- Available as a CLI or Go library
- Supports multiple migration sources and database drivers
- Provides up and down files for logical migrations
- GracefulStop supports controlled stopping
- Open source under the MIT License
- Security policy marks 3.x and earlier unsupported
- MIT License requires retaining copyright and permission notices
Plans
Every plan and priceOpen source
Open source
Getting started
- Open the golang-migrate GitHub project
- Choose the command-line tool or import the Go library
- Prepare SQL migration files with up and down files
- Select a supported database driver and migration source
- Run the CLI locally or in Docker with a mounted migration directory
Limits to check
The project pages state no paid plans or usage limits. The security policy marks master and 4.x as supported, while 3.x and earlier are unsupported.
The verdict
golang-migrate offers migration workflows through either its CLI or Go library, with a range of listed sources and database drivers. Check the supported-version policy and license requirements when adopting it.
Questions people ask
Is golang-migrate free?
Yes. The project is open source, and its listed Open source plan costs nothing. No paid plans or usage limits are stated on the project pages.
Which databases can it migrate?
Listed drivers include PostgreSQL, MySQL/MariaDB, SQLite, MongoDB, Neo4j, CockroachDB, and Google Cloud Spanner.
Can I run it without a hosted service?
Yes. It supports self-hosted use, and the CLI can run locally or in Docker with a mounted migration directory.
What license does it use?
golang-migrate uses the MIT License, which requires retaining its copyright and permission notices.
Which project versions are supported?
The security policy marks master and 4.x as supported. Versions 3.x and earlier are marked unsupported.
What the maker publishes
- CLI behavior
- The CLI handles Ctrl+C gracefully and has no config search paths, config files, or automatic environment-variable injections. source
- Database support
- Listed database drivers include PostgreSQL, MySQL/MariaDB, SQLite, MongoDB, Neo4j, CockroachDB, and Google Cloud Spanner. source
- Docker
- The README documents running the migrate CLI in Docker with a mounted migration directory. source
- Graceful stopping
- The library supports graceful stops through a GracefulStop channel to help prevent database corruption. source
- Library compatibility
- The README describes the v3 and v4 library API as stable and frozen for those releases. source
- Library properties
- The README says the library uses io.Reader streams for low memory overhead and is thread-safe with no goroutine leaks. source
- License
- The project is distributed under the MIT License, which requires retaining the copyright and permission notices. source
- Migration files
- Each logical migration has an up file and a down file. source
- Migration sources
- Sources include local filesystem, embedded Go data, GitHub, GitLab, Bitbucket, AWS S3, and Google Cloud Storage. source
- Purpose
- golang-migrate reads database migrations from sources and applies them to a database in order. source
- Security reporting
- The security policy asks reporters to start a GitHub security advisory and suggest potential impact and urgency. source
- Supported versions
- The security policy marks master and 4.x as supported, while 3.x and earlier are unsupported. source
- Ways to use
- The project can be used as a command-line tool or imported as a Go library. source
Checked against the maker's pages on 4 Oct 2026.