From Chaos to Control

Move from ad-hoc database changes to a versioned workflow you can review and repeat.

The Problem

Unmanaged Migrations

One-off scripts lead to fragile, inconsistent environments.

  • No shared migration history

    It is hard to tell which changes have reached each environment.

  • Manual runs drift

    One-off commands and scripts can be skipped, repeated, or run differently.

  • Concurrent runs can collide

    Overlapping deployment jobs may start the same pending migrations; coordination depends on adapter locking support.

  • Applied files can drift

    Editing or removing an applied migration can make the repository disagree with the database history.

  • Recovery is improvised

    When a change fails, the rollback or restore path may be unclear.

The Workflow

From Setup to Insight

Follow each migration from adapter selection to execution history.

  1. 01

    Choose an adapter

    Start with Firebase Realtime Database or connect a custom database handler.

  2. 02

    Write versioned migrations

    Use SQL, JavaScript, or TypeScript files in your project.

  3. 03

    Add CI/CD

    Optional

    Include migration runs in your deployment pipeline when useful.

  4. 04

    Run migrations

    Execute pending changes through the CLI or programmatic API.

  5. 05

    Review the results

    Check execution status and logs; collect metrics when configured.

A Firebase Quick Start

From Install to First Run

This quick tour uses the official Firebase Realtime Database adapter. Detailed migration and deployment examples live in the Core and Firebase documentation.

Quick Installation

$ npm install @migration-script-runner/firebase

Powerful & Compact CLI

Run pending migrations, inspect their status, or roll back with the Firebase adapter CLI.

# Run pending migrations
$ msr-firebase migrate

# Check migration status
$ msr-firebase list

# Roll back migrations
$ msr-firebase down

Configure Database Access

Set the Realtime Database URL and the path to your service account key in your environment or .env file.

# .env
DATABASE_URL=https://your-project.firebaseio.com
GOOGLE_APPLICATION_CREDENTIALS=./service-account.json

# Then run
$ msr-firebase migrate

Automate in CI/CD

Run validation and migrations in your deployment pipeline. Store Firebase credentials as CI secrets and follow the adapter guide for a complete workflow.

...
- name: Run Migrations
env:
DATABASE_URL: ${{ secrets.DATABASE_URL }}
FIREBASE_SERVICE_ACCOUNT_KEY: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_KEY }}
GOOGLE_APPLICATION_CREDENTIALS: ./key.json
run: |
printf '%s' "$FIREBASE_SERVICE_ACCOUNT_KEY" > "$GOOGLE_APPLICATION_CREDENTIALS"
npx msr-firebase migrate
...

Explore the documentation

Find complete setup, migration, SQL, and CI/CD examples in the guides maintained with each library.

Core Capabilities

The Controls Behind Every Run

Keep execution, recovery, and history explicit—and extend the workflow to fit your database.

Versioned Execution & History

Run pending migrations in order and keep a record of execution results and checksums.

Validation & Integrity

Use built-in and custom validators to check migration files against structure, syntax, and conventions.

Transaction Policies

Set transaction scope per migration, per batch, or none, as supported by your database and adapter.

Rollback & Recovery Options

Choose down migrations, backup and restore, or a combined strategy when your adapter supports it.

Logs & Metrics

Review structured run summaries and extend logging or metrics with built-in and custom integrations.

Platforms & Ecosystem

One Core. Database-Specific Adapters.

One shared migration workflow, with database-specific behavior supplied by adapters.

MSR Core with database adapters

FirebasePostgreSQLCORE

One shared workflow

A core that connects to databases

MSR Core coordinates migrations. Database adapters connect that workflow to specific systems: Firebase is available today, while PostgreSQL is in development. The same adapter contracts leave room to add more databases over time.

A practical comparison

How MSR Compares

Run an adapter's MSR CLI in CI/CD pipelines, including for SQL-only migrations; the application itself does not need to be written in Node.js. For application integration, use Core's API from TypeScript or JavaScript. Adapters provide database-specific behavior and the CLI executable. Compare the migration formats, rollback options, and pre-run previews that matter when choosing a workflow. MSR capabilities depend on the selected adapter.

AreaMSRFlywayLiquibase
Migration formatsSQL, JavaScript, and TypeScript (adapter/loader-dependent)SQL, Java, and script migrationsSQL, XML, YAML, and JSON
RollbackDown migrations; backups where the adapter supports themUndo migrations (Teams and Enterprise)Rollback commands (all editions)
Preview before executionDry-run mode (adapter-dependent)Check dry-run (Teams and Enterprise)update-sql (all editions)

Product tiers change over time. Edition details were checked against the official documentation on November 20, 2026: Flyway command tiers, Liquibase Community update-sql and Liquibase rollback commands.

Read the full MSR comparison
The story behind MSR

Built from a real migration problem

A recurring need to protect Firebase data grew into a broader idea: make migrations safer to run and easier to adapt to each database.

2017

A risky manual routine

Before a Firebase app launched, its beta data needed regular backups, restores, and migrations. Every manual change risked losing work.

2023

The prototype returns

The original JavaScript tool inspired a rewrite in TypeScript, with migration logic separated from database-specific code.

Today

A shared workflow grows

MSR Core and its adapters bring one migration workflow to different databases, using TypeScript, JavaScript, or SQL where each fits best.

Ready to Get Started?

Explore the MSR Core and Firebase adapter documentation to get your migration workflow started.

MSR Core

MSR Core provides the shared migration workflow, runner, and extension APIs. Choose an adapter to connect it to your database.

MSR Firebase

The official adapter for Firebase Realtime Database includes database-aware state tracking, backups, and locking for serverless workflows.