If you wish to migrate from an unmanaged database to a managed database, you can follow these steps to create a manage database and migrate your data and application to it.
This same approach works the other direction if you would like to migrate from a managed database to an unmanaged database to save money.
- You might want to enable maintenance mode on your app so no new records are created during the backup and restore process.
- Create a Managed database.
You can use the Database section to create a managed database, or directly through DigitalOcean, Amazon, Crunchy Data, or any other database service. Your choice.
- Use TablePlus to backup your unmanaged database.
- Restore your backup to the new DigitalOcean database cluster.
- Detach the unmanaged database from your app. This will remove the DATABASE_URL but keep the database.
- Attach the managed database to your app. This will add the DATABASE_URL that points to the managed database on DO.
If you created the database manually, you will need to set the DATABASE_URL on your app that points to your hosting provider's database.
- Disable maintenance mode if you used it.