Skip to content

Instantly share code, notes, and snippets.

@mblakele
Last active August 29, 2015 13:57
Show Gist options
  • Save mblakele/9451610 to your computer and use it in GitHub Desktop.
Save mblakele/9451610 to your computer and use it in GitHub Desktop.
Use the task server to migrate a forest.
xquery version "1.0-ml";
import module namespace ts="http://marklogic.com/xdmp/tieredstorage"
at "/MarkLogic/tieredstorage.xqy";
xdmp:spawn-function(
function() {
ts:forest-migrate(
xdmp:forest("my-forest"),
xdmp:host(),
'/media/xvdg/mldata',
(),
(),
(: Make sure the timeout is long enough to copy all data.
: Also make sure the Task Server time limit is long enough.
:)
("timeout=7200")) },
(: Must start the task in update mode, to avoid XDMP-UPDATEFUNCTIONFROMQUERY :)
<options xmlns="xdmp:eval">
<transaction-mode>update</transaction-mode>
</options>)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment