Project

General

Profile

1 702 aaronmk
Installation:
2
    Install: make install
3 3370 aaronmk
        WARNING: This will delete the current public schema of your VegBIEN DB!
4 702 aaronmk
    Uninstall: make uninstall
5 3370 aaronmk
        WARNING: This will delete your entire VegBIEN DB!
6 3374 aaronmk
        This includes all archived imports and staging tables.
7 1957 aaronmk
    Reinstall all datasources at once: . bin/reinstall_all
8 554 aaronmk
9 702 aaronmk
Data import:
10 1550 aaronmk
    Import data into VegBIEN: . bin/import_all
11 3205 aaronmk
        Using column-based import: . bin/with_all 'import by_col=1'
12 1556 aaronmk
    Stop all running imports: . bin/stop_imports
13 2976 aaronmk
    Archive the last import: make schemas/rotate
14 3381 aaronmk
    Remove the last import: make schemas/public/reinstall
15
        WARNING: This will delete the current public schema of your VegBIEN DB!
16 2976 aaronmk
    Re-import data: make schemas/rotate; . bin/import_all
17
        Note: This will archive the last import.
18 3381 aaronmk
19 3545 aaronmk
Backups:
20 3547 aaronmk
    After a new import:
21
        make schemas/rotate
22
        Rename the rotated schema using the date in the first datasource's log
23
            file name
24 3548 aaronmk
        Delete previous imports so they won't bloat the full DB backup:
25
            make backups/public.<date>.backup/remove
26 3547 aaronmk
        make backups/<schema>.backup/test & make backups/vegbien.backup/all &
27 3408 aaronmk
    Archived imports:
28
        Back up: make backups/public.<date>.backup &
29 3546 aaronmk
            Note: To back up the last import, you must archive it first (above)
30 3410 aaronmk
        Test: make backups/public.<date>.backup/test &
31 3408 aaronmk
        Restore: make backups/public.<date>.backup/restore &
32
        Remove: make backups/public.<date>.backup/remove
33
    Full DB:
34 3546 aaronmk
        Back up, test, and rotate: make backups/vegbien.backup/all &
35 3439 aaronmk
        Back up and rotate: make backups/vegbien.backup/rotate &
36
        Test: make backups/vegbien.<date>.backup/test &
37
        Restore: make backups/vegbien.<date>.backup/restore &
38 554 aaronmk
39 1773 aaronmk
Datasource setup:
40
    Add a new datasource: make inputs/<short_name>/add
41
        If the datasource is a herbarium, <short_name> should be the herbarium
42
        code as defined by the Index Herbariorum <http://sweetgum.nybg.org/ih/>
43 3557 aaronmk
    Populate the src/ subdir with input data:
44
        Obtain/create CSVs for the tables present in the datasource:
45
            specimens, plots, organisms, stems
46
        Rename each CSV so it ends in ".<table>.<ext>" (see tables above)
47 3575 aaronmk
    Auto-create the map spreadsheets: make inputs/<name>/; make inputs/<name>/
48
        Note: Must be run twice to properly bootstrap all maps.
49 3576 aaronmk
    Map each table's columns:
50
        In the maps/ subdir, for each "via map" of the form "<via>.<table>.csv":
51
            Open the map in a spreadsheet editor
52
            In /mappings, open the corresponding "core map" of the form
53
                "<via>-VegBIEN.<table>.csv"
54
            In each row of the via map, set the right column to a value from the
55
                left column of the core map
56
            Save
57
        Regenerate the derived maps: make inputs/<name>/
58 1773 aaronmk
59 702 aaronmk
Schema changes:
60
    Regenerate schema from installed DB: make schemas/remake
61 1967 aaronmk
    Reinstall DB from schema: make schemas/reinstall
62 3370 aaronmk
        WARNING: This will delete the current public schema of your VegBIEN DB!
63 3441 aaronmk
    Reinstall errors tables: make inputs/install errors_table_only=1
64 702 aaronmk
    Sync ERD with vegbien.sql schema:
65
        Run make schemas/vegbien.my.sql
66
        Open schemas/vegbien.ERD.mwb in MySQLWorkbench
67
        Go to File > Export > Synchronize With SQL CREATE Script...
68
        For Input File, select schemas/vegbien.my.sql
69
        Click Continue
70
        Click in the changes list and press Ctrl+A or Apple+A to select all
71
        Click Update Model
72
        Click Continue
73
        Note: The generated SQL script will be empty because we are syncing in
74
            the opposite direction
75
        Click Execute
76
        Reposition any lines that have been reset
77
        Add any new tables by dragging them from the Catalog in the left sidebar
78
            to the diagram
79
        Remove any deleted tables by right-clicking the table's diagram element,
80
            selecting Delete '<table name>', and clicking Delete
81
        Save
82 1774 aaronmk
        If desired, update the graphical ERD exports (see below)
83
    Update graphical ERD exports:
84 702 aaronmk
        Go to File > Export > Export as PNG...
85 1774 aaronmk
        Select schemas/vegbien.ERD.png and click Save
86 702 aaronmk
        Go to File > Export > Export as SVG...
87 1774 aaronmk
        Select schemas/vegbien.ERD.svg and click Save
88 702 aaronmk
        Go to File > Export > Export as Single Page PDF...
89 1774 aaronmk
        Select schemas/vegbien.ERD.pdf and click Save
90
        Go to File > Print...
91
        For Pages, choose From 1 To 1
92
        In the lower left corner, click PDF > Save as PDF...
93
        Set the Title and Author to ""
94
        Select schemas/vegbien.ERD.core.pdf and click Save
95 203 aaronmk
96 1459 aaronmk
Testing:
97
    Mapping process: make test
98
    Map spreadsheet generation: make remake
99 1744 aaronmk
    Missing mappings: make missing_mappings
100 1459 aaronmk
    Everything (for most complete coverage): make test-all
101 702 aaronmk
102 3133 aaronmk
Documentation:
103
    To generate a Redmine-formatted list of steps for column-based import:
104
        make inputs/QMOR/import/steps.by_col.sql
105
106 702 aaronmk
General:
107
    To see a program's description, read its top-of-file comment
108
    To see a program's usage, run it without arguments
109 3389 aaronmk
    To remake a directory: make <dir>/remake
110
    To remake a file: make <file>-remake