Project

General

Profile

1
#!/bin/bash -e
2
. "$(dirname "${BASH_SOURCE[0]}")"/../../../lib/runscripts/import.run
3
. "$(dirname "${BASH_SOURCE[0]}")"/../../../lib/runscripts/subdir.run
4
. "$(dirname "${BASH_SOURCE[0]}")"/../../../lib/sh/resume_import.sh
5

    
6
if self_not_included; then
7

    
8
## to reload GBIF MySQL:
9
# $ database=GBIF_new path/to/this/file load_data
10
# rename GBIF->GBIF_old, GBIF_new->GBIF on vegbiendev using the steps at
11
#     wiki.vegpath.org/MySQL_queries#Rename-database
12
# drop GBIF_old in phpMyAdmin (vegbiendev.nceas.ucsb.edu/phpmyadmin)
13

    
14
dumpfile_stem=GBIFPortalDB-2013-02-20
15
dumpfile_stem_path="$top_dir/$dumpfile_stem"
16

    
17
load_data() # usage: [database=GBIF_new] load_data
18
{
19
	echo_func
20
	
21
	use_local_remote
22
	database= mysql_root <<EOF
23
CREATE DATABASE IF NOT EXISTS $database DEFAULT CHARACTER SET utf8/*utf8_general_ci*/;
24
GRANT  ALL PRIVILEGES              ON $database.* TO   '$local_user'@'%' WITH GRANT OPTION;
25
REVOKE UPDATE, DELETE, ALTER, DROP ON $database.* FROM '$local_user'@'%';
26
EOF
27
	
28
	sql_preamble <"$top_dir"/../_src/"$dumpfile_stem".dump >"$dumpfile_stem_path".schema.0.preamble.sql
29
	cat "$dumpfile_stem_path".schema*.sql|mysql_root
30
	time cat "$dumpfile_stem_path".data*.sql|mysql_rm_privileged_statements\
31
|log_queries= mysql_local
32
}
33

    
34
import()
35
{
36
	echo_func
37
	top_make
38
}
39

    
40
fi
(12-12/12)