MozillaFoundation / mofo-devops

Mozilla Foundation DevOps Plans, Issues, Discussions
12 stars 5 forks source link

Transition from mLab MongoDB to new provider #798

Closed cadecairos closed 4 years ago

cadecairos commented 4 years ago

comments.mozillafoundation.org uses mLab MongoDB on Heroku, which is shutting down on November 10th.

cadecairos commented 4 years ago

mLab Shutdown docs: https://devcenter.heroku.com/changelog-items/1823

cadecairos commented 4 years ago

I was able to successfully migrate mozilla-foundation-talk-ihr from mLab to ObjectRocket. OR instances are not cheap though, nearly $50/month just for the base plan. Therefore I propose (and have already done so) attaching the one $50 addon instance to all three of our talk apps, creating a new DB on the instance for each app, and migrating all the collections from each app to the new databases.

The process will need to go something like this:

  1. Connect to the Object Rocket dashboard
  2. Create a new database on the instance (it's named MoFo_Coral_Talk) for the target Coral Talk instance
  3. Set up a user and password for the new database
  4. Grab the connection string
  5. mongodump the mongo database from mLab
  6. mongorestore to the database on the MoFo_Coral_Talk instance on ObjectRocket.
  7. Verify the restoration was successful
  8. Put the talk instance into maintenance mode, scale to 0 dynos
  9. Detach the mLab instance from the app
  10. Set the MONGO_URI environment variable to the ObjectRocket connection String
  11. Start the dyno, remove maintenance mode
  12. Verify that the Talk instance is working (you can add a new user via CLI in a one-off dyno)

The above needs to happen for the comments-mofo-org-staging and comments-mofo-org-production Heroku apps.

cadecairos commented 4 years ago

@tomusher @phildexter ^

phildexter commented 4 years ago

Tom aiming to get this done between 2nd and 4th Nov.

tomusher commented 4 years ago

comments-mofo-org-staging and comments-mofo-org-production have been migrated to the shared ObjectRocket instance. Confirmed working and have removed attached mLab instances.