Vishful thinking…

A possible solution to getting your Geodatabase under source control

Posted in ArcGIS, ESRI by viswaug on January 21, 2009

A lot has already been said on the importance of getting your database under source control. If you haven’t given thought to including the database into your SVN, now is a good time to start and these tools can help. Various command line tools currently exist to script out the schema and optionally even the data to SQL script files on disk that can be checked into the SVN along with your source code. SQL Compare from redgate has the most complete solution with some features to die for. It will let you diff your current database with a SQL script that was generated earlier… yeah that’s nice. But it is gonna cost but well worth the money in my opinion. If you don’t want to dish out the $$$ for SQL Compare then the “Database Publishing Wizard” on CodePlex can step in to help your cause. It even has a command line version so that it can be easily incorporated into your automated build process.

Well, why did I say all that? I had been thinking about how I could get my Geodatabase under source control. Well, for starters we can export the Geodatabase to the XML Workspace Document format manually from ArcCatalog and check-in the XML document into source control.

export_xml_workspace

export_x603734039

If you are interested in automating that process of exporting your Geodatabase to XML then the ‘IGdbXmlExport‘ interface is your buddy and can be used to export and import schema and data. A NAnt or MSBuild task can written to include it as a part of your automated build process.

2 Responses

Subscribe to comments with RSS.

  1. dylan thomas said, on January 21, 2009 at 6:15 pm

    Now that’s a good idea. I typically use 7-zip to compress the heck out of a file based gdb or even a SQL Server backup file, then my msbuild script uncompresses and restores the database as needed. That way I’ve got a complete gdb along with archiving just by running msbuild Master.proj /t:GisDbUp or something similar. But the XML is cleaner.

  2. viswaug said, on January 21, 2009 at 6:53 pm

    Hi Dylan,

    The ArcGIS Diagrammer tool will allow you view the schema from the XML file too…

    http://mrrichie.spaces.live.com/Blog/cns!DD16C3F34F4D913E!776.entry?sa=890767100

    Thank You,
    Vish


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: