Index: src/edu/ucsb/nceas/metacat/util/ReplicationUtil.java
===================================================================
--- src/edu/ucsb/nceas/metacat/util/ReplicationUtil.java	(revision 6530)
+++ src/edu/ucsb/nceas/metacat/util/ReplicationUtil.java	(revision 6531)
@@ -28,7 +28,6 @@
 
 /**
  * A suite of utility classes for the system metadata replication functions
- * @deprecated
  */
 public class ReplicationUtil {
 	  
Index: src/edu/ucsb/nceas/metacat/replication/ReplicationHandler.java
===================================================================
--- src/edu/ucsb/nceas/metacat/replication/ReplicationHandler.java	(revision 6530)
+++ src/edu/ucsb/nceas/metacat/replication/ReplicationHandler.java	(revision 6531)
@@ -59,6 +59,7 @@
 import edu.ucsb.nceas.metacat.DocumentImpl;
 import edu.ucsb.nceas.metacat.DocumentImplWrapper;
 import edu.ucsb.nceas.metacat.EventLog;
+import edu.ucsb.nceas.metacat.IdentifierManager;
 import edu.ucsb.nceas.metacat.McdbDocNotFoundException;
 import edu.ucsb.nceas.metacat.accesscontrol.AccessControlForSingleFile;
 import edu.ucsb.nceas.metacat.accesscontrol.XMLAccessDAO;
@@ -70,6 +71,7 @@
 import edu.ucsb.nceas.metacat.properties.PropertyService;
 import edu.ucsb.nceas.metacat.shared.HandlerException;
 import edu.ucsb.nceas.metacat.util.MetacatUtil;
+import edu.ucsb.nceas.metacat.util.ReplicationUtil;
 import edu.ucsb.nceas.utilities.PropertyNotFoundException;
 
 
@@ -380,6 +382,10 @@
       logReplication.info("ReplicationHandler.handleSingleXMLDocument - Sending message: " + docinfoUrl.toString());
       String docInfoStr = ReplicationService.getURLContent(docinfoUrl);
       
+      // strip out the system metadata portion
+      String systemMetadataXML = ReplicationUtil.getSystemMetadataContent(docInfoStr);
+   	  docInfoStr = ReplicationUtil.getContentWithoutSystemMetadata(docInfoStr);
+      
       docinfoParser.parse(new InputSource(new StringReader(docInfoStr)));
       Hashtable<String, String> docinfoHash = dih.getDocInfo();
       // Get home server of the docid
@@ -443,6 +449,16 @@
           }
       }
       
+      // process system metadata
+      if (systemMetadataXML != null) {
+    	  SystemMetadata sysMeta = 
+    		  TypeMarshaller.unmarshalTypeFromStream(
+    				  SystemMetadata.class, 
+    				  new ByteArrayInputStream(systemMetadataXML.getBytes("UTF-8")));
+    	  // need the guid-to-docid mapping
+      	  IdentifierManager.getInstance().createMapping(sysMeta.getIdentifier().getValue(), accNumber);
+      }
+      
       logReplication.info("ReplicationHandler.handleSingleXMLDocument - Successfully replicated doc " + accNumber);
       if (tableName.equals(DocumentImpl.DOCUMENTTABLE))
       {
@@ -523,6 +539,10 @@
 
       String docInfoStr = ReplicationService.getURLContent(docinfoUrl);
       
+      // strip out the system metadata portion
+      String systemMetadataXML = ReplicationUtil.getSystemMetadataContent(docInfoStr);
+   	  docInfoStr = ReplicationUtil.getContentWithoutSystemMetadata(docInfoStr);  
+   	  
       docinfoParser.parse(new InputSource(new StringReader(docInfoStr)));
       Hashtable<String, String> docinfoHash = dih.getDocInfo();
       
@@ -579,6 +599,16 @@
             }
         }
         
+        // process system metadata
+        if (systemMetadataXML != null) {
+      	  SystemMetadata sysMeta = 
+      		TypeMarshaller.unmarshalTypeFromStream(
+      				  SystemMetadata.class, 
+      				  new ByteArrayInputStream(systemMetadataXML.getBytes("UTF-8")));
+      	  // need the guid-to-docid mapping
+      	  IdentifierManager.getInstance().createMapping(sysMeta.getIdentifier().getValue(), accNumber);
+        }
+        
         logReplication.info("ReplicationHandler.handleSingleDataFile - Successfully to write datafile " + accNumber);
         /*MetacatReplication.replLog("wrote datafile " + accNumber + " from " +
                                     remote server);*/
