1
|
1.[beta] work on beta
|
2
|
1.1 connect to beta
|
3
|
ssh argiro.kokogiannaki@beta.services.openaire.eu
|
4
|
1.2 Export tables from beta
|
5
|
pg_dump -U dnet -h localhost dnet_openaireplus -t context -t project -t result -t has_source_context -t has_source_project -t has_source_result -t has_target_project -t has_target_result -t claim -t notification --password >claims20190720.sql
|
6
|
|
7
|
pg_dump --column-inserts --data-only -U dnet -h localhost dnet_openaireplus -t notification --password >notifications20190801.sql
|
8
|
1.3 Get records
|
9
|
|
10
|
ll /srv/claims/records/
|
11
|
tar -czvf records.beta.20190801.tar.gz /srv/claims/records/
|
12
|
scp records.beta.20190801.tar.gz argirok@scoobydoo.di.uoa.gr:~/
|
13
|
|
14
|
2. dump in local db
|
15
|
|
16
|
2.1 create local db
|
17
|
create database claims_beta
|
18
|
|
19
|
|
20
|
2.2 insert records
|
21
|
psql -h localhost -U postgres claims_beta --password < claims20190720.sql
|
22
|
|
23
|
|
24
|
3. prepare db to put new records
|
25
|
|
26
|
3.1 create db
|
27
|
create database claims_prod
|
28
|
|
29
|
3.2 create claim tables for local db
|
30
|
|
31
|
3.3 set sequence numbers not to override anything in production:
|
32
|
ALTER SEQUENCE result_id_seq RESTART WITH 10000; ALTER SEQUENCE claim_id_seq RESTART WITH 12000;
|
33
|
|
34
|
|
35
|
4. Run Java migration
|
36
|
|
37
|
5. export prod records
|
38
|
|
39
|
pg_dump --column-inserts --data-only -U postgres -h localhost movedb -t context -t project -t result -t has_source_context -t has_source_project -t has_source_result -t has_target_project -t has_target_result -t claim -t --password >claims_new_20190720.sql
|
40
|
|
41
|
6. [prod] set sequence numbers after the ids of the new claims
|
42
|
psql -h postgresql.services.openaire.eu dnet_openaireplus -U dnet
|
43
|
ALTER SEQUENCE result_id_seq RESTART WITH 11000; ALTER SEQUENCE claim_id_seq RESTART WITH 12800;
|
44
|
|
45
|
7.[prod]
|
46
|
|
47
|
7.1 insert records in production db
|
48
|
psql -U dnet -h postgresql.services.openaire.eu dnet_openaireplus --password < claims_new_20190720.sql
|
49
|
|
50
|
8.[prod] notifications in production
|
51
|
|
52
|
8.1 insert notifications records in production db
|
53
|
psql -U dnet -h postgresql.services.openaire.eu dnet_openaireplus --password < notifications20190801.sql
|
54
|
|
55
|
|
56
|
9. Copy files
|
57
|
|
58
|
9.1[beta] In /srv/claims/records/ folder of beta run copy.sh script
|
59
|
set date in case you don't want to get them all (but all are new anyway)
|
60
|
9.2 [prod] copy new records folder in production add in /srv/claims/ folder
|
61
|
|
62
|
9.3 [prod] in /srv/claims/ folder run copyToProduction.sh script
|
63
|
|
64
|
|
65
|
|