Hello community,
I have an Electric UN data in my SDE database. I would like to export/copy this UN data to another SDE database on regular intervals like daily once. So what I need is, I need to create a Python script to do this copy/export. And once the script is ready, then I can make task schedular to run this script daily once.
Is there any script readily available to do this task?
Thanks in advance.
Ashok
Solved! Go to Solution.
There are typically three approaches to this problem, and each approach has different benefits, depending on what you're trying to achieve. I would only choose one of the other two options (below) if you were looking for a way to ONLY copy the utility network data and wanted to leave the rest of the objects in the database behind.
This is discussed on the utility network dataset administration page of the online help.
Hello,
You will need to write your own Python script. We used the same method to export SDE UN data to a mobile geodatabase.
In short, this is done in two steps:
UtilityNetworkToAssetPackage, then AssetPackageToFileGeodatabase.
In your case, you will also need to clean the schema/dataset if you want to overwrite it. Furthermore, the second step does not work for writing to an SDE geodatabase; you will need to perform additional steps:
StageUtilityNetwork then AssetPackageToUtilityNetwork.
The benefit of this process is that it will highlight any errors that might exist in your Utility Network.
However, you could also perform a backup/restore of the entire schema to another database.
There are typically three approaches to this problem, and each approach has different benefits, depending on what you're trying to achieve. I would only choose one of the other two options (below) if you were looking for a way to ONLY copy the utility network data and wanted to leave the rest of the objects in the database behind.
This is discussed on the utility network dataset administration page of the online help.
For your information, you can use the POST_PROCESS option with AssetPackageToFileGeodatabase or AssetPackageToUtilityNetwork. This will automatically enable the network topology and update all subnets.
However, the administration documentation for the utility-network dataset indicates that, when importing XML workspace document, the topology will be disabled and the subnets marked as modified. Therefore, you will need to enable the topology and update the subnets somehow if you want to script the copy.
Only copy-pasting seems to eliminate this need.