Select to view content in your preferred language

Need python script to copy SDE to GDB

7113
10
07-25-2022 04:12 PM
Labels (3)
PhilLampe
Occasional Contributor

Hello,

First off, please forgive my unintentional misuse of the terminologies going forward.  I'm not versed in SDE and may have stated some things incorrectly.

So from the 50,000 foot view my overall intent is to go through this SDE database (that I just got connected to) and find out how many records there are.  This SDE has numerous datasets, and inside those datasets are numerous feature classes.  The feature classes utilize relates and some of the fields are tied to coded value domains.  At the root of the SDE connection are tables that are linked to the relates in the feature classes as well as the coded domains (I believe).

The goal here is to read the contents of the SDE and generate a text (CSV or XLS) file with it's contents.  All I need is 3-columns (Dataset name = Col-A, Feature Class name = Col-B, and total feature count = Col-C).

Now, I HAVE a script in hand that can do ALL of the above, EXCEPT (big EXCEPT) it will not work when trying to read from an SDE connection.  It MUST be able to point to a GDB.

Hence the reason I'm here now.

So, the IMMEDIATE goal here is to find a python script that can take my version instance of SDE and make a duplicate copy of the entire SDE database into a GDB database.

So... is there a python script that can just do the above listed in red?

Or, does anyone know of a python script that can do BOTH listed in red and blue?

If there's more information you need before you can provide an answer, please respond and I'll reply ASAP.

TIA!

Phil

0 Kudos
10 Replies
VinceAngelo
Esri Esteemed Contributor

You don't need to post the code twice, but you do need to post it legibly, using a code block in the formatting section. Indenting is of critical importance in Python, so any display mechanism which strips whitespace makes it unusable.

- V