Daniel Doubrovkine bio photo

Daniel Doubrovkine

aka dB., CTO at artsy.net, fun at playplay.io, NYC

Email Twitter LinkedIn Github

I was upgrading a system to MongoDB 3.2.0 and found a bug, TOOLS-1039: mongoexport chokes on data with quotes. Yikes.

We ended up downgrading mongodb-org-tools instead of rolling back the entire database upgrade, here’s the recipe.

# install and configure mongodb, https://supermarket.chef.io/cookbooks/mongodb3
include_recipe 'mongodb3::default'

# downgrade mongoexport, see https://jira.mongodb.org/browse/TOOLS-1039
yum_repository 'mongodb-org-2.6' do
  description 'MongoDB 2.6 Repository'
  baseurl 'http://downloads-distro.mongodb.org/repo/redhat/os/x86_64/'
  gpgcheck false
  action :create

yum_package 'mongodb-org-tools' do
  allow_downgrade true
  action :install
  version '2.6.11-1'

Which gives.

[db@rails-app1 ~]$ mongo --version
MongoDB shell version: 3.2.0
[db@rails-app1 ~]$ mongoexport --version
version 2.6.11