Index: src/edu/ucsb/nceas/metacat/replication/ReplicationService.java
===================================================================
--- src/edu/ucsb/nceas/metacat/replication/ReplicationService.java	(revision 6530)
+++ src/edu/ucsb/nceas/metacat/replication/ReplicationService.java	(revision 6531)
@@ -84,6 +84,7 @@
 import edu.ucsb.nceas.metacat.shared.ServiceException;
 import edu.ucsb.nceas.metacat.util.DocumentUtil;
 import edu.ucsb.nceas.metacat.util.MetacatUtil;
+import edu.ucsb.nceas.metacat.util.ReplicationUtil;
 import edu.ucsb.nceas.metacat.util.SystemUtil;
 import edu.ucsb.nceas.utilities.FileUtil;
 import edu.ucsb.nceas.utilities.GeneralPropertyException;
@@ -568,7 +569,10 @@
 			
 
 			String docInfoStr = ReplicationService.getURLContent(docinfourl);
-
+			// strip out the system metadata portion
+			String systemMetadataXML = ReplicationUtil.getSystemMetadataContent(docInfoStr);
+			docInfoStr = ReplicationUtil.getContentWithoutSystemMetadata(docInfoStr);
+		   	  
 			//dih is the parser for the docinfo xml format
 			DocInfoHandler dih = new DocInfoHandler();
 			XMLReader docinfoParser = ReplicationHandler.initParser(dih);
@@ -578,6 +582,16 @@
 			
 			// Get home server of this docid
 			String homeServer = (String) docinfoHash.get("home_server");
+			
+			// process system metadata
+			if (systemMetadataXML != null) {
+				SystemMetadata sysMeta = 
+					TypeMarshaller.unmarshalTypeFromStream(
+							SystemMetadata.class,
+							new ByteArrayInputStream(systemMetadataXML.getBytes("UTF-8")));
+				// need the guid-to-docid mapping
+				IdentifierManager.getInstance().createMapping(sysMeta.getIdentifier().getValue(), docid);
+			}
       
         	// replicate doc contents
 			String createdDate = (String) docinfoHash.get("date_created");
@@ -774,6 +788,10 @@
 
 			String docInfoStr = ReplicationService.getURLContent(docinfourl);
 			
+			// strip out the system metadata portion
+		    String systemMetadataXML = ReplicationUtil.getSystemMetadataContent(docInfoStr);
+		   	docInfoStr = ReplicationUtil.getContentWithoutSystemMetadata(docInfoStr);
+
 			//dih is the parser for the docinfo xml format
 			DocInfoHandler dih = new DocInfoHandler();
 			XMLReader docinfoParser = ReplicationHandler.initParser(dih);
@@ -832,6 +850,16 @@
 		        		}
 		            }
 		        }
+		        
+		        // process system metadata
+		        if (systemMetadataXML != null) {
+		      	  SystemMetadata sysMeta = 
+		      		TypeMarshaller.unmarshalTypeFromStream(
+		      				  SystemMetadata.class, 
+		      				  new ByteArrayInputStream(systemMetadataXML.getBytes("UTF-8")));
+		      	  // need the guid-to-docid mapping
+		      	  IdentifierManager.getInstance().createMapping(sysMeta.getIdentifier().getValue(), docid);
+		        }
 
 				if (writeException != null) {
 					throw writeException;
@@ -922,6 +950,20 @@
 			DocumentImpl doc = new DocumentImpl(docid);
 			sb.append("<documentinfo><docid>").append(docid);
 			sb.append("</docid>");
+			
+			try {
+				// serialize the System Metadata as XML for docinfo
+				String guid = IdentifierManager.getInstance().getGUID(doc.getDocID(), doc.getRev());
+				SystemMetadata systemMetadata = IdentifierManager.getInstance().getSystemMetadata(guid);
+				ByteArrayOutputStream baos = new ByteArrayOutputStream();
+				TypeMarshaller.marshalTypeToOutputStream(systemMetadata, baos);
+				String systemMetadataXML = baos.toString("UTF-8");
+				sb.append("<systemMetadata>");
+				sb.append(systemMetadataXML);
+				sb.append("</systemMetadata>");
+			} catch(McdbDocNotFoundException e) {
+			  logMetacat.warn("No SystemMetadata found for: " + docid);
+			}
 			sb.append("<docname>").append(doc.getDocname());
 			sb.append("</docname><doctype>").append(doc.getDoctype());
 			sb.append("</doctype>");
