System rebuild procedure

Saulius Grigaliunas edited this page Feb 21, 2014 · 12 revisions
  1. Create a blank database.

  2. Run schema migrations.

    govuk_setenv tariff-api bundle exec rake db:migrate
  3. Import the initial seed files, download and put in the data folder. (~13 hours).

    govuk_setenv tariff-api time bundle exec rake importer:taric:import TARGET=data/OBEXTACT.xml
    govuk_setenv tariff-api time bundle exec rake importer:taric:import TARGET=data/OBEXTACTEN.xml
  4. Load support data like CHIEF standing data, standing national data, various notes.

    govuk_setenv tariff-api bundle exec rake tariff:remove
    govuk_setenv tariff-api bundle exec rake tariff:install
  5. Import CHIEF initial seed files.

  6. Fix initial CHIEF records:

    govuk_setenv tariff-api bundle exec rake tariff:support:fix_chief
    
  7. Perform initial CHIEF transformation (around 3 hours).

    govuk_setenv tariff-api time MODE=initial_load bundle exec rake tariff:sync:transform 
  8. Synchronize with latest updates (around 7.5 hours). Watch the process, curb (the downloader) fails sometimes with HostResolutionError for no reason.

    govuk_setenv tariff-api bundle exec rake tariff:sync:apply
  9. Reindex content in ElasticSearch.

    govuk_setenv tariff-api bundle exec rake tariff:reindex