Make MongoDB dump to specific db version - mongodb

My MongoDB 3.2. import does not work when I try to import a dump exported from by MongoDB 3.6.
Is there a way of using "mongodump" to export to be compatible to MongoDB 3.2.

Usually MongoDB suggest to not dump/restore between clusters having more than one major version apart.
What you could do is restore your dump from MongoDB 3.6, restore it to a MongoDB 3.4 and then dump it again fom 3.4 to finally restore to to MongoDB 3.2.
See: https://stackoverflow.com/a/41844502/5945338
Usually there are incompatibilities with more than 1 major versions, please try to upgrade your MongoDB 3.2 if possible, otherwise you might need to automate the 3.4 transition part.

Related

Add a Mongodb 3.6 member to a replica set running Mongodb 3.2 [duplicate]

I'm trying to migrate a cluster from MongoDB 3.4 to 3.6.
When adding a new member which uses MongoDB 3.6, the initial synchronization fails with the following error:
Sync source had no feature compatibility version document at src/mongo/db/repl/replication_coordinator_impl.cpp 679
As I can see, this is a well-known error for those who try to migrate from 3.2 to 3.6. In my case, however, I'm trying to migrate from 3.4 (3.4.14 to be more specific, as reported by db.version() on every instance of the cluster) to 3.6. Since MongoDB official documentation makes no reference to the version 3.5, I'm not sure what am I supposed to do.
What am I doing wrong?
You can definitely upgrade a replica set or sharded cluster from MongoDB 3.4 to 3.6. Upgrades are currently only supported between adjacent major releases, so before upgrading to MongoDB 3.6 you need to complete the upgrade to MongoDB 3.4.
Sync source had no feature compatibility version document
This error message indicates that you've missed a prerequisite in prior upgrades: the replica set does not have featureCompatibilityVersion set to 3.4. This would be the case if you previously upgraded from a version of MongoDB older than 3.4 and haven't enabled backwards-incompatible features yet.
The Feature Compatibility Version (FCV) setting was added in MongoDB 3.4 to provide control over enabling backwards-incompatible data features that could complicate the downgrade process. For example, MongoDB 3.4 adds views, additional index formats (supporting collation and case-sensitive indexes), and a new Decimal BSON type.
After upgrading to 3.4 and confirming the likelihood of a downgrade is minimal, the FCV should be set using:
db.adminCommand( { setFeatureCompatibilityVersion: "3.4" } )
This is a prerequisite to upgrading to MongoDB 3.6 which has a similar final upgrade step to enable backwards-incompatible 3.6 features by setting the FCV to "3.6".
You can check the current FCV using:
db.adminCommand( { getParameter: 1, featureCompatibilityVersion: 1 } )
Since MongoDB official documentation makes no reference to the version 3.5, I'm not sure what am I supposed to do.
MongoDB 3.5 (and releases with the second component being an odd number) are not referred to in the upgrade notes as those are development releases (see: MongoDB version numbers). MongoDB 3.5 is the development release series leading up to the MongoDB 3.6 production release series.

Copy database from host with MongoDB 2.4 to host with MongoDB 3.0 via ssh tunnel

I trying to migrate an old application, using MongoDB 2.4 to a host, running MongoDB 3.0 in Docker container. For test purpose I am copying the data via ssh tunnel from the older to the newer version.
As I read about the updating process of MongoDB, first I should use Mongo 2.6 and then 3.0. However my test with avoiding the step with version 2.6 was successful and the database works fine. Could somebody explain me is that really possible or I have misunderstood something? It's really strange for me.
Upgrading from 2.4 to 2.6, prior to upgrading to 3.0 is a requirement according to the documentation:
To upgrade an existing MongoDB deployment to 3.0, you must be running
2.6. If you’re running a version of MongoDB before 2.6, you must upgrade to 2.6 before upgrading to 3.0. See Upgrade to 2.6 for the
procedure to upgrade from 2.4 to 2.6. Once upgraded to MongoDB 2.6,
you cannot downgrade to any version earlier than MongoDB 2.4.
Having said that, if you have run the corresponding test cases for your application, with a good test coverage, the indexes are working properly, and nothing has been broken I can not see a reason to worry about but ideally they suggest to migrate to 2.6 and then make the move to 3.0 to avoid data corruption.

Update Mongodb and keep databases

It is possible to update mongodb (Currently in version 2.0.6 and I need > 2.2) and keep databases ?
Mongodb running on Debian 7
MongoDB 2.0 data files are compatible with 2.2-series binaries without
any special migration process. However, always perform the upgrade
process for replica sets and sharded clusters using the procedures
that follow.
As said on the mongodb release notes. Also when your making an upgrade, since your current version is 2.0.6 you need to upgrade to 2.2 first.
If you want to go up to the latest version you have to keep upgrading version one by one as said on the release notes here.
Upgrading a Standalone version
Download binaries of the latest release in the 2.2 series from the MongoDB Download Page.
Shutdown your mongod instance. Replace the existing binary with the 2.2 mongod binary and restart MongoDB.

Does meteor update mongodb version automatically?

I have Meteor 1.2.2 installed and, according to MeteorBlog, it should comes Mongodb v3.0 or higher installed.
However, if a go on Mongo shell (meteor mongo) and do:
$ db.version()
I get: 2.6.7
Shouldn't it be 3.0? I tried meteor update and it says all packages are up to date.
Is there a way to update Mongodb to the latest version as accepted by Meteor?
Meteor 1.1 came with MongoDB support up to version 3 and you're supposed to be able to use Meteor in production along a MongoDB 3.0 database without major problems.
However they decided to keep the 2.6 branch regarding the Mongo version shipped with the Meteor tool and wait until Mongo 3.0 is mature enough before including it along official Meteor releases.
It means that Meteor updates its internal tool MongoDB version automatically, but at their own pace.
The local Mongo environment shipped with the Meteor development tool is something different than the actual Mongo deployment you usually use in production, and it is not required that the 2 versions be the same.

MongoDB WiredTiger issue

I have work a lot with MongoDB 2.6, then I decide to start using MongoDB 3.0.2.
1) When I create an Database using the shell command, the command return true but
the database is not created.
use NewDatabaseName
2) When i try to create some collections, sometime is created and sometime no
I'm using Debian 64Bit, latest version.
Anybody is having this issue?
MongoDB 3.0 is not compatible with all GUI.
For example today MongoVUE do not work at all.
But MongoDB Management Studio sounds like the only one that really work.
Also here some other post related.
mongodb version 3.0.0 client robomongo mongovue
Yes your problem is GUI-related. You can check out different tools on this page:
http://mongodb-tools.com/
I will most probably be using MongoChef from now on.