Loading TOC...

MarkLogic Server 11.0 Product Documentation
sec.ampsChangeModulesDatabase

sec.ampsChangeModulesDatabase(
   old-db as (Number|String),
   new-db as (Number|String)
) as Sequence

Summary

This function changes all amps that refer to one modules database to refer to a different database. This is useful when using database replication for disaster recovery and a replica security database is being promoted to master during a disaster scenario.

Parameters
old-db The ID of the old modules database.
new-db The ID of the new modules database.

Usage Notes

WARNING: because this function changes the modules database IDs for all the amps stored in the security database, the amps will no longer work with the old modules database. If this is being done for the purpose of disaster recovery with a replica modules database, the change will need to be reversed when the original data center reclaims the role as master.

Example


    // execute this against the security database
    declareUpdate();
    const sec = require('/MarkLogic/security');
        
    sec.ampsChangeModulesDatabase(xdmp.database("Security"),xdmp.database("Security-replica") );
    // changes the database ID for all of the amps in the system to make the amps function correctly in a disaster recovery scenario.  

      

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.