Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

database migration guide #365

Merged
merged 7 commits into from
Nov 3, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/data/sidebar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ export const sidebarContent: ISidebarContent = [
{
title: "Guides",
pages: [
makePage("Migrate from Heroku", 'guides')
makePage("Migrate from Heroku", 'guides'),
makePage("Database Migration Guide", 'guides'),
]
},
];
68 changes: 68 additions & 0 deletions src/docs/guides/database-migration-guide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
---
title: Migrating from Legacy Plugins to Database Services
---

We've introduced a more secure and flexible way to deploy databases on Railway. The purpose of this guide is to provide an overview of why we are making these changes, what they mean for you, and how you can migrate.

## What is Changing?
### Legacy Plugins
In the early stages of Railway, we introduced `plugins`, a foundational part of our offering. They were databases deployed from Docker images with a fixed version, no data persistence, and no way to customize the database to your needs.
melissa-hale marked this conversation as resolved.
Show resolved Hide resolved

### Database Services
Some of our newest features - Volumes, Docker Image Deployments, TCP Proxy - open the door for deploying databases as services, complete with data persistence, flexible configuration and management, and connectivity from the external network.

## Why Migrate?
melissa-hale marked this conversation as resolved.
Show resolved Hide resolved

There are several primary reasons why this migration is beneficial -

1. Data Security
2. Modern Architecture
3. Flexibility in configuration

## Migration Process

Here is what will happen when you choose to migrate via our one-click migration process -

*screenshot of button?*

1. **One-click button** - When you access the plugin settings from within your project canvas, you will see a prompt to migrate.
2. **Modal** - Once you click on the button, a modal will appear, detailing the steps that will be taken on your behalf to migrate your data.
3. **Services Stop** - Any service within your project that is connected via a variable reference to the plugin will be stopped for the duration of the migration to prevent data loss or corruption.
melissa-hale marked this conversation as resolved.
Show resolved Hide resolved
4. **Database Service** - A new database service with an attached volume will be deployed.
5. **Data Transfer** - A separate service will be deployed that will execute a migration script. The script will connect to your old plugin, create a dump of the data, and then transfer it to the new database service.
melissa-hale marked this conversation as resolved.
Show resolved Hide resolved
6. **Reference Update** - All variable references within other services that point to the old plugin will be updated to the new database service.
melissa-hale marked this conversation as resolved.
Show resolved Hide resolved

_**NOTE: Your old plugin will NOT be deleted automatically. You should perform the necessary actions to ensure data consistency between the plugin and the new database service.**_
melissa-hale marked this conversation as resolved.
Show resolved Hide resolved

## Other Options

If you would prefer not to go through the migration flow as outlined above, there are other options for your migration path -

1. **Template** - The template which is used in the automation can be deployed at-will. Deploy this manually in your project if you prefer this method.
2. **DIY** - If our tools don't align with your needs, or you have a unique migration process in mind, you're welcome to execute your own strategy. We always recommend ensuring you have a backup and a process for testing.

## FAQ

### What is the risk?

The migration process has been designed to minimize risks. By temporarily stopping services that reference the old plugin, we prevent data corruption. Also, we don't immediately delete the old plugin, allowing you to verify the migration.

### Will there be downtime?

Yes, there will be a brief downtime for services that reference the old plugin. However, this is essential to ensure a seamless and error-free migration.

### What is the deadline for migration?

While we encourage users to migrate as soon as possible to benefit from the enhanced features, you will have ???? to complete the migration. After this, we may start sunsetting the old plugins.

### What if something goes wrong?

The old plugin remains intact until you verify the migration. If you encounter any issues, please contact our support team. We're here to assist you through every step.

## Conclusion

We're committed to providing the best solutions for your needs, and the new database services are a big step in that direction. We're excited about the possibilities that this transition brings to your experience on Railway.

## Need Help?

If you run into any issues, or would like help with your migrations, we would be more than happy to answer your questions on our [Discord](https://discord.gg/railway) or over email at [[email protected]](mailto:[email protected]).