Skip to content

Upgrading from v1.x to 2.0.0

Brian Riley edited this page Oct 15, 2018 · 15 revisions

Upgrading from v1.x to 2.0.0

The 2.0.0 release represents a major upgrade to the Roadmap codebase. Please follow the instructions below to ensure that your site functions properly after upgrade.

We highly recommend that you backup your existing database and that you perform these tasks in a development environment first so that you can confirm the functionality of your system before running the upgrade in your production environment!

Overview of data model changes

  • Added new table stats to facilitate the Usage Statistics page available to Admins
  • Added new versionable_id field to the following tables to help ensure accurate transfer of template customizations when a funder template changes: annotations, questions, sections, phases
  • Added default: false to boolean fields: guidance_groups.published, guidance_groups.optional_subset, notes.archived, orgs.is_other
  • Added limit: 80 to users.email
  • Dropped unused tables: file_types, file_uploads, splash_logs
  • Removed unused fields: guidances.question_id, orgs.wayfless_entity, orgs.parent_id, orgs.banner_text, orgs.logo_file_name, phases.slug, plans.slug, users.orcid_id, users.shibboleth_id
  • Various index changes in support of the above changes

Part One

The first script repairs any existing records in your guidance_groups, notes or orgs tables that would become invalid by the new validation rules added during the db:migrate step. It then runs the database migrations and finally runs a script that scans your tables for invalid data. We have added validation logic to the models in the codebase that may cause issues with your existing data. Please review the output of the script and fix any issues that it reports.

Please run rake upgrade:v2_0_0_part_1.

Review the output of the task and correct any data issues that were reported. You can either fix them manually in your database or add new rules to the lib/data_cleanup/rules directory. Any rules you add will be picked up and run in part 2.

TODO: Add explanation of issues reported and how to address them via data_cleanup rules

Part Two

The second script repairs any invalid data based on the rules you have created. It will then run through a script that initializes the new versional_id fields and fixes any issues you may have with the language codes stored in the DB.

Please run rake upgrade:v2_0_0_part_2

*Please note that the task that updates the versional_id fields can take in excess of 15 minutes depending on the size of your database.

Updating your deployment scripts

This release also involved some changes to the basic infrastructure of the system. Please check and update your deployment scripts as needed for your individual installations.

  • Tests are now run via RSpec instead of MiniTest. Use rpec spec/ to run the tests
  • Modifications were made to the Webpack configuration. To compile you assets for production (or any situation where you do not want Webpack to watch your assets for changes) you should now use npm run bundle -- -p --no-watch
  • We have updated the Gemfile to segregate deployment specific gems so that you can exclude them as needed when running bundle install --without [groupA] [groupB]. For example: bundle install --without mysql puma thin:
    • puma
    • thin
    • mysql
    • postgres
  • You will need to setup a job (e.g. via CRON) that runs the rake stat:build_monthly task at the beginning of each month

Changes to the developer guide

We have also updated our Wiki to improve our developer guides. Please review the updated documentation.

Clone this wiki locally