"plan"

The plan object specifies actions performed within replication plans

Plan actions summary

Table 1. "plan" object actions summary
Action Description Type
add_subscription

creates an array of new subscriptions inside a specified existing replication plan

Note

Each subscription can be associated with an existing publication or with a new publication as specified in the "create" action of the "publication" object.

create creates a specified replication plan string
delete deletes an existing publication specified with the name parameter
delete_subscription deletes the specified subscriptions from the specified existing replication plan
deploy deploys the specified plan string
resync

forces the resynchronization of the files specified under a certain publication

Note

a replication plan "name" and a "publication" or list of "files" that belong to the specified plan are required.

show

shows the details of a replication plan, the servers involved in the replication plan options, and all the subscribed publications

Note

Only "name" is required.

start starts a replication plan string
stop stops an existing replication plan array

Examples

"create" existing publication example

{
  "memphis": {
     "name": "MEMPHIS",
     "host": "localhost",
     "port": "7597",
     "uid": "admin",
    "pwd": "ADMIN"
  },
  "options": {
    "profile": true,
    "replace": true,
    "ignoredeploy": false,
    "recursivedel": false,
    "recursivesearch": true
  },
  "plan": {
    "actions": [
      "create",
    ],
    "name": "planFiles",
    "sourceEngine": "FAIRCOMS@HOST001",
    "destEngine": "FAIRCOM2@HOST002",
    "subscriptions": [
      {
        "name": "subFiles",
        "bidirectional": false,
        "redir": [
        {
          "source": "E:\\sw\\eu_database\\",
          "target": "D:\\backup\\repldata\\"
        }
        ],
        "publication": {
          "name": "pubFiles",
          "create": false
        }
      }
      ]
    }
  }
 
 

"create" publication example

{
  "memphis": {
     "name": "MEMPHIS",
     "host": "localhost",
     "port": "7597",
     "uid": "admin",
    "pwd": "ADMIN"
  },
  "options": {
    "profile": true,
    "replace": true,
    "ignoredeploy": false,
    "recursivedel": false,
    "recursivesearch": true
  },
  "plan": {
    "actions": [
      "create"
    ],
    "name": "planFiles",
    "sourceEngine": "FAIRCOMS@HOST001",
    "destEngine": "FAIRCOM2@HOST002",
    "subscriptions": [
      {
        "name": "subFiles",
        "bidirectional": false,
        "redir": [
        {
          "source": "Z:\\db",
          "target": "D:\\backup\\repldata\\"
        }
        ],
        "publication": {
          "name": "pubPW",
          "create": true,
          "mode": "folder",
          "item": "Z:\\db\\pw",
          "wildcards": ["*dat"],
          "recursive": true
        }
      }
      ]
    }
  }

 
 

"create" (false) of a non-main publication example

{
  "memphis": {
    "name": "MEMPHIS",
    "uid": "admin",
    "pwd": "ADMIN"
  },
  "plan": {
    "actions": [
      "create",
      "deploy",
      "start"
    ],
    "name": "planFiles",
    "sourceEngine": "FAIRCOMS@MAURO-PC",
    "destEngine": "FAIRCOM2@MAURO-PC",
    "subscriptions": [
      {
      "name": "subFiles",
      "bidirectional": false,
      "publication": {
          "name": "pubFiles",
          "create": false
        }
      }
      ]
    }
  }
 
 

"create" (true) of a non-main publication example

{
  "memphis": {
    "name": "MEMPHIS",
    "uid": "admin",
    "pwd": "ADMIN"
  },
  "plan": {
    "actions": [
      "create"
    ],
    "name": "planFiles2",
    "sourceEngine": "FAIRCOMS@MAURO-PC",
    "destEngine": "FAIRCOM2@MAURO-PC",
    "subscriptions": [
      {
      "name": "subFiles",
      "bidirectional": false,
      "publication": {
          "name": "pubFiles2",
          "create": true,
          "mode": "files",
          "items": [
            "E:\\sw\\eu_ldf\\dbf\\ML\\*.*dat"
          ]
        }
      }
      ]
    }
  }
 
 

"deploy" example

{
  "memphis": {
     "name": "MEMPHIS",
     "host": "localhost",
     "port": "7597",
     "uid": "admin",
    "pwd": "ADMIN"
  },
  "options": {
    "profile": true,
    "replace": true,
    "ignoredeploy": false,
    "recursivedel": false,
    "recursivesearch": true
  },
  "plan": {
    "actions": [
      "deploy"
    ],
    "name": "planFiles"
    }
  }
 
 

"deploy" with the create of a plan and publication example

{
  "memphis": {
     "name": "MEMPHIS",
     "host": "localhost",
     "port": "7597",
     "uid": "admin",
    "pwd": "ADMIN"
  },
  "options": {
    "profile": true,
    "replace": true,
    "ignoredeploy": false,
    "recursivedel": false,
    "recursivesearch": true
  },
  "plan": {
    "actions": [
      "create",
      "deploy"
    ],
    "name": "planFiles",
    "sourceEngine": "FAIRCOMS@HOST001",
    "destEngine": "FAIRCOM2@HOST002",
    "subscriptions": [
      {
        "name": "subFiles",
        "bidirectional": false,
        "redir": [
        {
          "source": "Z:\\db",
          "target": "D:\\backup\\repldata\\"
        }
        ],
        "publication": {
          "name": "pubPW",
          "create": true,
          "mode": "folder",
          "item": "Z:\\db\\pw",
          "wildcards": ["*dat"],
          "recursive": true
        }
      }
      ]
    }
  }
 
 

"start" example

{
  "memphis": {
     "name": "MEMPHIS",
     "host": "localhost",
     "port": "7597",
     "uid": "admin",
    "pwd": "ADMIN"
  },
  "options": {
    "profile": true,
    "replace": true,
    "ignoredeploy": false,
    "recursivedel": false,
    "recursivesearch": true
  },
  "plan": {
    "actions": [
      "start"
    ],
    "name": "planFiles"
    }
  }
 
 

"start" with forced startup without deployment and with plan and publication creation

{
  {
  "memphis": {
     "name": "MEMPHIS",
     "host": "localhost",
     "port": "7597",
     "uid": "admin",
     "pwd": "ADMIN"
  },
  "options": {
    "profile": true,
    "replace": true,
    "ignoredeploy": true,
    "recursivedel": false,
    "recursivesearch": true
  },
  "plan": {
    "actions": [
      "create",
      "start"
    ],
    "name": "planFiles",
    "sourceEngine": "FAIRCOMS@HOST001",
    "destEngine": "FAIRCOM2@HOST002",
    "subscriptions": [
      {
        "name": "subFiles",
        "bidirectional": false,
        "redir": [
        {
          "source": "Z:\\db",
          "target": "D:\\backup\\repldata\\"
        }
        ],
        "publication": {
          "name": "pubPW",
          "create": true,
          "mode": "folder",
          "item": "Z:\\db\\pw",
          "wildcards": ["*dat"],
          "recursive": true
        }
      }
      ]
    }
  }
 
 

"stop" example

{
  "memphis": {
     "name": "MEMPHIS",
     "host": "localhost",
     "port": "7597",
     "uid": "admin",
     "pwd": "ADMIN"
  },
  "plan": {
    "actions": [
      "stop"
    ],
    "name": "planDatabase"
    }
  }
 
 

"delete" example

{
  "memphis": {
     "name": "MEMPHIS",
     "host": "localhost",
     "port": "7597",
     "uid": "admin",
    "pwd": "ADMIN"
  },
  "options": {
    "profile": true,
    "replace": true,
    "ignoredeploy": false,
    "recursivedel": false,
    "recursivesearch": true
  },
  "plan": {
    "actions": [
      "delete"
    ],
    "name": "planFiles"
    }
  }
 
 

"delete" with "stop" and "delete" action example

{
  "memphis": {
     "name": "MEMPHIS",
     "host": "localhost",
     "port": "7597",
     "uid": "admin",
     "pwd": "ADMIN"
  },
  "options": {
    "profile": true,
    "replace": true,
    "ignoredeploy": false,
    "recursivedel": true,
    "recursivesearch": true
  },
  "plan": {
    "actions": [
      "delete",
      "stop"
    ],
    "name": "planFolders"
    }
  }
 
 

"resync" publication example

{
  "memphis": {
     "name": "MEMPHIS",
     "host": "localhost",
     "port": "7597",
     "uid": "admin",
    "pwd": "ADMIN"
  },
  "plan": {
    "actions": [ "resync" ],
    "name": "plan1",
    "publication": "pub3"
  }
}
 
 

"resync" list of files example

{
  "memphis": {
    "name": "MEMPHIS",
    "uid": "admin",
    "pwd": "ADMIN"
  }
  "plan": {
    "actions": [ "resync" ],
    "name": "planFiles",
    "files": [
      "E:\\sw\\eu_ldf\\dbf\\ML\\abadata\\c\\custmast.dat",
      "E:\\sw\\eu_ldf\\dbf\\ML\\abadata\\c\\custordr.dat"
  ]
  }
}
 
 

"add_subscriptions" two new subscriptions example

{
  "memphis": {
    "name": "MEMPHIS",
    "uid": "admin",
    "pwd": "ADMIN",
    "port": "7597"
  },
  "options": {
    "profile": true,
    "replace": true,
    "ignoredeploy": false,
    "recursivedel": false,
    "recursivesearch": false
  },
  "plan":{
    "actions": [
      "add_subscriptions"
    ],
    "name":"planALPHA",
    "subscriptions":[
      {
        "name": "subD",
        "publication": {
          "create":false,
          "name":"pubFilesD"
        }
      },
      {
        "name": "subI",
        "publication":{
            "create":true,
            "name":"pubFilesI",
            "mode":"files",
            "items": [
                "E:\\sw\\eu_ldf\\dbf\\ML\\data\\i\\*.*dat"
              ]
        }
      }
    ]
  }
}
 
 

"delete_subscriptions" example

{
  "memphis": {
    "name": "MEMPHIS",
    "uid": "admin",
    "pwd": "ADMIN",
    "port": "7597"
  },
  "options": {
    "profile": true,
    "replace": true,
    "ignoredeploy": false,
    "recursivedel": false,
    "recursivesearch": false
  },
  "plan": {
    "actions": [
      "delete_subscriptions"
    ],
    "name": "planBETA",
    "subscriptions": [
      {
        "name": "subC",
        "publication": {
          "name": "pubFiles"
        }
      },
      {
        "name": "subD",
        "publication": {
          "name": "pubFilesD"
        }
      },
      {
        "name": "subI",
        "publication": {
          "name": "pubFilesI"
        }
      }
    ]
  }
}
 
 

"show" example

{
  "memphis": {
    "name": "MEMPHIS",
    "uid": "admin",
    "pwd": "ADMIN",
    "port": "7597"
  },
  "plan": {
    "actions": [
      "show"
    ],
    "name": "planData01"
  }
}
 
 
 
 

Create or modify a replication plan with subscriptions

The subscriptions element is used in the input JSON when creating or modifying a replication plan via replutil. It consists of an array of one or more subscription elements.

Properties summary

Table 2. subscriptions element property summary
Property Description Type
publication Specifies which publication is coupled with the specified subscription. If the publication already exists, only the publication name needs to be specified, with the create property set to false. If the publication needs to be created, all relevant publication properties must be specified.  publication element
name Specifies the name of a subscription.  string
bidirectional Determines whether or not the subscription is bidirectional. boolean
redir An array of redirection elements specifying the filesystem redirection that will be applied to the target server. See below for more details. array

The redir element

The redir element is an optional part of the subscription element. It is specified inside an array of subscriptions elements, as a single subscription may require multiple redirects to fulfill all the replication redirection needs for a replication plan. A single redir element is always composed of the source and target elements.

Properties summary
Table 3. redir element property summary
Property Description Type
source The path of the source server that needs to be replaced. Must match the source path of the host file system. string
target The path on the target server that will replace the specified source. string
 
 
 
 

“create”

The "create" action creates a new plan.

Note

The "create" action in "plan" always takes a list of subscriptions and each subscription is associated with an existing or new publication. The "create" action in the "publication" object defines new publications.

 

Properties summary

Table 4. "create" actions summary
Property Description Type
destEngine contains the logical name of the destination engine string
name specifies the name of the plan string
sourceEngine contains the logical name of the source engine that is publishing the publication string
subscriptions contains a list of subscriptions array
 
 

“deploy”

the "deploy" action starts the deployment of the specified plan.

Essential information

  • The "plan" can be an existing plan or it can be created and deployed.
  • If the plan or availability group already exists only "name" is required.
  • The "deploy" action implies the start of the replication plan after its successful deployment.
  • This action can be specified together with the "create" action
 
 
 
 

“start”

The "start" action starts a replication plan.

Essential information

  • The plan can be created within the same JSON or it can already exist.
  • The plan or group should be deployed to be started correctly, but the "ignoredeploy" main option can override this constraint.
  • You may want to start a plan without the deployment if the target files have already been copied manually.
  • The "start" operation is skipped if the deployment action is requested in the same file.
  • Typically, the "start" operation is used to start plans that have already been stopped.
 
 
 
 

“stop”

The "stop" action stops an existing replication plan,

Essential information

  • Only "name" is required.
  • A stopped plan or group may be restarted using the "start" action.
  • It can be run together with "delete".
 
 
 
 

“delete”

The "delete" action deletes an existing publication specified with the name parameter.

Essential information

  • Make use of the "recursivedel" option to delete all the dependencies.
  • The plan must be stopped in order to be deleted.
  • The "stop" action can be run together with "delete".
 
 
 
 

“add_subscriptions”

The "add_subscriptions" action creates an array of new subscriptions inside a specified existing replication plan.

Essential information

The associated publication's "name" must be specified to identify the subscription correctly.

Each subscription can be associated with an existing publication or with a new publication as specified in the "create" action of the "publication" object.

 
 
 
 

“delete_subscriptions”

The "delete_subscriptions" action deletes the specified subscriptions from the specified existing replication plan.

Essential information

  • The associated publication's "name" must also be specified to identify the subscription correctly.
  • This command will not remove any of the publications.