I'm wanting to make a copy of a geodatabase from one location on our network to another. Can anyone help?
Solved! Go to Solution.
Thanks for the help. Below is my final script I came up with that has been tested and works.
import arcpy
from arcpy import env
arcpy.env.overwriteOutput = True
env.workspace = r"M:\GIS Geodatabases"
arcpy.Copy_management("Cadastral.gdb", r"T:\pl\Planning Geodatabases\Cadastral.gdb")
print "Cadastral.gdb Copy Complete"
env.workspace = r"M:\GIS Geodatabases"
arcpy.Copy_management("Transportation.gdb", r"T:\pl\Planning Geodatabases\Transportation.gdb")
print "Transportation.gdb Copy Complete"
env.workspace = r"M:\GIS Geodatabases"
arcpy.Copy_management("AdminBoundaries.gdb", r"T:\pl\Planning Geodatabases\AdminBoundaries.gdb")
print "AdminBoundaries.gdb Copy Complete"
I started writing out some code, but check this: Copy—Help | ArcGIS Desktop it's pretty easy...
Thanks for the help. Below is my final script I came up with that has been tested and works.
import arcpy
from arcpy import env
arcpy.env.overwriteOutput = True
env.workspace = r"M:\GIS Geodatabases"
arcpy.Copy_management("Cadastral.gdb", r"T:\pl\Planning Geodatabases\Cadastral.gdb")
print "Cadastral.gdb Copy Complete"
env.workspace = r"M:\GIS Geodatabases"
arcpy.Copy_management("Transportation.gdb", r"T:\pl\Planning Geodatabases\Transportation.gdb")
print "Transportation.gdb Copy Complete"
env.workspace = r"M:\GIS Geodatabases"
arcpy.Copy_management("AdminBoundaries.gdb", r"T:\pl\Planning Geodatabases\AdminBoundaries.gdb")
print "AdminBoundaries.gdb Copy Complete"
Good job; you only need to set your workspace once, so lines 10 & 14 aren't needed. If you want to have some fun, create a list of the the database names and iterate through them in a 'for' loop....
I'm pretty new to Python but thanks for the input. I will have to give that a try so I can sharpen my skills.
Stick with it and have some fun. Anytime you need to do something more than a couple of times, script it. There is only one way to get into python, and that's to get into python! A year ago I couldn't spell python...