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 same process should work when upgrading from MongoDB prior to version 3.0 (such as, 2.4 and 2.6).
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:
- Restart the TokuMX server without the
--auth
parameter:
$ service tokumx stop $ sed -i'' s/^auth/#auth/ /etc/tokumx.conf $ service tokumx start
2. Run the allDbStats.js
script
to record database state before migration:
$ mongo ./allDbStats.js > ~/allDbStats.before.out
- Perform a dump of the database:
$ mongodump --out /your/dump/path
- Perform a dump of the indexes:
$ ./tokumx_dump_indexes.js > /your/dump/path/tokumxIndexes.json
- Stop the TokuMX server:
$ service tokumx stop
- 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
- 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
- Install Percona Server for MongoDB as described in the Installation Guide.
9. 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.confFor more information about configuring the storage engine, see Switching Storage Engines.
- Start the
mongod
server:
$ service mongod start
- Restore the collections without indexes:
$ mongorestore --noIndexRestore /your/dump/path
- 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' "
- Run the
allDbStats.js
script to record database state after migration:
$ mongo ./allDbStats.js > ~/allDbStats.after.out
- Restart the
mongod
server with authentication:
$ service mongod stop $ sed -i'' s/^i#auth/auth/ /etc/mongod.conf $ service mongod start
Contact Us
For free technical help, visit the Percona Community Forum.To report bugs or submit feature requests, open a JIRA ticket.
For paid support and managed or professional services, contact Percona Sales.