Cloning Supermarket instance to test upgrading

Will Fisher -

This will walk through the steps necessary to deploy a new instance of Chef Supermarket with the configuration and cookbooks from an existing instance. 

This can be used to deploy a new version of the Supermarket while leaving the existing system in place in case the upgrade does not work correctly.

  1. Deploy the current (old) Supermarket version on the new host using the actual cookbook supermarket-omnibus-cookbook. Be sure to include any other custom configuration from the current (old) Supermarket to the new instance.

    default['supermarket_omnibus']['package_version'] = '2.8.27'

  2. If you are not using AWS S3 storage for cookbooks, you will need to copy the cookbook storage from old Supermarket instance to the new one. Make sure the directory is writable by the supermarket user.

    • Old location if using "supermarket" cookbook: /srv/supermarket/shared/system/cookbook_versions
    • New location if using "supermarket-omnibus-cookbook" : /var/opt/supermarket/data/cookbook_versions

  3. Create a dump of the current supermarket database and restore it to the new instance.  Be sure to update the various hostyhost/localhost/user/database values as necessary to match your infrastructure:

    • On the existing/old supermarket host run: $ /opt/supermarket/embedded/bin/pg_dump -h hostyhost -U supermarket -d supermarket_production -F c -b -v -f smkt-date-blah-backup.dump
    • Then on the new supermarket host run: $ pg_restore -h localhost --clean --no-acl --no-owner -d supermarket_production -v smkt-date-blah-backup.dump

  4. Update DNS entries and double-check that the OAuth (oc-id) configuration is correct and that authorization through your Chef Server works fine.  This is also a good time to make sure any custom configurations have been applied correctly, for example using AWS S3 for cookbook storage.

  5. Now it's time to upgrade the newly deployed Supermarket to the latest version.  Change the package_version attribute to the desired version and before running chef-client

    default['supermarket_omnibus']['package_version'] = '3.1.42' # or :latest

    Note: While you can set this to :latest it is not recommended as this will automatically upgrade Chef Supermarket to the latest version with every chef-client converge.

  6. Verify that the new instance works correct and you're done.
Have more questions? Submit a request

Comments

Powered by Zendesk