Heroku mlab Add-On deleted after migration to mongoDB atlas - mongodb

I have a big problem, today I tried migrating my mlab MongoDB sandbox into MongoDB Atlas. I'm using Heroku for my Nightscout instance, this is a cloud based cgm-app for type 1 diabetes patients and it displays my bloodglucose values.
I followed these steps for the migration https://docs.mlab.com/how-to-migrate-to-atlas/#migration-prereqs
I connected my mlab database to my MongoDB project after the Migration the button "connect to mlab" reappeared, it looks like there was no connection established, but I noticed that after I deleted the add-on in heroku, I think that the migration was not correctly done, but I havent got any error message, everything was fine.
I did everything exactly like its written down, now my nightscout site is no longer available and also the database from the deleted mlab MongoDB add-on is lost.
Is there any possibiltie to get my database back. it stored my bg-values over the last 2 years and everything is lost, I haven't made any backup and I'm addicted to that data :(

did you resolve your problem, or was it even one? I migrated today and everything worked fine. Nightscout is working, all old and new values are stored and reportable via Nightscout Reporter.
But in my Mongo Atlas Account I can't access mLab account anymore. It tell's me to disconnect and try reconnect. I'm just not sure if that is an error or just the way it is - as I deleted my only connection to mLab through deleting my MongoDB addon in my Heroku App - I think.
I don't recall ever setting up a real MongoDB account. And the connection during migration was established through opening my own/single MongoDB database (through Heroku Dashboard), which doesn't exist anymore...
I don't think there is any way, to get an already deleted database back. For other people who fear problems like that, you could export your MongoDB database before migration & deletion as binary, json or csv - I tried that to be safe, but couldn't work the commandline properly... I really don't/didn't know what I'm doing there (technical noob) - I'm just glad there are instructions and videos out there and that it worked fine for me.
These are the instructions I should've used (I used different ones when I did it, the following ones are all in all the same, but much clearer & easier):
https://docs.mlab.com/mlab-to-atlas-nightscout-demo-video/
https://docs.mlab.com/how-to-migrate-nightscout-sandbox-heroku-addons-to-atlas/
https://insulinclub.de/index.php?thread/32513-mongodb-shutdown-heroku-nightscout-was-jetzt/

Related

my postgres is unable to connect ever since heroku did a maintenance update 12 hours ago

anyone facing something similar? sadly I'm on a free plan so I can't open a ticket... does anyone know of a way to restart the service/machine of the DB? maybe that would just solve it...
ok so the issue in my case is that indeed heroku performed some sort of maintenance on the DB, and apparently it's connection params (host/url/user/password) had changed... and since it was embedded throughout all my interfaces (the app, my db tools, admin app I also have) - none were able to connect (they'd timeout).
while trying to figure out, I used the wonderful CLI tools of heroku pg:info and heroku pg:diagnose and even heroku pg:psql and tested to see that my data is still there... eventually I went to the online admin and that's where I saw the connections params had changed. BTW - I have this project for 2 years and this is the first time this had happened...
I was in the same situation. Heroku will email you that your database is scheduled for maintenance. After it's complete, connecting to the database fails because of this error:
error: no pg_hba.conf entry for host "IP_ADDRESS", user "DB_USER", database "DB_NAME", no encryption
This is telling us that incorrect credentials were given, meaning the database connection string has changed. I first checked the credentials on the website for the Heroku Postgres Add-on (data.heroku.com), but the connection string was still the same as before; it has not updated or changed at all, therefore this was misleading. Instead, the updated connection string is found inside of the DATABASE_URL config variable, located in the Settings tab of your app on the Heroku dashboard (dashboard.heroku.com), under Config Vars. To avoid manually correcting this problem again, get the connection string from the DATABASE_URL config variable directly, as opposed to hard coding it in your app.
Yes, Im in the same situation. Heroku are a bunch of amateurs. They did some maintenance on the DB, and after it was done, credentials don't work, even those listed in admin/dashboard section of web. Bunch of loosers... #heroku

How to transfer a database from MongoDB Compass to MongoDB Atlas

