Skip to content

Migrating Single Server

doluiscontreras edited this page Jul 9, 2015 · 5 revisions

Migrating from MongoDB: Single Server

This guide explains how to do an offline data migration from MongoDB to TokuMX, for a single server, converting the existing data in MongoDB to TokuMX.

For other migration strategies, start with Migrating from MongoDB.

  1. Shut down the existing MongoDB server to make sure you get a consistent backup.

  2. Back up the MongoDB database with mongodump. You will need the dbpath from your command-line options or /etc/mongodb.conf (this is often /var/lib/mongodb), and you will need to choose a location for the backup (here, /var/lib/mongodb.backup).

    $ sudo mongodump --dbpath /var/lib/mongodb --out /var/lib/mongodb.backup
    
    - MongoDB latest version -
    
    $ sudo mongodump --out /var/lib/mongodb.backup
    
  3. Uninstall MongoDB. You can also remove the old dbpath since you have a backup.

  4. Install TokuMX for your distribution (instructions) and make sure it starts properly.

  5. Import your backup with mongorestore. You do not need --dbpath, it will connect to the running server by default.

    $ mongorestore /var/lib/mongodb.backup
    
  6. Connect with mongo and verify that you're connected to TokuMX and your data has been migrated.

    $ mongo
    TokuMX mongo shell v1.4.2-mongodb-2.4.10
    connecting to: test
    > db.serverBuildInfo().tokumxVersion
    1.4.2
    > show dbs
    ...
    
Clone this wiki locally