1

I have a Meteor App running on a Ubuntu Droplet on Digital Ocean (your basic virtual machine). This app was written by a company that went out of business and left us with nothing.

The database is a MongoDB currently running on IBM Compose. Compose is shutting down in a month and the Database needs to be moved and our App needs to connect to the new database.

I had no issues exporting and creating a MongoDB with all the data on a different server.

I cannot for the life of me figure out where on the live Meteor App server I would change the address of the database connection. There is no simple top level config file where I can change this?? Does anyone out there know where I would do this?

I realize that in the long term I will need to either rewrite or deprecate this aging app, but in the short term the company relies on it and IBM decided to just shut down their Compose service so please help!!

pathfinder
  • 1,606
  • 18
  • 22

1 Answers1

2

There is mostly the MONGO_URL and MONGO_OPLOG_URL that are configured as environment variable: https://docs.meteor.com/environment-variables.html#MONGO-OPLOG-URL

Now you don't set these within the code but during deployment. If you are running on localhost and want to connect to the external MongoDb you can simply use:

$ MONGO_URL="mongodb://user:password@myserver.com:port" meteor

If you want to deploy the app, you should stick with the docs: https://galaxy-guide.meteor.com/mongodb.html#authentication

If you use MUP then configure the mongo appropriately: https://meteor-up.com/docs.html#mongodb

Edit: If your app was previously deployed using MUP you can try to restore the environment variables from /opt/app-name/config (where app-name is the name of your app) which contains env.list (including all environment variables; thus your MONGO_URL) and start.sh which you can use to recreate the mup.js config.

Jankapunkt
  • 8,128
  • 4
  • 30
  • 59
  • So it was originally put there using MUP. But the problem is I don't have the original files to redeploy using MUP. Can I SSH into the droplet and change this environmental variable on the running server? I do have both user and root access to the machine. – pathfinder Feb 09 '23 at 15:26
  • How do you currently access the db in IBM Compose? They should provide you a guide on how to access the DB from a mongodb client. By the way, MUP allows to run the DB on the same server as your app using mongoDB. If you create a `mongodump` and deploy your app with MUP then you can actually import your data with `mongoimport` on this machine until you have a new mongodb provider. – Jankapunkt Feb 09 '23 at 15:50
  • I moved the DB to another server, that was no issue. I have the connection string to replace the current IBM Compose string with. What I can't figure out is how do I change this on the server that is running the meteor app without having MUP and all the app files in a local environment to push to my server. I have read those docs and if I was using MUP to redeploy or deploy from scratch, I think I could get this done. I really appreciate you taking a few minutes to help me :) – pathfinder Feb 09 '23 at 16:21
  • 1
    Added some hint to the answer, maybe it helps – Jankapunkt Feb 09 '23 at 16:36
  • `/opt/app-name/config` was a good thing to know about. I was hoping that changing the variable there would work after a restart, but it did not. Now the hard work of recreating the MUP unless someone else knows. I am very thankful for your help. All of your advice was very sound and if I had the files I would just redeploy. – pathfinder Feb 10 '23 at 03:48