Fixing 2018 Chef-Reporting partition tables

Will Fisher -

Due to a bug in the way data is migrated from the node_run and node_run_details tables it's possible that there may be old records left behind from 2016-12 and 2017-12, in addition to any data that was not migrated due to missing partition tables after 2018.

These instructions are intended to help with migrating reporting data into the new partition tables and to then clean up the node_run and node_run_details tables. If the migration fails you will need to contact Chef Support ( to walk you through completing the process.


  • chef-server >= 12.14.0
  • Enough disk space to duplicate the node_run and node_run_detail tables contents during the data migration.

Download the migration scripts

The migration scripts are available at and you can preview them by opening the url in your browser.

git clone reporting-migration
cd reporting-migration

There is also a "Download ZIP" button on the page for the above link if you cannot use git to download the migration scripts.

Installing new reporting version

  1. There is a small bug when installing Reporting 1.7.10 that will cause `opscode-reporting-ctl reconfigure` to error.  You can fix this by running the following sql commands.  This will be fixed in the next release of Reporting (1.7.13+)
cat fix_missing_partitions_2016_2017.sql | su - opscode-pgsql -c "psql -d opscode_reporting -a"
  1. Download the Reporting >= 1.7.10 for your OS/System from

  2. Install the new opscode-reporting package on the chef-server

# Ubuntu example
dpkg -i opscode-reporting_1.7.10-1_amd64.deb
# RHEL/CENTOS 7 example
rpm -Uvh opscode-reporting-1.7.10-1.el7.x86_64.rpm

# reconfigure reporting and chef-server
opscode-reporting-ctl reconfigure
chef-server-ctl reconfigure

Performing reporting data migration

NOTE: This will replicate data records in the database while the migration is being performed so will need to make sure there is enough free space to duplicate the node_run and node_run_details tables.

  1. Check that there is enough free space to perform the migration. Run the following command and look for the size of the node_run and node_run_details tables and make sure there is enough free space to duplicate that data. The duplicate data will get cleaned up in one of the last steps.
echo '\d+' | su - opscode-pgsql -c 'psql opscode_reporting'
  1. We’ll need to make sure no new data is being ingested into the system while the data is being migrated.
chef-server-ctl stop nginx
  1. Use the following command to migrate existing data into the correct partition tables.
/opt/opscode/embedded/bin/ruby migrate_2018.rb
  1. Attach the new partitions:
cat node_run_final_migrate.sql | su - opscode-pgsql -c "psql -d opscode_reporting -a"
  1. Start NGINX and test that the chef-server is working properly.
chef-server-ctl start nginx
# from a client node
  1. The old partition tables will be kept around with a suffix of _backup. When you are comfortable with the migration you can drop these tables.
Have more questions? Submit a request


Powered by Zendesk