From Chaos to Control
Move from ad-hoc database changes to a versioned workflow you can review and repeat.
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.
From Setup to Insight
Follow each migration from adapter selection to execution history.
- 01
Choose an adapter
Start with Firebase Realtime Database or connect a custom database handler.
- 02
Write versioned migrations
Use SQL, JavaScript, or TypeScript files in your project.
- 03
Add CI/CD
OptionalInclude migration runs in your deployment pipeline when useful.
- 04
Run migrations
Execute pending changes through the CLI or programmatic API.
- 05
Review the results
Check execution status and logs; collect metrics when configured.
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/firebasePowerful & 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 downConfigure 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 migrateAutomate 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.
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.
One Core. Database-Specific Adapters.
One shared migration workflow, with database-specific behavior supplied by adapters.
MSR Core with database adapters
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.
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.
| Area | MSR | Flyway | Liquibase |
|---|---|---|---|
| Migration formats | SQL, JavaScript, and TypeScript (adapter/loader-dependent) | SQL, Java, and script migrations | SQL, XML, YAML, and JSON |
| Rollback | Down migrations; backups where the adapter supports them | Undo migrations (Teams and Enterprise) | Rollback commands (all editions) |
| Preview before execution | Dry-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 comparisonBuilt 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.
A risky manual routine
Before a Firebase app launched, its beta data needed regular backups, restores, and migrations. Every manual change risked losing work.
The prototype returns
The original JavaScript tool inspired a rewrite in TypeScript, with migration logic separated from database-specific code.
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.

