Skip to content

Database: Initialization and Loading in BibTeX files

A Lee edited this page Sep 5, 2017 · 3 revisions

Initialization

  1. Place an SQL database dump in the root folder of the project and call it catalog.sql (the name of the file is set in the tasks.py restore_from_dump function).
  2. Delete your old docker volumes and containers (docker-compose down -v) and bring all the containers up again (docker-compose up -d).
  3. Run inv rfd in the django container, e.g., docker-compose exec django inv rfd. The data should now be loaded into the database.

Loading in BibTeX files

To load in a BibTeX file run the load_bibtex management command. For example, to load a file named abm_publications_2016.bib into the database as user foo you would run

./manage.py load_bibtex -f abm_publications_2016.bib -u foo

Dump database

% docker-compose exec django bash 
% pg_dump -h db -U catalog comses_catalog > catalog.sql
% mv catalog.sql /path/to/docker/volume # e.g., /catalog/logs