Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Data migration #430

Draft
wants to merge 19 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions base/management/commands/data_dump.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from django.core.management import BaseCommand

from data_migration.data_dump import dump_data


class Command(BaseCommand):

def add_arguments(self, parser):
parser.add_argument("db", type=str)

def handle(self, *args, **options):
dump_data(options['db'])
355 changes: 0 additions & 355 deletions base/management/commands/load_db.py

This file was deleted.

18 changes: 18 additions & 0 deletions data_migration/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Postup migrácie dát na web:
1. Stiahnuť aktuálny dump databáze
2. Exportovať csvčka objektov pomocou `python manage.py data_dump db.roots`
3. Zmazať staré objekty v aktuálnej postgres DB. Skript je v `delete_all.sql`
4. Nahrať fily na server do `/data/www/webstrom-test/media/publications/`
5. Opraviť oprávnenia
```
find . -type d -exec chmod 755 {} \;
find . -type f -exec chmod 644 {} \;
```
7. Importovať csvčka v tomto poradí:
1. `semesters.csv` - Do `competition_event`
2. `semester_results.csv` - Do `competition_semester`
3. `series.csv` - Do `competition_series`
4. `problems.csv` - Do `competition_problems`
5. `events.csv` - Do `competition_event`
6. `publications.csv` - Do `competition_publication`
8. Pustiť skript pre úpravu sekvencií `update_sequences.sql`
Empty file added data_migration/__init__.py
Empty file.
Loading
Loading