Project

General

Profile

1
Installation:
2
    Install: make install
3
        WARNING: This will delete the current public schema of your VegBIEN DB!
4
    Uninstall: make uninstall
5
        WARNING: This will delete your entire VegBIEN DB!
6
        This includes all archived imports and staging tables.
7
    Reinstall all datasources at once: . bin/reinstall_all
8

    
9
Data import:
10
    Import data into VegBIEN: . bin/import_all
11
        Using column-based import: . bin/with_all 'import by_col=1'
12
    Stop all running imports: . bin/stop_imports
13
    Archive the last import: make schemas/rotate
14
    Remove the last import: make schemas/public/reinstall
15
        WARNING: This will delete the current public schema of your VegBIEN DB!
16
    Re-import data: make schemas/rotate; . bin/import_all
17
        Note: This will archive the last import.
18

    
19
Backups:
20
    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
        Delete previous imports so they won't bloat the full DB backup:
25
            make backups/public.<date>.backup/remove
26
        make backups/<schema>.backup/test & make backups/vegbien.backup/all &
27
    Archived imports:
28
        Back up: make backups/public.<date>.backup &
29
            Note: To back up the last import, you must archive it first (above)
30
        Test: make backups/public.<date>.backup/test &
31
        Restore: make backups/public.<date>.backup/restore &
32
        Remove: make backups/public.<date>.backup/remove
33
    Full DB:
34
        Back up, test, and rotate: make backups/vegbien.backup/all &
35
        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

    
39
Datasource setup:
40
    Add a new datasource: make inputs/<name>/add
41
        <name> may not contain spaces, and should be abbreviated.
42
        If the datasource is a herbarium, <name> should be the herbarium code as
43
        defined by the Index Herbariorum <http://sweetgum.nybg.org/ih/>
44
    Populate the src/ subdir with input data:
45
        Obtain/create CSVs for the table(s) present in the datasource:
46
            specimens, plots, organisms, stems
47
        Rename each CSV so it ends in ".<table>.<ext>" (see tables above)
48
    Auto-create the map spreadsheets: make inputs/<name>/; make inputs/<name>/
49
        Note: Must be run twice to properly bootstrap all maps.
50
    Map each table's columns:
51
        In the maps/ subdir, for each "via map" of the form "<via>.<table>.csv":
52
            Open the map in a spreadsheet editor
53
            In /mappings, open the corresponding "core map" of the form
54
                "<via>-VegBIEN.<table>.csv"
55
            In each row of the via map, set the right column to a value from the
56
                left column of the core map
57
            Save
58
        Regenerate the derived maps: make inputs/<name>/
59
    Install the staging tables: make inputs/<name>/install quiet=1 &
60
        To view the log: tail -f inputs/<name>/import/install-<table>.log.sql
61
    Accept the test cases: make inputs/<name>/test/accept-all
62
    Commit: svn ci -m "Added inputs/<name>/" inputs/<name>/
63
    Update vegbiendev:
64
        On vegbiendev: svn up
65
        On local machine: make inputs/upload
66

    
67
Schema changes:
68
    Regenerate schema from installed DB: make schemas/remake
69
    Reinstall DB from schema: make schemas/reinstall
70
        WARNING: This will delete the current public schema of your VegBIEN DB!
71
    Reinstall errors tables: make inputs/install errors_table_only=1
72
    Sync ERD with vegbien.sql schema:
73
        Run make schemas/vegbien.my.sql
74
        Open schemas/vegbien.ERD.mwb in MySQLWorkbench
75
        Go to File > Export > Synchronize With SQL CREATE Script...
76
        For Input File, select schemas/vegbien.my.sql
77
        Click Continue
78
        Click in the changes list and press Ctrl+A or Apple+A to select all
79
        Click Update Model
80
        Click Continue
81
        Note: The generated SQL script will be empty because we are syncing in
82
            the opposite direction
83
        Click Execute
84
        Reposition any lines that have been reset
85
        Add any new tables by dragging them from the Catalog in the left sidebar
86
            to the diagram
87
        Remove any deleted tables by right-clicking the table's diagram element,
88
            selecting Delete '<table name>', and clicking Delete
89
        Save
90
        If desired, update the graphical ERD exports (see below)
91
    Update graphical ERD exports:
92
        Go to File > Export > Export as PNG...
93
        Select schemas/vegbien.ERD.png and click Save
94
        Go to File > Export > Export as SVG...
95
        Select schemas/vegbien.ERD.svg and click Save
96
        Go to File > Export > Export as Single Page PDF...
97
        Select schemas/vegbien.ERD.pdf and click Save
98
        Go to File > Print...
99
        For Pages, choose From 1 To 1
100
        In the lower left corner, click PDF > Save as PDF...
101
        Set the Title and Author to ""
102
        Select schemas/vegbien.ERD.core.pdf and click Save
103

    
104
Testing:
105
    Mapping process: make test
106
    Map spreadsheet generation: make remake
107
    Missing mappings: make missing_mappings
108
    Everything (for most complete coverage): make test-all
109

    
110
Documentation:
111
    To generate a Redmine-formatted list of steps for column-based import:
112
        make inputs/QMOR/import/steps.by_col.sql
113

    
114
General:
115
    To see a program's description, read its top-of-file comment
116
    To see a program's usage, run it without arguments
117
    To remake a directory: make <dir>/remake
118
    To remake a file: make <file>-remake
(2-2/3)