POST
|
Yes, I'm doing the exact same thing and I'm experiencing the single thumbnail issue. This appears to be a bug. Thanks for the tip(work around) of removing Thumbnail.png after running StageService. Here's my code: #Service setup service_name = "ODL_" + lyr.name sddraft = run_path + "\\output\\" + service_name + ".sddraft" sd = run_path + "\\output\\" + service_name + ".sd" tn = run_path + "\\output\\Thumbnail.png" #Publish arcpy.mp.CreateWebLayerSDDraft(lyr, sddraft, service_name, "MY_HOSTED_SERVICES", "FEATURE_ACCESS","OpenDataTest", True, True) arcpy.StageService_server(sddraft, sd) arcpy.UploadServiceDefinition_server(sd, "My Hosted Services", "", "", "", "", "", "OVERRIDE_DEFINITION", "SHARE_ONLINE", "PUBLIC", "SHARE_ORGANIZATION", "Open Data Test") os.remove(tn) #work around: remove thumbnail so it's get re-generated
... View more
06-11-2024
09:28 AM
|
1
|
0
|
164
|
POST
|
Take a SQL backup from the old server and restore it on the new server. Note: The geodatabase name needs to be the same on the new server or it will not be recognized by the Esri software.
... View more
11-16-2022
10:18 AM
|
1
|
0
|
1420
|
POST
|
I created a python script to recreate existing replicas (or create new ones) using geoprocessing tools in ArcGIS Pro and I thought I would share to the community. This script will not run in ArcMap since the "UnregisterReplica_management" tool is new to ArcGIS Pro. This is very useful after you add new feature classes to a parent replica feature dataset. #----------------------------------------------------------------------
#title :RecreateReplica.py
#description :Creates new replicas or recreates existing replicas using geoprocessing tools available in ArcGIS Pro 3
#description :The script is setup to work with enterprise geodatabases in SQL Server
#description :Works for "SIMPLE", "One Way Replicas" only and is configured to operate at the individual feature dataset level
#description :The data in the child geodatabase needs to be free of schema locks (putting the SQL database in Restricted user mode before running the script will remove schema locks)
#author :Bill Myers
#last_update :11/15/2022
#notes :Runs in ArcGIS Pro 3.0.2
#python_version :3
#----------------------------------------------------------------------
import sys, arcpy
#----------------------------------------------------------------------
#Setup
runPath = sys.path[0]
dataSchema = "GIS"
dataName = "Boundaries" #Feature dataset and replica base name.
parentGDB = "SdeDev"
childGDB = "SdeTemp"
#Feature datasets
parentFDName = "{0}.{1}.{2}".format(parentGDB, dataSchema.upper(), dataName) #"SdeDev.GIS.Boundaries"
childFDName = "{0}.{1}.{2}".format(childGDB, dataSchema.upper(), dataName) #"SdeTemp.GIS.Boundaries"
#SDE connection file (should be already setup in ArcGIS Pro)
parentGDBConn = "{0}\\cosgissql_{1}_{2}.sde".format(runPath, parentGDB, dataSchema) #"cosgissql_SdeDev_GIS.sde"
childGDBConn = "{0}\\cosgissql_{1}_{2}.sde".format(runPath, childGDB, dataSchema) #"cosgissql_SdeTemp_GIS.sde"
#Replicas
replicaName = "Replica_{0}_{1}".format(dataSchema, dataName) #"Replica_GIS_Boundaries"
replicaNameFull = "{0}.{1}".format(dataSchema.upper(), replicaName) #"GIS.Replica_GIS_Boundaries"
parentReplicaExists = True
childReplicaExists = True
parentReplicaDatasets = []
childReplicaDatasets = []
childReplicaTables = []
#Replica params
expand = "DO_NOT_ADD"
getRelated = "DO_NOT_GET_RELATED"
#expand = "ALL_ROWS"
#getRelated = "GET_RELATED"
#Environment
arcpy.env.overwriteOutput = True
arcpy.env.workspace = childGDBConn
#----------------------------------------------------------------------
def replicaExists(gdb, name):
exists = False
for replica in arcpy.da.ListReplicas(gdb):
if replica.name.upper() == name.upper():
exists = True
break
return exists
#----------------------------------------------------------------------
#Find if replicas exist
childReplicaExists = replicaExists(childGDBConn, replicaNameFull)
parentReplicaExists = replicaExists(parentGDBConn, replicaNameFull)
#Get parent datasets to replicate
arcpy.env.workspace = parentGDBConn + "\\" + parentFDName
fcs = arcpy.ListFeatureClasses()
for fc in fcs:
fullPath = parentGDBConn + "\\" + fc
parentReplicaDatasets.append(fullPath)
#arcpy.AddMessage(parentReplicaDatasets)
if childReplicaExists and parentReplicaExists:
arcpy.AddMessage("Removing existsing replicas: " + replicaNameFull)
#Get child replica datasets
for replica in arcpy.da.ListReplicas(childGDBConn):
if replica.name == replicaNameFull:
childReplicaDatasets = replica.datasets
#arcpy.AddMessage(childReplicaDatasets)
#get child tables
for dataset in childReplicaDatasets:
desc = arcpy.Describe(childGDBConn + "\\" + dataset)
if hasattr(desc, "dataType") and desc.dataType == "Table":
childReplicaTables.append(childGDBConn + "\\" + dataset)
#reset params to handle related tables
if len(childReplicaTables) > 0:
expand = "ALL_ROWS"
getRelated = "GET_RELATED"
#Unregister
arcpy.AddMessage("...Unregistering Replica")
arcpy.UnregisterReplica_management(parentGDBConn, replicaNameFull)
arcpy.UnregisterReplica_management(childGDBConn, replicaNameFull)
#Delete child tables
if len(childReplicaTables) > 0:
arcpy.AddMessage("...Deleting child tables")
arcpy.Delete_management(childReplicaTables)
#Delete child feature dataset
arcpy.AddMessage("...Deleting child feature dataset")
dataPath = childGDBConn + "\\" + childFDName
arcpy.Delete_management(dataPath)
#Create Replica
arcpy.AddMessage("Creating Replica: " + replicaNameFull)
arcpy.management.CreateReplica(parentReplicaDatasets, "ONE_WAY_REPLICA", childGDBConn, replicaName, "SIMPLE", "PARENT_DATA_SENDER", expand, "DO_NOT_REUSE", getRelated)
... View more
11-16-2022
10:11 AM
|
0
|
0
|
625
|
POST
|
Are multiple maps supported in the current version (100.1.0)? 100.1.0
... View more
07-26-2017
03:57 PM
|
0
|
5
|
858
|
POST
|
Is there a way for an administrator to tell which users in ArcGIS Online have enterprise logins? We are in the process of transitioning from assigned user names to enterprise logins so we currently have a mixed environment.
... View more
12-08-2016
09:41 AM
|
0
|
1
|
700
|
POST
|
Is there an event that allows me to detect when the map extent has changed?
... View more
05-06-2014
04:04 PM
|
0
|
1
|
2504
|
POST
|
I'm looking for sample code that shows how to create a line chart, pie chart or bar graph.
... View more
04-23-2014
08:27 AM
|
0
|
1
|
716
|