Skip to main content

replutil

replutil Replication Manager command-line interface utility

Abstract

replutil Replication Manager utility

replutil is a command-line utility used to send commands to the Replication Manager (Memphis). It can be used instead of the Replication Manager GUI interface to script operations and list, create, and delete publications, replication plans, and availability groups that are managed by a Replication Manager. Operations to be performed can be put into a JSON file. The path to that file can be used as a single replutil input parameter.

replutil is included in the Replication Manager package and can be found in the Replication Manager main directory. The package contains example JSON files to execute some of the most common operations a user may want to run, as shown in Example 1, “Example JSON files.

Example 1. Example JSON files
$ ./replutil ./myscripts/createPublication.json
$ /opt/faircom/replicationmanager/replutil /home/fcadmin/deletePlan.json
> replutil.exe createPlan.json
> replutil.exe C:\scripts\deletePublication.json


The replutil utility has been widely used in our internal testing because for certain operations the GUI WEB interface may not be the most immediate way to interact with the Replication Manager — for example, the GUI might create a publication with a large number of files using automation scripts because there is no way to make scripts interact with the GUI WEB interface.

JSON file syntax

A JSON file is used to define the operations to be run against a Replication Manager instance. The Replication Manager instance is defined in the JSON file.

Each JSON file has a "memphis" object to define the instance, an optional "options" object that applies to the instance, and a target object. A target is a "manager", an "engine", a "publication", a "plan", or a "group".

Important

Each JSON file has only one target object, except that a "publication" object can be specified as a target or a parameter within a "group" or "plan" object.

Object

Description

memphis

Defines a replication manager instance.

options (instance)

Defines options for interactions with the replication manager instance.

manager

Defines operations with a targeted replication manager.

engine

Defines interactions with targeted managed engines.

publication

Creates and deletes targeted publications and availability groups.

plan

Defines interactions with targeted replication plans.

group

Defines interactions with targeted availability groups.

options (target)

Defines options for specific targets.

File considerations

Creation order and errors

Given the nature of the Replication Manager, it is not possible to isolate in a single operation all the commands executed by replutil. This means that if one of the operations fails, some replication objects specified in the input JSON may still exist after the failure — for example, if during a replication plan creation the creation of the publication fails, the replication plan may still exist and you will need to delete it manually.

Examples

In the Replication Manager bundle is a replutil.scripts directory that contains a set of JSON example input files. Parts of these examples may be used to compose your own JSON inputs.

Options for availability group replication plans

The deployment of an availability group creates an automatically managed replication plan. Replication Manager does not yet support the application of plan options. This means that actions specified in the "options" object under the "group" target will not be applied to the group plan.