Upgrade MongoDB from 2.6 to 4.2.6 - mongodb

I need to update MongoDB from version 2.6 to 4.2.6.
Could you please suggest effective way to upgrade the version without losing data or any kind of trouble.
Thank you in advance.

Each version has its associated release notes.
Upgrades must be done one version at a time (2.6 -> 3.0 -> 3.2 etc.).
Read the 3.0 release notes, identify which of them apply to your application, follow them, install 3.0 binaries, test your application, bump FCV if applicable (does not apply to 3.0 but will apply to later versions), test your application again, repeat the process for 3.2, etc.

Related

Clean install phpBB and import data

I need to update an old forum made in phpBB from version 3.0.11 to the new / stable version 3.2.2.
It is the first time that I put my hand at phpBB.
Making an update step by step is complicated: move from 3.0.11 to 3.0.14 ... from 3.0.14 to 3.1.x ... and from 3.1.x to 3.2.2.
So I thought: can I make a clean install of 3.2.2 and import everything I need (posts / forum / users / ALLINEED)?
Do you know any plugins that do this? maybe phpBB itself does it? Or maybe I just need to export the tables from mysql?
can you advise me something?
thank you
There is no plugin to do it, but there is a process to upgrade from 3.0 to 3.2. Your forum will be as clean as a fresh install.
The more secured solution is to begin by upgrading from 3.0.11 to 3.0.14 for security reasons.
When you can stop your forum during one or two hours, stop it and upgrade directly from 3.0 to 3.2. You don’t need to upgrade to 3.1 then to 3.2.
All explanations are provided in upgrade documentation from 3.0 to 3.2
Do not forget any step! After step3, I advise you to restore the 3.0.11 forum on a local machine or another server to be sure that your backup files are not corrupted. (Yes, it could happen during a download.)
I did it a lot of time. It works fine. One hour to do it cautiously and slowly (+ download and upload time).

Can I add a seed member on version 3.0 or 3.4 to a MongoDB replica set with members that are on version 2.6.8?

I want to upgrade all members to 3.4, however, I want to be able to switch back to 2.6.8 if anything goes wrong. In order to do this, I was hoping to add a new member 3.0 or 3.4 member to the existing replica set (on 2.6.8), replicate the data, then break it out and create a separate replica set on 3.4. After breaking out the synced up 3.x member, I would add further 3.x members to it and switch my app to use the new replica set. If the app breaks, I am planning to switch back to the older replica set. I read that replica set members can be on different versions. I am having trouble locating information on specific versions and potential issues. Also, the reason I keep mentioning 3.0 as well as 3.4, is because when I started planning, the latest version was 3.0, I also heard that I have to upgrade members incrementally, so from 3.0 to 3.2 to 3.4. Any advice?
This seems to be documented in Mongo Release Notes for 3.0, 3.2 and 3.4.
https://docs.mongodb.com/manual/release-notes/3.4-upgrade-replica-set/
"upgrade an existing MongoDB deployment to 3.4, you must be running a 3.2-series release.
To upgrade from a version earlier than the 3.2-series, you must successively >upgrade major releases until you have upgraded to 3.2-series. For example, if >you are running a 3.0-series, you must upgrade first to 3.2 before you can >upgrade to 3.4."
https://docs.mongodb.com/manual/release-notes/3.2-upgrade/
https://docs.mongodb.com/manual/release-notes/3.2-downgrade/
"To upgrade an existing MongoDB deployment to 3.2, you must be running a 3.0->series release.
To upgrade from a 2.6-series release, you must upgrade to the latest 3.0-series >release before upgrading to 3.2. For the procedure to upgrade from the 2.6->series to a 3.0-series release, see Upgrade to 3.0."
https://docs.mongodb.com/manual/release-notes/3.0-upgrade/
"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."
In a previous project, we had to upgrade from 2.6.8 -> 3.0 (upgrade members in a rolling manner to keep the cluster up and running). Our rollback plan was to decide at this point whether everything was OK and if not rollback to 2.6.8. If it was ok, upgrade from 3.0 -> 3.2 (again, a rolling upgrade). We did not try a two step downgrade, but I guess it is theoretically possible based on what Mongo documents. From 3.4, you will have to review the release notes to see if it is theoretically possible!
Also note that you need to consider upgrading your client drivers along the way. There are compatibility issues with client driver versions as well.

For parse migration, does mongodb have to be 3.2.6 or is 3.2.* ok?

Why is 3.0.* ok but 3.2 version has to specifically be 3.2.6? Is 3.2.1 ok?
Any version is fine when doing a fresh install with parse-server but from parse.com you will not be able to move to 3.2. Seems that migration tool wont allow it.
I moved to 3.0 and from there did backup/restore to 3.2.
However i would always strongly suggest that one in general runs the latest version if you can.
I do know that all test on mongodb 3.2.6 are passing including geo queries.

Can MongoDB be updated from 2.2 to 3.2 directly

I would like to know whether it is possible to upload MongoDB from 2.2 to 3.2 without any intermediary upgrades. If it is possible please share a resource that can follow. I would like to know what things to looks out for when up grading
No you can't.
From the documentation,
Upgrade Requirements
To upgrade an existing MongoDB deployment to 3.2, you must be running a 3.0-series release.
To upgrade from a 2.6-series release, you must upgrade to the latest 3.0-series release before upgrading to 3.2. For the procedure to upgrade from the 2.6-series to a 3.0-series release, see Upgrade MongoDB to 3.0.

upgrade mongo 2.0.0 to 3.0.0 directly

I have a production mongoDB 2.0 server running on a single machine. I need to upgrade it to the latest version. Would it be possible to just restore the dump from old server into the new server? Or would I have to do it one upgrade at a time?
No, in the general case, absolutely not. Best practice is to upgrade through each major version, following the upgrade instructions in each set of release notes. You can do this without downtime if you are running a replica set, at least from 2.4 -> 3.0 (I'm not as familiar with 2.0 and 2.2 since they are ancient).