---
title: "Deploy Mongo Plugin Migration"
description: "Migrate from a legacy Mongo plugin to a V2 database service"
category: "Storage"
url: https://railway.com/deploy/mongo-plugin-migration
---

# Deploy Mongo Plugin Migration

Migrate from a legacy Mongo plugin to a V2 database service

**[Deploy Mongo Plugin Migration on Railway](https://railway.com/template/mongo-plugin-migration)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/mongo-plugin-migration/manifest.json

- **Creator:** Railway Templates
- **Category:** Storage
- **Total deploys:** 4

## Template content

### mongo migration

- **Image:** ghcr.io/railwayapp-templates/mongo-plugin-migration:latest

## Documentation

Service that will migrate data from a legacy Mongo plugin to a V2 database service.

## Required Variables

- `PLUGIN_URL`: The Mongo URL of the legacy plugin. This is used as the source database.
- `NEW_URL`: The Mongo URL of the V2 database service. This is used as the destination.

## Process

- Validates that all the variables are provided
- Validates that the destination Mongo database is empty
- Dumps all the data from the source database
- Restores all the data from the destination

**No data is ever deleted from the plugin. You should delete the plugin manually after confirming that the migration was successful**

View the migration script [here](https://github.com/railwayapp-templates/mongo-plugin-migration/blob/main/migrate.sh)

## Caveats

- You should manually update your application to point to the new V2 database service
- You should stop writing to the Redis plugin while the migration is in progress to avoid data not being migrated

**If you want to avoid egress charges, you should use the new database service `MONGO_PRIVATE_URL`**

## Similar templates

- [RustFS | (Just Updated) S3 Object Store, Public URL and Keys Set](https://railway.com/deploy/rustfs-or-just-updated-s3-object-store-p) — S3-compatible object store, keys and public URL preset, volume kept
- [TimescaleDB](https://railway.com/deploy/timescaledb-railway-template) — A PostgreSQL-based time-series database for analytics on Railway.
- [Garage S3 Storage](https://railway.com/deploy/garage-s3-storage) — Ultra-light S3 server: fast, open-source, plug-and-play.

Open this page in a browser: https://railway.com/deploy/mongo-plugin-migration
