Project

General

Profile

« Previous | Next » 

Revision 33340

Added by Eri Katsari almost 10 years ago

added option of backing up public schema before switch

View differences:

modules/uoa-stats-service/trunk/src/main/java/eu/dnetlib/data/statsmanager/StatsManager.java
39 39
    public void promoteShadowSchema() throws Exception {
40 40
        Connection con = dataSource.getConnection();
41 41

  
42
        log.info("Replacing public schema  with shadow in " + dataSource.getConnection().getMetaData().getURL() + " ...");
43
        con.createStatement().execute(" DROP SCHEMA public CASCADE ; ");
44
        con.createStatement().execute("ALTER SCHEMA shadow RENAME TO public ;");
45

  
46
        // alter schema ownership to dnet so that the portal user can see it
47
        // log.info("Setting schema owner to Portal User..");
48
        //  con.createStatement().execute("ALTER SCHEMA public OWNER TO " + portalUser + " ;");
49

  
42
        log.info("Backing up and Replacing public schema  with shadow in " + dataSource.getConnection().getMetaData().getURL() + " ...");
43
        con.createStatement().execute("drop schema if exists backup ;");
44
        con.createStatement().execute("alter schema public rename to backup ;");
45
        con.createStatement().execute("alter schema  shadow rename TO public ;");
50 46
        log.info("All ops done!");
51 47
        con.close();
52 48
    }
modules/uoa-stats-service/trunk/src/main/resources/eu/dnetlib/data/statsmanager/springContext-statsManager.properties
6 6
services.statsManager.db.portalUser = dnet
7 7
services.statsManager.validationQueriesFile = classpath:/eu/dnetlib/data/statsmanager/validationQueries.xml
8 8

  
9
services.statsManager.actions.refreshAll=https://test.openaire.eu/stats/cacheController?action=refreshAll
10
services.statsManager.actions.refreshNums =https://test.openaire.eu/stats/cacheController?action=refreshNums
11
services.statsManager.actions.refreshCharts = https://test.openaire.eu/stats/cacheController?action=refreshCharts
12
services.statsManager.actions.promoteNums = https://test.openaire.eu/stats/cacheController?action=promoteNums
13
services.statsManager.actions.promoteCharts = https://test.openaire.eu/stats/cacheController?action=promoteCharts
14
services.statsManager.actions.promoteAll = https://test.openaire.eu/stats/cacheController?action=promoteAll
9
services.statsManager.actions.refreshAll=cacheController?action=refreshAll
10
services.statsManager.actions.refreshNums =cacheController?action=refreshNums
11
services.statsManager.actions.refreshCharts =cacheController?action=refreshCharts
12
services.statsManager.actions.promoteNums =cacheController?action=promoteNums
13
services.statsManager.actions.promoteCharts =cacheController?action=promoteCharts
14
services.statsManager.actions.promoteAll =cacheController?action=promoteAll
15
services.statsManager.actions.backup = cacheController?action=backup
16
services.statsManager.actions.migrate = cacheController?action=migrate
17
services.statsManager.actions.restore =cacheController?action=restore
18
services.statsManager.shadowSearchServiceURL=http://duffy.di.uoa.gr:8080/shadowSearch/services/searchWebService
15 19

  
16
services.statsManager.actions.backup = https://test.openaire.eu/stats/cacheController?action=backup
17
services.statsManager.actions.migrate = https://test.openaire.eu/stats/cacheController?action=restore
18
services.statsManager.actions.restore = https://test.openaire.eu/stats/cacheController?action=migrate
19

  
20

  
21

  
22

  
23
services.statsManager.shadowSearchServiceURL=http://duffy.di.uoa.gr:8080/shadowSearch/services/searchWebService
24 20
services.statsManager.httpsUsername = eri.katsari
25 21
services.statsManager.httpsPassword = UDxG2ydA
26 22

  

Also available in: Unified diff