Skip to content

Instantly share code, notes, and snippets.

@ableasdale
Created March 21, 2013 17:00
Show Gist options
  • Save ableasdale/5214653 to your computer and use it in GitHub Desktop.
Save ableasdale/5214653 to your computer and use it in GitHub Desktop.
Reattach the source-db-1 forest to the "rebalance-me" database
(:::::::::::::: Step four - re-attach source-db-1 forest to rebalance-me database :::::::::::::::)
xquery version "1.0-ml";
import module namespace admin = "http://marklogic.com/xdmp/admin"
at "/MarkLogic/admin.xqy";
let $config := admin:get-configuration()
let $config := admin:database-detach-forest($config, xdmp:database("source-db"), xdmp:forest("source-db-1") )
let $config := admin:database-attach-forest($config, xdmp:database("rebalance-me"), xdmp:forest("source-db-1") )
return
admin:save-configuration($config)
(: confirm that the rebalance-me database now contains 9 forests (including the source-db-1 forest created in step one :)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment