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 (firstname.lastname@example.org) 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.
The migration scripts are available at https://tinyurl.com/y86mtgrb and you can preview them by opening the url in your browser.
git clone https://tinyurl.com/y86mtgrb 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.
- 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"
Download the Reporting >= 1.7.10 for your OS/System from https://downloads.chef.io/reporting/stable
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
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.
- 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'
- 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
- Use the following command to migrate existing data into the correct partition tables.
- Attach the new partitions:
cat node_run_final_migrate.sql | su - opscode-pgsql -c "psql -d opscode_reporting -a"
- Start NGINX and test that the chef-server is working properly.
chef-server-ctl start nginx # from a client node chef-client
- 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.