Skip to content

Moving data from csss‐site db to csss‐site‐backend

Gabe edited this page Dec 31, 2024 · 4 revisions

Migrating data from old csss-site's database

That's the database for https://github.com/CSSS/csss-site

(1) find the postgres password

This will be important for running pg_dump remotely. For example, you can access the postgres database remotely by doing psql -U postgres -p 5432 -h sfucsss.org.

(optional) you may wish to make a backup

The main database running csss-site is called postgres and owned by the postgres user. We can use the command pg_dump -U postgres -h sfucsss.org -p 5432 -d postgres -f csss_site_db_bak.sql to create a dump.

(2) run the migration script

export DB_PASSWORD="my very fancy password";
# the test db if you've configured docker this way
export DB_TARGET="postgresql+asyncpg://localhost:5444/test";
python migrate_from_about_officers.py
unset DB_PASSWORD;
unset DB_TARGET;
Clone this wiki locally