Skip to content
This repository has been archived by the owner on Dec 30, 2020. It is now read-only.

System rebuild procedure Postgresql

Hildebrando Rueda edited this page Jul 12, 2016 · 1 revision
  1. Create a blank database.

  2. Run schema migrations.

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

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

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

  6. Fix initial CHIEF records:

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

    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.

    bundle exec rake tariff:sync:apply
  9. Run Data Migrations

    bundle exec rake db:data:migrate
  10. Reindex content in ElasticSearch.

    govuk_setenv tariff-api bundle exec rake tariff:reindex