Upgrades the schema of the network dataset. Upgrading a network dataset allows it to use new functionality available in the current software release.
Legacy:
This is a deprecated tool. This functionality has been replaced by the Upgrade Dataset tool. Upgrade Dataset can upgrade network datasets as well as other types of datasets, such as parcel fabrics, to the current ArcGIS release.
Usage
Before the network dataset can be upgraded, the geodatabase must be upgraded to the current release using the Upgrade Geodatabase tool.
The following stand-alone Python script demonstrates how the UpgradeNetwork function can be used to upgrade the schema of a network dataset.
# Name: UpgradeNetwork_Workflow.py
# Description: Upgrades the schema of a network dataset by first upgrading the
# geodatabase containing the network dataset and then upgrading the
# network dataset. The network dataset is also built so that it can
# be used to perform network analyses.
# Requirements: Network Analyst extension
#Import system modules
import arcpy
try:
#Set environment settings
arcpy.env.workspace = "C:/data/RhodeIsland.gdb"
arcpy.env.overwriteOutput = True
#Set local variables
#inNetworkDataset = "Transportation/Streets_ND"
inNetworkDataset = "RhodeIsland/RhodeIsland_ND"
#Before upgrading the network dataset, upgrade the file GDB that contains
#the network dataset
arcpy.management.UpgradeGDB(env.workspace)
#Upgrade the network dataset
arcpy.na.UpgradeNetwork(inNetworkDataset)
#The upgraded network dataset is not built. So build the network dataset
arcpy.na.BuildNetwork(inNetworkDataset)
print("Script completed successfully")
except Exception as e:
# If an error occurred, print line number and error message
import traceback, sys
tb = sys.exc_info()[2]
print("An error occurred on line %i" % tb.tb_lineno)
print(str(e))