Macs
Macs

Reputation: 199

migrate the MMAPv1 generated data to WiredTiger

I am running a (keystonejs) webapp using mongodb 3.0 as database. I cloned the webapp and run a second instance using a 3.2 mongodb release (on a generated but yet empty data base). What I need to do now is get the data from the first database to the second. Since mongodb 3.2 uses a different default storage engine which is WiredTiger the clone uses that one. However the original app uses MMAPv1. Is there a easy way to migrate data create by MMAPv1 to WiredTiger?

Upvotes: 3

Views: 6308

Answers (2)

Saleem
Saleem

Reputation: 8978

You can create replica set and add new machine to it. Doing so, you'll have latest data on newer server. Once replication is over, switch new machine to primary and shutdown old server if you want. This way you can easily clone your existing data to wiredTiger without loosing data or negatively effecting existing application.

Upvotes: 4

Karl-Johan Sjögren
Karl-Johan Sjögren

Reputation: 17532

Create a backup of the database on your old server using mongodump, restore it back to the new one using mongorestore, done. It's covered quite well in the documentation.

https://docs.mongodb.org/manual/tutorial/change-standalone-wiredtiger/

Upvotes: 3

Related Questions