How to migrate the DB from Compose back to the same server the app is hosted on


#1

I had high hopes for my little project and decided to host the DB on Compose from day one. I deployed the app to DO with MUP and put the DB on Compose.
No need to pay $18 a month any more and I’d like to move the DB back. What are the steps I should take to do this?

Cheers


#2

Download the DB files, shut the server down for maintenance, spin up a new instance, deploy with mup for mongo and Meteor, ssh into the instance, restore the new DB from the old DB files.


#3

Thanks. I’m currently on an older version of Meteor. Would I have to upgrade it and mup before I do this?


#4

Mup should work with your Meteor project’s version.


#5

Thanks again. I’m also tempted to just drop that old db and start fresh. Save me a step.


#6

Updating the post in case someone stumbles across this post in the future.

I pulled the trigger on this today. In the end I decided I didn’t need to preserve the old db from Compose and my app has a feature that by default populates the tables with some core data anyway.

I first edited the mup.json, set the “setupMongo” to true and got rid of the MONGO_URL and MONGO_OPLOG_URL from the env config. I then tried to redeploy the app (via mup deploy) but the processed failed due to not being able to start mongod.
I re-executed mup setup and then redeployed without problems.

The only other thing of interest was that my little $5 droplet wasn’t able to handle the app now that it had to deal with the DB and would run out of memory and fail. I added a swap file and this took care of that.

$18/mo saved. I’ll come back to Compose in the future if I ever build an app that actually does get some users…