Import Message (Data Management)

Summary

Imports changes from a delta file into a replica geodatabase or imports an acknowledgment message into a replica geodatabase.

Usage

  • Use this tool when synchronizing a replica while disconnected. First run the Export Data Change Message tool, which creates a delta file with changes to synchronize. Then copy and import the delta file to the relative replica using the Import Message tool. If the delta file gets lost and you want to resend, use the Re-Export Unacknowledged Messages tool to regenerate the delta file. After the changes are imported, you can export an acknowledgment file from the relative replica using the Export Acknowledgement Message tool. Copy and import the acknowledgment file using the Import Message tool. If the acknowledgment is not received, the next time changes are sent, they will include the new changes and the previously sent changes.

  • The geodatabase can be a local geodatabase or a geodata service.

  • The tool accepts acknowledgment messages or data change messages. Acknowledgment files are .xml files. Data change messages can be delta file geodatabase (.gdb) or delta .xml files.

  • After importing a data change message, you can immediately export an acknowledgment message. The output acknowledgment file must be an .xml file.

  • To synchronize replicas in a connected mode, see the Synchronize Changes tool.

Parameters

LabelExplanationData Type
Import To Replica Geodatabase

The replica geodatabase that will receive the imported message. The geodatabase can be local or remote.

Workspace; GeoDataServer
Import from Delta file

The file from which the message will be imported.

Workspace ; File
Output Acknowledgement File
(Optional)

The file that will contain the acknowledgement message. When importing data changes, you can also export a message to acknowledge the import of a data change message. This parameter is only supported for a data change message.

File
Conflict Resolution Policy
(Optional)

Specifies how conflicts will be resolved when they are encountered while importing a data change message.

  • Manually resolve conflictsConflicts must be manually resolved in the versioning reconcile environment.
  • In favor of the databaseConflicts will be automatically resolved in favor of the database receiving the changes.
  • In favor of imported changesConflicts will be automatically resolved in favor of the imported changes.
String
Conflict Definition
(Optional)

Specifies whether the conditions required for a conflict to occur will be detected by object (row) or by attribute (column).

  • By objectConflicts will be detected by row.
  • By attributeConflicts will be detected by column.
String
Reconcile with the Parent Version (Check-out replicas)
(Optional)

Specifies whether data changes will be automatically reconciled once they are sent to the parent replica if no conflicts are present. This parameter is only active for check-out/check-in replicas.

  • Unchecked—Changes will not be reconciled with the parent version. This is the default.
  • Checked—Changes will be reconciled with the parent version.
Boolean

Derived Output

LabelExplanationData Type
Output Replica Geodatabase

The updated replica geodatabase.

Workspace; GeoDataServer

arcpy.management.ImportMessage(in_geodatabase, source_delta_file, {output_acknowledgement_file}, {conflict_policy}, {conflict_definition}, {reconcile_with_parent_version})
NameExplanationData Type
in_geodatabase

The replica geodatabase that will receive the imported message. The geodatabase can be local or remote.

Workspace; GeoDataServer
source_delta_file

The file from which the message will be imported.

Workspace ; File
output_acknowledgement_file
(Optional)

The file that will contain the acknowledgement message. When importing data changes, you can also export a message to acknowledge the import of a data change message. This parameter is only supported for a data change message.

File
conflict_policy
(Optional)

Specifies how conflicts will be resolved when they are encountered while importing a data change message.

  • MANUALConflicts must be manually resolved in the versioning reconcile environment.
  • IN_FAVOR_OF_DATABASEConflicts will be automatically resolved in favor of the database receiving the changes.
  • IN_FAVOR_OF_IMPORTED_CHANGESConflicts will be automatically resolved in favor of the imported changes.
String
conflict_definition
(Optional)

Specifies whether the conditions required for a conflict to occur will be detected by object (row) or by attribute (column).

  • BY_OBJECTConflicts will be detected by row.
  • BY_ATTRIBUTEConflicts will be detected by column.
String
reconcile_with_parent_version
(Optional)

Specifies whether data changes will be automatically reconciled once they are sent to the parent replica if no conflicts are present. This parameter is only enabled for check-out/check-in replicas.

  • DO_NOT_RECONCILEChanges will not be reconciled with the parent version. This is the default.
  • RECONCILEChanges will be reconciled with the parent version.
Boolean

Derived Output

NameExplanationData Type
out_geodatabase

The updated replica geodatabase.

Workspace; GeoDataServer

Code sample

ImportMessage example (Python window)

The following example demonstrates how to use the ImportMessage function in a Python window.

import arcpy
arcpy.env.workspace = "C:/Data"
arcpy.ImportMessage_management("MySDEdata.sde", "DataChanges.gdb", 
                               "acknowledgement.xml", 
                               "IN_FAVOR_OF_IMPORTED_CHANGES", "BY_OBJECT")
ImportMessage example 2 (stand-alone script)

The following demonstrates how to use the ImportMessage function to import a data change file in a stand-alone Python script.

# Name: ImportMessage_Example2.py
# Description: Import a data change message (from a delta gdb) into a replica workspace.   

# Import system modules
import arcpy

# Set workspace
arcpy.env.workspace = "C:/Data"

# Set local variables
replica_workspace = "MySDEdata.sde"
in_message = "DataChanges.gdb" # data changes file (delta gdb)
output_acknowledgement = "acknowledgement.xml" # optional
conflict_policy = "IN_FAVOR_OF_IMPORTED_CHANGES"
conflict_detection = "BY_OBJECT"
reconcile = "" # Only applicable for checkout replicas

# Execute Import Message
arcpy.ImportMessage_management(replica_workspace, in_message, 
                               output_acknowledgement, conflict_policy, 
                               conflict_detection, reconcile)
ImportMessage example 3 (stand-alone script)

The following demonstrates how to use the ImportMessage function to import a data change file in a stand-alone Python script.

# Name: ImportMessage_Example3.py
# Description: Import an acknowledgement message into a replica workspace.  

# Import system modules
import arcpy

# Set workspace
arcpy.env.workspace = "C:/Data"

# Set local variables
replica_workspace = "MySDEdata.sde"
in_message = "acknowledgement.xml" # Acknowledgement file 
output_acknowledgement = "" 	# not applicable when importing an acknowledgement file
conflict_policy = ""        	# not applicable when importing an acknowledgement file 
conflict_detection = ""     	# not applicable when importing an acknowledgement file
reconcile = ""              	# not applicable when importing an acknowledgement file

# Execute Import Message
arcpy.ImportMessage_management(replica_workspace, dc_Message, 
                               output_acknowledgement, conflict_policy, 
                               conflict_detection, reconcile)

Related topics