I have an existing database for a discord bot in MongoDB Compass v1.28.1 I want to transfer all the data in the database to mongodb atlas because of its more extensive functionality and to not have to wait for compass to take ages to load each time I open it. However when I follow the steps to connect that are provided in Atlas, the pop-up that's supposed to appear when I copy a path to the clipboard doesn't appear, and nothing happens. I tried to connect through my app in VSCode, the same way I did for Compass, using mongoose. Still no collections are loading or any data being stored. I have made my schemas etc. which work perfectly fine in Compass...
Migration to Atlas is documented at https://docs.atlas.mongodb.com/import/
To save you some reads, you have to options - export/import and mongodump/mongorestore.
I would recommend to try export/import first. It's built into Compass https://docs.mongodb.com/compass/current/import-export/ and must be simpler to use considering limited experience with mongo. It's UI oriented so just follow the click-through guide in the documentation.
Unfortunately it has some limitations related to data type conversion from BSON to JSON and may be a bit tedious if you have large number of collections.
In this case you will need to follow CLI mongodump/mongorestore way #barrypicker suggested in the comments. Both commands are available in cmd and PowerShell consoles.
First you backup your local database https://docs.mongodb.com/v4.2/reference/program/mongodump/:
mongodump --uri="mongodb://username:password#localhost:27017/discordbot"
username and password are the ones you use in compass to connect to the source database.
It will create dump directory with all collections you have.
Then you have to upload the backup to Atlas:
mongorestore --uri="mongodb+srv://username:password#cluster.tenant.mongodb.net/database" dump/
username and password are the ones you use to connect to atlas cluster, listed in the "Security/Database Access" section.
You can get the exact subdomains for the --uri part from Atlas. In the dashboard click "Connect" button for the cluster you want to connect to, then choose "shell" as the connection method in the connection pop-up:

Recovering Mongodb collections and documents data

good day to you all.
I am currently having a hard time restoring the MongoDB database.
Here is what happened.
Thanks for looking into this matter
Basically, my server and MongoDB 3.2 server running on DigitalOcean.
I made some changes on mongod.conf file to allow remote access from my local machine. Since then, it no longer worked. I got Mongodb connection failed issue so reinstalled new Mongodb version 4.4 and it doesn't want to load existing data which is located in var/lib/MongoDB. So I downloaded the whole data files as posted above on my local machine.
Now, at least I want to open the current database on my local machine but I couldn't find any proper way to achieve this. Thanks again for looking into this issue.

My MongoDB database was lost after running a read-only script

I use MongoDB 4.2 on my local machine (windows 10). I have not changed any configurations, so the default behavior of only accepting local connections should be in place. (I only need to access it locally)
I was running a script that was reading data from my MongoDB, there are no writes to the db in this script. When all the numbers were crunched I noticed weird results, and saw that my database was suddenly gone. I checked my dbpath and the data was gone from there too! Could it be a hack, or was it MongoDB that dropped both the database and the raw data in the dbpath?
I've seen similar questions on this forum, mostly resolved by the author forgetting to reroute to the correct dbpath, which is not the case here. I've checked the log but the log seems to be very limited (I restarted mongod and could only see logging happening after the restart).
MongoDB does not delete all of the files in its data directory.
Most likely either you are checking in the wrong place or something external to MongoDB deleted its files.

'No reachable servers' error when beginning parse migration with MongoDB

I am in the process of migrating my app from Parse to MongoDB and IBM Bluemix, however I can't seem to reach the server when attempting the migration of data from Parse.
I've been following this tutorial tutorial, and I am currently on the step: Migrating data from Parse.com to your MongoDB instance
I am currently getting this error: No reachable servers when clicking 'Begin the migration'.
These are the connection strings in compose:
And I have tried entering various strings. I assumed this would work:
mongodb://username:password#aws-us-east-1-portal.7.dblayer.com:10803/mtcdatabase
But I get the same error. Obviously I'm changing username and password to my own credentials.
Anyone have any suggestions?
The issue ended up being that I was using the latest version of MongoDB, however Parse doesn't seem to support it. Therefore, I had to use MongoDB Classic version 3.0. Everything works great now.