Skip to content
Joe Wandy edited this page Dec 14, 2020 · 4 revisions

Welcome to the ms2ldaviz wiki!

A collection of useful tips for ms2lda.

1. Creating database dump on the digitalocean server

The following are the steps to manually backup and restore the Ms2ldavis database on DigitalOcean. We can do this is on top of the regular automatic backup from DO, e.g. when we want to import data locally.

To dump:

$ sudo -u postgres -i
$ pg_dump -U django -h localhost -Fc --no-owner --no-acl --clean > ms2ldaviz_db.dump

Alternatively, we can also remote dump from our local computer:

$ pg_dump -U django -h <ip_address> -Fc --no-owner --no-acl --clean > ms2ldaviz_db.dump

To restore:

$ sudo -u postgres -i
$ dropdb postgres
$ createdb postgres
$ pg_restore -Fc ms2ldaviz_db.dump -d postgres --clean --no-acl --no-owner

2. Running Jupyter Notebook

Django extensions is included in the project, so you can run Jupyter notebook and access django objects from it. This is very useful for debugging. From the virtual environment:

$ python manage.py shell_plus --notebook --settings=ms2ldaviz.settings_joe