Project

General

Profile

Task #2889

Story #2720: KNB, LTER, PISCO, ESA, SANPARKS roll out

Task #2880: SANParks MN upgrade

Consolidate the saeonocean.co.za and saeonmetacat.co.za replication servers in dataknp Metacata db

Added by Jing Tao over 12 years ago. Updated over 12 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
-
Start date:
2012-06-08
Due date:
% Done:

100%

Milestone:
CCI-1.0.0
Product Version:
*
Story Points:
Sprint:

Description

Currently, both saeonocean.co.za/knb/servlet/replication and saeonmetacat.co.za/knb/servlet/replication are in xml_replication table of dataknp metacat. Ben pointed out that saeonocean.co.za is replaced by saeonmetacat.co.za/knb/servlet/replication. So we need a plan to consolidate them into a single record.

History

#1 Updated by Jing Tao over 12 years ago

Here is the xml_replication table in dataknp:

metacat=> select * from xml_replication;
serverid | server | last_checked | replicate | datareplicate | hub
----------+------------------------------------------------+--------------+-----------+---------------+-----
1 | localhost | | 0 | 0 | 0
4 | datapha.saeon.ac.za/knb/servlet/replication | | 0 | 0 | 0
2 | knb.ecoinformatics.org/knb/servlet/replication | | 1 | 1 | 1
7 | saeonocean.co.za/knb/servlet/replication | 1980-01-01 | 1 | 1 | 0
8 | saeonmetacat.co.za/knb/servlet/replication | | 1 | 1 | 0

I took a look at the xmltables-postgres.sql. the tables will be involved are xml_documents and xml_revisions.

Here is the plan:

  1. Stop tomcat.

  2. Backup the db as the unix user postgres:

    pg_dump metacat > metacat-backup-06082012

  3. Check the number of documents in xml_documents where server location is saeonocean.co.za/knb/servlet/replication (under psql window):
    select count(*) from xml_documents where server_location=7;

  4. Update the documents in xml_documents where server location is saeonocean.co.za/knb/servlet/replication:
    update xml_documents set server_location=8 where server_location=7;
    The update number should match the number in the step 3.

  5. Check the number of documents in xml_revisions where server location is saeonocean.co.za/knb/servlet/replication:
    select count(*) from xml_revisions where server_location=7;

  6. Update the documents in xml_revisions where server location is saeonocean.co.za/knb/servlet/replication:
    update xml_revisions set server_location=8 where server_location=7;
    The update number should match the number in the step 5.

  7. Remove the saeonocean.co.za/knb/servlet/replication from xml_replication table.
    delete from xml_replication where serverid=7;

  8. Start tomcat

I ran the similar commands in my local machine and it worked. But I still request another eye to take a look.
Thanks.

#2 Updated by Ben Leinfelder over 12 years ago

Those steps look good. This is not required for the Metacat 2.0.0 upgrade, but it will make for a cleaner product in the long run. We can defer this until we are happy with the 2.0.0 upgrade if you'd like. priority is to get Metacat 2.0.0 deployed.

#3 Updated by Jing Tao over 12 years ago

  • Status changed from New to Closed

It turned out that there were no any documents associated with saeonocean.co.za in both xml_documents and xml_revisions table. But it do have some documents associated with saeonmetacat. I delete the saeonocean items successfully. Now the replication table looks like:
metacat=> select * from xml_replication;
serverid | server | last_checked | replicate | datareplicate | hub
----------+------------------------------------------------+--------------+-----------+---------------+-----
1 | localhost | | 0 | 0 | 0
4 | datapha.saeon.ac.za/knb/servlet/replication | | 0 | 0 | 0
8 | saeonmetacat.co.za/knb/servlet/replication | | 1 | 1 | 0
2 | knb.ecoinformatics.org/knb/servlet/replication | | 0 | 0 | 0
(4 rows)

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 14.8 MB)