Buy Percona ServicesBuy Now!

Upgrading from Percona TokuMX to Percona Server for MongoDB

This guide describes how to upgrade existing Percona TokuMX instance to Percona Server for MongoDB. The following JavaScript files are required to perform the upgrade:

  • allDbStats.js
  • tokumx_dump_indexes.js
  • psmdb_restore_indexes.js

You can download those files from GitHub.

Warning

Before starting the upgrade process, it is recommended that you perform a full backup.

To performa the upgrade:

  1. Restart the TokuMX server without the --auth parameter:
$ service tokumx stop
$ sed -i'' s/^auth/#auth/ /etc/tokumx.conf
$ service tokumx start
  1. Run the allDbStats.js script to record database state before migration:
$ mongo ./allDbStats.js > ~/allDbStats.before.out
  1. Perform a dump of the database:
$ mongodump --out /your/dump/path
  1. Perform a dump of the indexes:
$ ./tokumx_dump_indexes.js > /your/dump/path/tokumxIndexes.json
  1. Stop the TokuMX server:
$ service tokumx stop
  1. Move the data directory and copy the configuration for safekeeping.
$ mv /var/lib/tokumx /var/lib/tokumx.bak
$ cp /etc/tokumx.conf /etc/tokumx.conf.bak
  1. Uninstall all TokuMX packages.

If you are using a Debian or Ubuntu based distribution:

$ dpkg -P --force-all `dpkg -l | grep tokumx | awk '{print $2}'`

If you are using a Red Hat or CentOS based distribution:

$ yum remove -y tokumx-enterprise-common-2.0.2-1.el6.x86_64 \
    tokumx-enterprise-server-2.0.2-1.el6.x86_64 \
    tokumx-enterprise-2.0.2-1.el6.x86_64
  1. Install Percona Server for MongoDB as described in the Installation Guide.
  2. Stop the mongod service, configure the storage.engine parameter to run PerconaFT and disable --auth in /etc/mongod.conf:
$ service mongod stop
$ sed -i '/engine: \*PerconaFT/s/#//g' /etc/mongod.conf
$ sed -i'' s/^auth/#auth/ /etc/mongod.conf

For more information about configuring the storage engine, see Switching Storage Engines.

  1. Start the mongod server:
$ service mongod start
  1. Restore the collections without indexes:
$ mongorestore --noIndexRestore /your/dump/path
  1. Restore the indexes (this may take a while). This step will remove clustering options to the collections before inserting.
$ ./psmdb_restore_indexes.js --eval " data='/your/dump/path/tokumxIndexes.json' "
  1. Run the allDbStats.js script to record database state after migration:
$ mongo ./allDbStats.js > ~/allDbStats.after.out
  1. Restart the mongod server with authentication:
$ service mongod stop
$ sed -i'' s/^i#auth/auth/ /etc/mongod.conf
$ service mongod start
Visit Percona Store


General Inquiries

For general inquiries about our open source software and database management tools, please send us your question and someone will contact you.