Skip to content

Instantly share code, notes, and snippets.

@pnispel
Created October 24, 2018 20:41
Show Gist options
  • Save pnispel/de5e91242f75ac08371750bcd9451eef to your computer and use it in GitHub Desktop.
Save pnispel/de5e91242f75ac08371750bcd9451eef to your computer and use it in GitHub Desktop.

Storage Profiles

Summary

Storage profiles are stored at the company level and used to route a companies files to the correct storage location. There are three storage profiles right now: default govcloud and apse2 with the main regions being us-east-1, us-gov-west-1, and ap-southeast-2 respectively.

Moving a company from one storage profile to another

  1. Switch the company storage profile in the rails_console: Company.find(<company_id>).update(storage_profile_key: <new_profile_name>)
  2. Use the storage profile migrator to migrate old files to the new profile
migrator = Storage::CompanyStorageProfileMigrator.new(company_id: , new_profile:)
migrator.perform

Caveat - There are certain scenarios where a storage profile has been switched for a company when it has items in sidekiq on a different profile. For this reason the company should have no file workers in sidekiq when the profile switch is made.

Starting a company on a storage profile

  1. Go to procore.com/super/companies/new and create a company. Find the company_id on the home page.
  2. Use that company_id to switch the storage_profile `Company.find(<company_id>).update(storage_profile_key: <storage_profile>)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment