Skip to main content

Using DataMove with InterSystems IRIS

This document describes how to use the DataMove process to move existing data associated with an InterSystems IRIS® data platform namespace to a new location.

Important:

InterSystems highly recommends that you test DataMove with your specific namespaces and databases in a test environment before using it on a live system.

Note:

Some single lines of code in this document wrap across lines, due to the page and font sizes.

Introduction to DataMove

The DataMove process allows you to move existing data associated with an InterSystems IRIS namespace to a different database, by:

  • Creating new mappings for the namespace.

  • Analyzing the mapping changes to calculate which globals and global subscripts need to be moved.

  • Copying the data to the new database or databases.

  • Activating the mapping changes.

For example, DataMove allows you to move a global, or portion of a global, from a namespace’s default globals database to a different database. You can use the process to move a namespace’s globals to a separate database from its routines, to split data across multiple databases, or otherwise move data to new locations based upon updated design decisions over the evolution of an application.

For more information on mappings, see “Add Global, Routine, and Package Mapping to a Namespace” in the System Administration Guide.

See Deprecated Calls and States below for APIs that have been deprecated and their replacements

DataMove Limitations

The DataMove process is subject to the following limitations:

  • DataMove operates on the mappings in a single namespace at a time.

  • DataMove is designed to move data between databases on the same instance. Extra operational care is required for connected systems, such as those in mirrors and distributed cache (ECP-based) clusters.

  • The last step of the DataMove process activates the new mappings.

  • DataMove should not be used on applications that use extended global references. Data integrity cannot be ensured if the application mixes the use of mappings and extended references.

For more information on extended global references, see “Namespaces” in Using ObjectScript.

The DataMove Workflow

The DataMove workflow comprises the following phases:

  1. Changes to the namespace mappings are saved in a temporary storage area.

  2. A set of data moves is generated from the mappings.

  3. The data moves are validated against the specified globals and databases, and sufficient free disk space in the destination databases is confirmed. If any issues are found, the user can correct them and resume the workflow.

  4. A background job copies the existing data to the new location and updates a State property as the copy progresses.

  5. When the data has been copied, the new mappings are activated in the namespace.

  6. After the namespace changes have been successfully activated, you can delete the old source data that has been copied to the new locations.

DataMove maintains a log file DataMoveName.log of all operations in the /mgr directory.

DataMove in a Mirror or ECP Environment

When using DataMove in an ECP or mirror environment, you must make sure that the new namespace mappings are updated on the ECP clients and mirrors. Note that if you are in a mirror environment and are going to move data into newly created databases, you must also create these databases on the backup and Async mirrors.

  1. Create your DataMove and run it until it is ready to activate the new mappings.

  2. If you have a failover mirror, you must demote the backup to a DR Mirror before you activate.

  3. If you have ECP clients, you must stop the application on the clients, or bring the ECP systems down.

  4. If you are using Async mirrors, you must stop any applications accessing the data there, or any ECP clients connected directly to them.

  5. At this point you can activate the new DataMove mappings.

  6. Update the mappings on the Async mirrors to match the new DataMove mappings you just applied, including the former failover mirror.

  7. Promote the former backup mirror from a DR Mirror back to a failover member.

  8. Update any ECP clients with the new DataMove mappings you just applied.

  9. Allow applications to restart on the Async mirrors and ECP clients.

The DataMove APIs

This section details the API calls required for each phase of the DataMove workflow.

Make note of the following guidelines:

  • You must provide any needed scripting or user interface, according to your specific requirements.

  • To make use of the needed macros, your code should include the %syDataMove file.

  • Your code should check the status returned by each method before proceeding to the next API call.

  • If any destination databases do not exist, they will be created by the DataMove workflow.

  • The workflow must be executed in the %SYS namespace.

Important:

InterSystems recommends that you have a current full backup of your system before running DataMove.

Create and Edit DataMove Namespace Mappings

DataMove.API.MapInitialize(Namespace As %String) As %Status

Initializes the temporary storage area for a new set of mapping edits.

Argument:

  • Namespace is the namespace on which you want to perform the DataMove.

This method must be called before any edits are made, and is only valid for the specified namespace.

Caution:

Calling this method deletes any existing edits in the temporary storage area, which is used for all mapping changes in all namespaces, including those made by the DataMove API and those made using the Global Mappings page of the Management Portal. (See Global Mappings in the “Configuring InterSystems IRIS” chapter of the System Administration Guide.) To prevent concurrent mapping changes from causing failures, you must ensure that there are no mapping changes for any namespace in progress when you call MapInitialize(), and that no other mapping changes are initiated until the DataMove process is complete.

Example:

Set Namespace = "SALES"
Set Status = ##Class(DataMove.API).MapInitialize(Namespace)
If '$$$ISOK(Status) Write !,$SYSTEM.Status.GetErrorText(Status)

DataMove.API.MapGlobalsCreate(Namespace As %String, Name As %String, ByRef Properties As %String) As %Status

Creates a new global mapping for this namespace in the temporary storage area. You can call this method one or more times, depending on the number of mappings you plan to include in this DataMove.

Arguments:

  • Namespace is the namespace on which you want to perform the DataMove.

  • Name is the name of a global to be mapped to a specific database.

  • Properties is an array of properties needed for this mapping, in particular, the name of the database used for this mapping.

Setting the Name argument to “A” specifies that this mapping affects the entire global ^A. Setting this argument to “A(5):A(10)” specifies that this mapping affects the range of the global with subscripts ^A(5) up to, but not including, ^A(10).

Setting the Properties argument to an array Properties where Properties("Database") is set to “USER2” specifies that the global (or range of a global) is to be mapped to the database USER2.

The MapGlobalsModify() and API.MapGlobalsDelete() methods can be used to modify or delete mappings. See the Class Reference for more information.

Examples:

Set Properties("Database")="DSTDB"

;Move ^X(100) up to but not including ^X(200) to database DSTDB
Set Status = ##Class(DataMove.API).MapGlobalsCreate("SALES","X(100):(200)",.Properties)

;Move the entire ^INFO global to database DSTDB
Set Status = ##Class(DataMove.API).MapGlobalsCreate("SALES","INFO",.Properties)

;Move all Data from the first subscript in ^BILLING 
;(including the node ^BILLING itself) up to but not including ^BILLING(100) 
;to database DSTDB
Set Status = ##Class(DataMove.API).MapGlobalsCreate ("SALES","BILLING(BEGIN):(100)",.Properties)

;Move the entire global ^PROSPECT 
;from its currently mapped database to DSTDB
Set Status = ##Class(DataMove.API).MapGlobalsModify ("SALES","PROSPECT",.Properties)

;Move the entire global ^ORDERS from its currently mapped database 
;back to the default database for the namespace SALES
Set Status=##Class(DataMove.API).MapGlobalsDelete ("SALES","ORDERS")

For more information on defining global ranges, see Global Mappings in the System Administration Guide.

Generate the DataMove

DataMove.API.Generate(Name As %String, ByRef Properties As %String, ByRef Warnings As %String, ByRef Errors As %String) As Status

Creates a new DataMove based on map edits in the temporary storage area.

Arguments:

  • Name is the name of the DataMove to be created.

  • Properties is an array of optional properties to be used to create the DataMove.

  • Warnings is an array returned with conflicts that do not prevent the DataMove from being performed.

  • Errors is an array returned with conflicts that do prevent the DataMove from being performed.

Properties is an array passed in as the Properties argument:

  • Properties("MaxMBPerMin") optionally specifies the maximum number of MB per minute the DataMove Operation is allowed to move to the destination database. Setting this to 0 allows the DataMove to run as fast as it can. If not passed, it uses the system default.

  • Properties("Description") optionally provides a description of the DataMove to be performed.

  • Properties("Flags") optionally provides any flags describing the DataMove operation, such as:

    • $$$BitNoSrcJournal, allow copying of non-journaled databases.

    • $$$BitNoBatchMode, run data copy without batch mode.

    • $$$BitCheckActivate, call the user-supplied routine $$CheckActivate^ZDATAMOVE() to check the application status before activating the mapping changes.

  • Properties("LogFile") optionally specifies a log file name, if other than the default.

The Warnings array contains a list of mappings where the data being moved is also mapped from another namespace. This array is subscripted by the name of the global or the global range.

The Errors array contains a list of mappings where a conflict prevents the data from being moved. This array is subscripted by the name of the global or the global range.

Example:

Set Properties("Flags")= $$$BitCheckActivate
Set Status=##Class(DataMove.API).MapGlobalsGenerate("TEST" .Properties,.Warnings,. Errors)

For more information on database journaling, see “Journaling” in the Data Integrity Guide.

For more information on running a process in batch mode, see “Process Management” in Specialized System Tools and Utilities.

Start the DataMove

DataMove.API.StartCopy(Name As %String) As %Status

Starts the DataMove copy, which handles the actual moving of data.

Argument:

  • Name is the name of the DataMove.

This method starts the initial DataMove copy as a set of background jobs which copy the individual ranges from the source databases to the destination databases, while at the same time apply journal transactions to the destination databases for data which changes as it is being copied.

Before the copy actually starts, StartCopy() calls Validate() and ValidateSizes() to validate the DataMove. If the validation returns an error, the StartCopy() will return the validation error and will not start the DataMove. The user can then correct the error, and call StartCopy() again.

Monitor the DataMove

DataMove.API.GetProperties(Name As %String, ByRef Properties as %String) As %Status

Returns the current properties of the DataMove.

Arguments:

  • Name is the name of the DataMove.

    • Properties("ExpandedState") – Expanded external format of the state.

    • Properties("JRNMBToApply") – Current # of MB of Journal file to process=0

    • Properties("MaxMBPerMin") – Maximum # of MB per minute the DataMove is allowed to move

    • Properties("MBCopied") - Amount of MB copied

    • Properties("MBToCopy") - Approximate amount of MB to copy

    • Properties("State") - Current state of the move, see the table below

    • Properties("StateExternal") – Exernal format of the State

    • Properties("Status") - %Status value of any errors which occur

    • Properties("Stop") – Stop state of the DataMove

      • $$$DMStopNone – Stop not signaled.

      • $$$DMStopNormal – Stop signaled by Activate().

      • $$$DMStopShutdown – Stop signaled by normal system shutdown. Data Move will resume on system restart.

      • $$$DMStopUser – Stop signaled by user StopCopy(). Copy can be restarted by StartCopy().

      • $$$DMStopForce – Stop signaled by Force(). Copy can be restarted by StartCopy().

      • $$$DMStopErrorRecoverable – Stop signaled by error. Copy can be restarted by StartCopy() Once the error is corrected.

      • $$$DMStopErrorUnRecoverable – Stop signaled by unrecoverable error. This may be due to several different reasons including journal errors. The only option here is to call Rollback() and then StartCopy() to restart the DataMove, or Delete() to delete the DataMove.

Example:

%SYS>Set x=##Class(DataMove.API).GetProperties("ABC1",.Properties)

%SYS>Zwrite Properties
Properties("JRNMBToApply")=0
Properties("MaxMBPerMin")=1200
Properties("MBCopied")=17030.6796875
Properties("MBToCopy")=20034.4453125
Properties("State")=6
Properties("StateExternal")="Copy"
Properties("Status")=1
Properties("Stop")=0

^DATAMOVE Utility

The ^DATAMOVE utility displays the current state of all DataMoves defined on the system and allows users to set DataMove default parameters.

Setting DataMove Default Parameters

DataMove default system parameters allow the user to specify what happens when the system restarts, and can also limit the amount of data which can be moved per minute. By default, a running DataMove will copy data as fast as it can. However, this can affect other user processes on the system, as well as affect the latency of a mirrored system.

%SYS>d ^DATAMOVE
1) Monitor DataMove
2) Edit DataMove settings
3) Exit
Option? 2

Restart DataMove after normal system shutdown? Yes => Yes
Restart DataMove after system crash? Yes => Yes

Setting the maximum number of MB DataMove is allowed to copy per minute to 0 means that Data Move will copy the data as fast as it can. Changing this setting will apply the new value to future DataMoves, and optionally any currently running DataMoves. You can also change this setting through the 'Metrics' display screen for a running DataMove without changing the system default.
Maximum number of MB to copy per minute? 0 => 1200
Do you want to apply this change to existing Data Moves? Yes => Yes
Confirm changes? Yes => Yes
Data Move settings updated

1) Monitor DataMove
2) Edit DataMove settings
3) Exit

Monitoring DataMove

Once you have called the Generate() method, you can use ^DATAMOVE to examine the state of the move, and which ranges are set to move.

%SYS>d ^DATAMOVE
1) Monitor DataMove
2) Edit DataMove settings
3) Exit
Option? 1

This is an example of what is displayed after Generate() and Start() have been called. It shows the accumulated statistics for all the ranges in the DataMove.

The utility show numerous fields that hold aggregated information about the DataMove.

These fields show the following information:

  • Jrn Cycle Time – Amount of time it took for the journal scanner/apply to reach the end of the current journal file for the last time it reached the end of the journal.

  • First Jrn Time – Amount of time it took for the journal scanner/apply to reach the end of the current journal file for the first time.

  • CopyTime – Amount of time it took to copy the global.

  • Size Time– Amount of time it took for the global size calculation.

  • Done – Amount of each operation found in the journal file that it applied to the destination database.

  • Avoid – Amount of each operation found in the journal file which could be skipped. Operations can be skipped if the Copy has not yet started, or the operation occurs in a piece of the global which has not yet been copied to the destination.

  • Copy – Amount of each operation which were applied to the destination database while the Copy was running.

  • Journal Start – Journal file and offset where the DataMove started.

  • Journal Current – Current journal file and offset.

  • Max MB/Min – Maximum MB per minute the DataMove is allowed to copy. This is set for the DataMove in one of three ways:

    • DataMove default from ^DATAMOVE.

    • The Metrics screen shown below.

    • The Modify() API.

  • MB/Min – MB per minute the DataMove has copied over the lifetime of the DataMove.

  • Blks Copied – Actual number of database blocks copied and the % which were prefetched

  • JRN Count/Size – Number of transactions and total size for this DataMove which were found in the current journal file and the previous journal file before the StartCopy() method was called.

  • Pid Move/Jrn – Process ID of the two processes handling the copy and dejournal.

  • Pid Copy – Process ID of the Master DataMove process.

When you select the range option, you can see that there are 5 ranges of globals which are being moved.

The utility shows which globals each range covers, as well as the current status for the range.

You can examine the detail of each of the ranges in the Range Detail screen. These are described above, but apply only to the selected range.

The utility show the same information as the aggregated screen, but for a single range.

The Jobs display show which jobs are operating on which pieces of data.

For each job, this display shows the Type, Job#, Commands, Globals, State, PID, and Range.

Here you can see that job 84 is currently copying the data in Range X(40000000), job 73 is scanning the journal for the same range and applying transactions it finds in this range. The "Master Move" job 71 controls all processes which are still copying data. The "Master Journal" job 72 controls all the processes which are scanning or applying journals. And the "Master Copy" job accumulates statistics and determines when the Activate() method can be called. The job number, Commands, Globals, State, and PID here correspond to the same information found in JOBEXAM or the Management Portal process display.

The Metrics display shows the activity on the system, and how much of it is related to the running DataMove.

In this example, DataMove activity is 98% of all global references per second on the system.

In this example we can see the DataMove is running with the Max allowed MB Copied/Min set to 0 (Unlimited). We also see that it is taking up the majority of global references and journal entries, as well as causing the mirror latency to increase.

We can restrict the DataMove to a slower rate as follows:

Press C to change rate. This example sets the Max allowed MB Copied/Minute to 1200.

And now we see the new rate and much lower metrics.

In this example, DataMove activity is 98% of all global references per second on the system.

Activate Mapping Changes and Finish the DataMove

DataMove.API.Activate(Name As %String, Display as %Boolean, Timeout As %Integer = 120) As %Status

Finishes the DataMove and activates the namespace mapping changes.

Arguments:

  • Name is the name of the DataMove.

  • Display should be set to 1 if you want to see progress messages.

  • Timeout is number of seconds to wait for the Copy job to finish running an apply journals operation before proceeding.

This method stops the DataMove background job, finishes processing any journal files, writes the mapping changes to the CPF, and activates the mapping changes. It momentarily sets switch 10 to prevent other processes from interfering with the execution.

If $$$BitCheckActivate is set, the method will call a user-supplied routine to check the application status before continuing. If $$CheckActivate^ZDATAMOVE() does not return 1, the method will quit.

For more information on switch 10, see “Using Switches” in Specialized System Tools and Utilities.

Note:

Activate() checks the State property of the DataMove to make sure that the initial copy is complete and the journal apply is caught up before proceeding.

Delete Source Globals and Clean Finish DataMove

After the copy has completed and the updated namespaces activated, you should verify that that your application data has been successfully copied and the mappings activated. Once you have done this, you can proceed with deleting the source globals which have been moved, and finish the DataMove.

DataMove.API.DeleteSourceGlobals(Name As %String) As %Status

Deletes the globals from the source directory that have been copied in the DataMove.

Argument:

  • Name is the name of the DataMove.

This method deletes all globals in the source database that have been copied to the destination database. Several processes may be created to delete the source globals.

DataMove.API.Finish(Name As %String) As %Status

Completes the DataMove process.

Argument:

  • Name is the name of the DataMove.

This method writes a success or failure message to the log file, closes the log file, and sets the State property of the DataMove to $$$DMStateDone. It also copies the log file into the file DataMove.log, which is a record of all the DataMoves performed on the system.

DataMove.API.Delete(Name As %String) As %Status

Cleans up the DataMove process.

Argument:

  • Name is the name of the DataMove.

This method deletes the DataMove and cleans up any temporary storage.

If the DataMove operation you want to delete has been started and then stopped, you should first call the Rollback() method to rollback any of the data which had been moved.

Other API Calls

DataMove.API.Validate(Name As %String) As %Status

Validates the DataMove.

Argument:

  • Name is the name of the DataMove.

Validating the DataMove involves looking at all of the specified mappings, checking the source and destination databases, and making sure the destination globals do not already exist. Any errors are reported in the status.

Validate() is called as part of StartCopy(). You can use this method to validate the DataMove before you actually start the copy with StartCopy()

DataMove.API.Modify(Name as %String,byref Properties as %String) as %Status

Modifies an existing or running DataMove.

Arguments:

  • Name is the name of the DataMove.

  • Properties is an array of properties to modify, which may include:

    • Properties("MaxMBPerMin") - Maximum number of MB per minute the DataMove operation is allowed to move to the destination database. Setting this to 0 allows the DataMove to run as fast as it can. This can be called on a running DataMove to change the rate.

DataMove.API.ValidateSizes(Name As %String) As %Status

Makes sure sufficient space exists for the data specified by the DataMove to be copied.

Argument:

  • Name is the name of the DataMove .

Validating sizes for a DataMove involves determining the amount of data to be copied and ensuring enough space exists in the destination database. Any errors are reported in the status.

ValidateSizes() is called as part of StartCopy(). You can use this method to validate the DataMove size requirements before you actually start the copy with StartCopy()

DataMove.API.StopCopy(Name As %String) As %Status

Stops the DataMove copy job.

Argument:

  • Name is the name of the DataMove.

This method stops the DataMove copy background jobs, allowing you to gracefully stop the copy after it is in process. You can restart the DataMove with DataMove.Data.StartCopy().

DataMove.API.Rollback(Name As %String) As %Status

Rolls back the DataMove.

Argument:

  • Name is the name of the DataMove.

This method deletes any globals that have been copied to destination databases by the DataMove copy job. This method can be used to abort the DataMove or recover from an error in the copy process.

StopCopy() must be run before calling this method.

After doing the rollback, you can start over with StartCopy() or delete the DataMove with Delete().

DataMove.API.RollbackMappings(Name As %String)

Rolls back the DataMove mappings.

Argument:

  • Name is the name of the DataMove.

This will restore the systems mappings to the state before the DataMove “Name” was run. The DataMove “Name” must be in the State $$$DMStateNSPActivateDone. An example of using this would be if you started to test the application after the DataMove activates its mappings, and detected there was something wrong. After the mappings are restored to their previous value, the State will be set to $$$DMStateJrnApplyDone. From here you can call Rollback() (recommended), or StartCopy() and retry the activation.

DataMove.API.RollbackCopy(Name As %String, Warnings as %String, Errors as %String)

Rolls back a copy of the DataMove.

Arguments:

  • Name is the name of the DataMove.

  • Warnings is an array returned with conflicts that do not prevent the DataMove from being performed.

  • Errors is an array returned with conflicts that do prevent the DataMove from being performed.

This will create a DataMove called Name-ROLLBACK which when run will move the data copied in the DataMove “Name” back to its original source directories. The DataMove “Name” must be in the State $$$DMStateDeleteSrcGlobalsDone (all the source globals have been deleted by the DeleteSourceGlobals() method. After the method finishes, you can then run StartCopy() and Activate() to move the data back to their original directories. The DataMove “Name” will have its State set to $$$DMStateRollbackCopy.

Query DataMove.API.ListDMs (Names As %String, Flags as %Integer=0) As %Status

Query which returns a list of all DataMoves and their properties.

Arguments:

  • Names is a commas separated list of DataMoves.

  • Flags –

    • 0 = Return current information in the DataMove record

    • 1 = Return information summed across all the ranges

Query DataMove.API.ListRanges (Name As %String, SrcDBs As %String = "*", DstDBs As %String = "*", Ranges As %String = "*", Flags = 0) As %Status

Query which returns a list of all the DataMove ranges and their properties.

Arguments:

  • Names is the name of the DataMove.

  • SrcDBs – comma separated list of source databases

  • DstDBs – Comma separated list of destination databases

  • Ranges – Comma separated list of ranges

  • Flags –

    • 0 = Return formatted times

    • 1 = Return times as $h UTC times

Query DataMove.API.ListProcesses (Name As %String) As %Status

Query which returns a list of all the DataMove processes.

Argument:

  • Name is the name of the DataMove.

DataMove States

The DataMove keeps track of its progress through the workflow by means of the State property. You can inspect this property to monitor its progress using GetProperties(), or to troubleshoot any issues that arise, using the query ListDMs().

The integer values for the each state are defined in the %syDataMove.inc include file.

List of DataMove States
State
$$$DMStateDone
$$$DMStateNotStarted
$$$DMStateStarted
$$$DMStateSize
$$$DMStateSizeDone
$$$DMStateCopy
$$$DMStateCopyDone
$$$DMStateJrnApply
$$$DMStateJrnApplyDone
$$$DMStateNSPActivate
$$$DMStateNSPActivateDone
$$$DMStateDeleteSrcGlobals
$$$DMStateDeleteSrcGlobalsDone
$$$DMStateRollback
$$$DMStateRollbackCopy

DataMove Example

This ObjectScript class moves global range ^A(5) up to ^A(10) in namespace USER to database USER2 and the remainder of the ^A global to database USER1, using a DataMove named ABC1.

For demonstration purposes, this example does not include comprehensive error checking. Check the returned status after each API call.

#Include %syDataMove 
Set Datamove="ABC1"
// Namespace that contains ^A global
Set Namespace="USER"
// Initialize temporary storage area to hold mapping edits 
Set Status = ##class(DataMove.API).MapInitialize(Namespace)

// Create mapping for global ^A to database TEST1 in temporary storage area kill Properties
Set Properties("Database") = "TEST1"
Set Status = ##class(DataMove.API).MapGlobalsCreate(Namespace, "A", .Properties)
 If $$$ISERR(Status) Quit 
// should check Status after every API call

// Create mapping for global range ^A(5) up to ^A(10) to database TEST2 in // temporary storage area 
Set Properties("Database") = "TEST2"
Set Status = ##class(DataMove.API).MapGlobalsCreate(Namespace, "A(5):(10)", .Properties)

// Create new DataMove, based on map edits in the temporary storage area kill Properties, Warnings, Errors
Set Properties("Flags")=$$$BitCheckActivate 
Set Status = ##class(DataMove.API).Generate(Datamove,.Properties, .Warnings, .Errors) 
If $data(Warnings) Write  ! Zwrite  Warnings
If $data(Errors) Write  ! Zwrite  Errors

// Once Generate() has been called, you can use the ^DATAMOVE utility 
// from a terminal to Monitor the DataMove Operation.
// You can choose to validate the DataMove here if you want, or let
// StartCopy() handle it 
;Set Status = ##class(DataMove.API).Validate(Datamove)
// You can choose to validate the DataMove sizes here if you want, 
// or let StartCopy() handle it 
;Set Status = ##class(DataMove.API).ValidateSizes")

// Start the DataMove Background copy job
Set Status = ##class(DataMove.API).StartCopy(Datamove)

// Monitor the DataMove until we can activate it
F  {
  hang 5
  Set Status = ##Class(DataMove.API).GetProperties(DataMove,.Properties)
// Activate will only run if we have 5 MB or less of journal to apply
  If (Properties("State")=$$$DMStateJrnApply){
     If (Properties("JRNMBToApply")<=5){
        Quit
     } Else {
          Write !,"Journal MB still to apply: "_Properties("JRNMBToApply")
          Continue
     }
  } Else {
     Write !,"MB still to copy: "_Properties("MBToCopy")
     Write !,"MB copied: "_Properties("MBCopied")
     Write !,"Journal MB still to apply: "_Properties("JRNMBToCopy")
  }
}
Set Display=1
Set Status=##Class(DataMove.API).Activate(DataMove,Display)

// Delete the source globals that have been copied in the DataMove
Set Status = ##class(DataMove.API).DeleteSourceGlobals(Datamove)
Set Status = ##class(DataMove.API).Finish(Datamove)
// Delete the DataMove and clean up any temporary storage 
Set Status = ##class(DataMove.API).Delete(Datamove)
Copy code to clipboard

Deprecated Calls and States

There have been changes to both calls and states. The following two tables list the old, deprecated calls or states and their associated replacements.

List of Deprecated and New DataMove Calls
Old Name New Name
Config.Map.InitializeEdits DataMove.API.MapInitialize
Config.MapGlobals.Create DataMove.API.MapGlobalsCreate
Config.MapGlobals.Delete DataMove.API.MapGlobalsDelete
Config.MapGlobals.Modify DataMove.API.MapGlobalsModify
Config.Map.Revert(0) DataMove.API.RollbackCopy
Config.Map.Revert(1) DataMove.API.RollbackMappings
DataMove.Data.Activate DataMove.API.Activate
DataMove.Data.CreateFromMapEdits DataMove.API.Generate
DataMove.Data.Dispatch(Name, "Delete") DataMove.API.Delete
DataMove.Data.Dispatch(Name, "DeleteSrcGlobals") DataMove.API.DeleteSourceGlobals
DataMove.Data.Dispatch(Name, "Finish") DataMove.API.Finish
DataMove.Data.Dispatch(Name, "Rollback") DataMove.API.RollBack
DataMove.Data.Dispatch(Name, "Validate") DataMove.API.Validate
DataMove.Data.Dispatch(Name, "ValidateSizes") DataMove.API.ValidateSizes
DataMove.Data.DispatchJob(Name, "Copy") DataMove.API.StartCopy
DataMove.Data.Display() ^DATAMOVE
DataMove.Data.Exists No replacement
DataMove.Data.StopCopy DataMove.API.StopCopy
List of Deprecated and New DataMove States
Old State New State
$$$Copy $$$DMStateCopy
$$$CopyDone $$$DMStateCopyDone
$$$CPFUpdate No corresponding state
$$$CPFUpdateDone No corresponding state
$$$Delete $$$DMStateDeleteSrcGlobals
$$$Done $$$DMStateDone
$$$JrnApply $$$DMStateJrnApply
$$$JrnApplyDone $$$DMStateJrnApplyDone
$$$NotStarted $$$DMStateNotStarted
$$$NSPActivate $$$DMStateNSPActivate
$$$NSPActivateDone $$$DMStateNSPActivateDone
$$$Size $$$DMStateSize
$$$SizeDone $$$DMStateSizeDone
$$$Started $$$DMStateStarted
No corresponding state $$$DMStateRollback
No corresponding state $$$DMStateRollbackCopy
FeedbackOpens in a new window