[MarkLogic Dev General] Syncing only documents that have changed

David Lee David.Lee at marklogic.com
Fri Feb 10 07:20:14 PST 2012


If you start outside ML you can connect to 2 different servers via XCC easily.
I've implemented a "sync" script in xmlsh which does datetime and checksum comparisons to sync between filesystem and an ML server.  It could easily be adopted to sync between 2 servers.

If you are inside ML then one idea would be to expose an HTTP service on the other server to do what you ask.

IMHO timestamps are not quite good enough unless your system clocks are synced.  The xmlsh sync script uses a MD5 property stored with the document.

-----------------------------------------------------------------------------
David Lee
Lead Engineer
MarkLogic Corporation
dlee at marklogic.com
Phone: +1 650-287-2531
Cell:  +1 812-630-7622
www.marklogic.com

This e-mail and any accompanying attachments are confidential. The information is intended solely for the use of the individual to whom it is addressed. Any review, disclosure, copying, distribution, or use of this e-mail communication by others is strictly prohibited. If you are not the intended recipient, please notify us immediately by returning this message to the sender and delete all copies. Thank you for your cooperation.


-----Original Message-----
From: general-bounces at developer.marklogic.com [mailto:general-bounces at developer.marklogic.com] On Behalf Of Murray, Gregory
Sent: Friday, February 10, 2012 9:56 AM
To: General MarkLogic Developer Discussion
Subject: [MarkLogic Dev General] Syncing only documents that have changed

I need to copy documents from one server (development) to another (production) but copy only documents that have changed, that is, each document on development that has a more recent last-modified property than the corresponding document on production.

Does xqsync have an option for this? I'm not seeing one.

If not, can Information Studio do this?

If not, is it possible to run an XQuery query that connects to an XDBC server on a different machine? If so, I could easily take the last-modified property of the document in the database against which I run the query (development) and compare it against the same property of the corresponding document on the production machine. In the past I've used the <database> option of xdmp:eval() to grab documents from a different database on the same machine, but in this case I need to connect to a different machine altogether.

Many thanks,
Greg

Gregory Murray
Digital Library Application Developer
Princeton Theological Seminary

_______________________________________________
General mailing list
General at developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


More information about the General mailing list