ArcGIS for Desktop

  • Documentation
  • Pricing
  • Support

  • My Profile
  • Help
  • Sign Out
ArcGIS for Desktop

ArcGIS Online

The mapping platform for your organization

ArcGIS for Desktop

A complete professional GIS

ArcGIS for Server

GIS in your enterprise

ArcGIS for Developers

Tools to build location-aware apps

ArcGIS Solutions

Free template maps and apps for your industry

ArcGIS Marketplace

Get apps and data for your organization

  • Documentation
  • Pricing
  • Support
Esri
  • Sign In
user
  • My Profile
  • Sign Out

Help

  • Home
  • Get Started
  • Map
  • Analyze
  • Manage Data
  • Tools
  • More...

ListReplicas

  • Summary
  • Discussion
  • Syntax
  • Code Sample

Summary

Lists the replicas in the workspace.

Discussion

You can specify the path to a connection file as an argument to the function or you can set the workspace environment to the connection file and call the ListReplicas function without any arguments.

Syntax

ListReplicas (workspace)
ParameterExplanationData Type
workspace

A geodatabase workspace.

String

Return Value

Data TypeExplanation
Replica

A list returned from the function containing Replica objects.

Code Sample

ListReplicas example 1

For every replica in a workspace that is a sender, call Export Data Change Message.

import arcpy
import os

sdeConnection = "Database Connections/toolboxDEFAULTVersion.sde"
outLocation = "c:/data"

for replica in arcpy.da.ListReplicas(sdeConnection):
    # If the replica is a sender, call ExportDataChangeMessage
    #
    if replica.isSender:
        changesFile = os.path.join(outputLocation,
                                   "changes_{0}.gdb".format(replica.name))
        arcpy.ExportDataChangeMessage_management(sdeConnection,
                                                 changes,
                                                 replica.name)
ListReplicas example 2

Print all replicas that are in conflict.

import arcpy

sdeConnection = "Database Connections/toolboxDEFAULTVersion.sde"

# Print the name of the replicas that are in conflict
#
for replica in arcpy.da.ListReplicas(sdeConnection):
    if replica.hasConflicts:
        print(replica.name)

Related Topics

  • Replica
  • An overview of the Distributed Geodatabase toolset
  • Understanding distributed data
  • A quick tour of replica management
Feedback on this topic?

ArcGIS for Desktop

  • Home
  • Documentation
  • Pricing
  • Support

ArcGIS Platform

  • ArcGIS Online
  • ArcGIS for Desktop
  • ArcGIS for Server
  • ArcGIS for Developers
  • ArcGIS Solutions
  • ArcGIS Marketplace

About Esri

  • About Us
  • Careers
  • Insiders Blog
  • User Conference
  • Developer Summit
Esri
© Copyright 2016 Environmental Systems Research Institute, Inc. | Privacy | Legal