P
P
pavelkunyavskiy2018-02-17 13:09:01
MongoDB
pavelkunyavskiy, 2018-02-17 13:09:01

How to properly roll a local database to a remote server?

Faced with an incomprehensible problem. Let me describe the situation first.
I had a local database, let's call it State #1, and a simple NodeJS application doing a simple fetch and returning JSON. I successfully transferred it to a remote server with the commands mongodumpmongorestore. Everything worked as expected.
After that, I made some test changes on the local database, let's call it State #2 now. They were successfully displayed on what the application gives, everything works ok. I decided to transfer that goodness to a remote server in the same way, repeating exactly the same commands. Did mongodumpmongorestore.
And then the problems began. When I go to the mongo console in the remote server, I see the new data in the required collection, but for some reason the application still does not see it. At the same time, an absolutely identical application on the local server works ok - there were no changes at all. The problem was solved only by completely demolishing the database on a remote server and deploying State No. 2 anew, to a clean Monga.
From this I conclude that the procedure mongorestorefor these purposes is incorrect.
What was the problem and how to properly perform such a task?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question