Index: trunk/ippScripts/scripts/nightly_science.pl
===================================================================
--- trunk/ippScripts/scripts/nightly_science.pl	(revision 34010)
+++ trunk/ippScripts/scripts/nightly_science.pl	(revision 34018)
@@ -32,4 +32,8 @@
     exit($PS_EXIT_CONFIG_ERROR);
 }
+
+## for DB connection, want to use siteConfig DB settings
+my $ipprc =  PS::IPP::Config->new(); # IPP Configuration
+my $siteConfig = $ipprc->{_siteConfig};
 
 my $db;
@@ -2052,13 +2056,15 @@
 
 sub init_gpc_db {
-    ## change to use the site.config setting, however may want to use replicated scidbs instead
-    my $ipprc =  PS::IPP::Config->new(); # IPP Configuration
-    my $siteConfig = $ipprc->{_siteConfig};
+    ## change to use the siteConfig setting, while readonly probably do not want to use a readonly replicated DB incase it gets behind
+    my $dbserver = metadataLookupStr($siteConfig, 'DBSERVER');
+    my $dbuser = metadataLookupStr($ipprc->{_siteConfig}, "RO_DBUSER");
+    my $dbpass = metadataLookupStr($ipprc->{_siteConfig}, "RO_DBPASSWORD");
+    die "database configuration not set up" unless defined($dbserver);
+    die "database configuration not set up" unless defined($dbuser);
+    die "database configuration not set up" unless defined($dbpass);
+    #my $dbserver = 'ippdb01';
+    #my $dbuser = 'ippuser';
+    #my $dbpass = 'ippuser';
     use constant DB_SOCKET => '/var/run/mysqld/mysqld.sock';
-    # my $dbserver = 'ippdb01';
-    my $dbuser = 'ippuser';
-    my $dbpass = 'ippuser';
-    my $dbserver = metadataLookupStr($siteConfig, 'DBSERVER');
-    die "database configuration not set up" unless defined($dbserver);
     $db = DBI->connect("DBI:mysql:database=${dbname};host=${dbserver};" .
                        "mysql_socket=" . DB_SOCKET(),
