2 Replies Latest reply on Sep 23, 2010 7:46 AM by kreuzrsk

    Problems with ArcPy replaceWorkspaces and findAndReplaceWorkspacePaths validation

    kreuzrsk
      Our ArcSDE/SQL servers are 6 years old so we are migrating to new hardware.  The server name and IP address are changing so all MXDs are going to break.  We are also taking the "opportunity" to implement windows authentication for SDE connecitons.

      I've been testing out ArcPy scripts using both the replaceWorkspaces and findAndReplaceWorkspacePaths commands but have run into problems with each.  The findAndReplaceWorkspacePaths command seems to ingore the validation setting when set to false.  It works in the replaceWorkspaces command but python crashs at the mxd.saveACopy command whenever the MXD contains a image services.

      Anyone else experiencing these problems?

      # This works where there are image services in the MXD
      for myDataSource in uniqueDataSourceList:
          mxd.replaceWorkspaces(myDataSource, "SDE_WORKSPACE", outputGDB, "SDE_WORKSPACE")
      mxd.saveACopy(outputMXD, '9.3')

      # This crashes if there are images services in the MXD
      for myDataSource in uniqueDataSourceList:
          mxd.replaceWorkspaces(myDataSource, "SDE_WORKSPACE", outputGDB, "SDE_WORKSPACE", False)
      mxd.saveACopy(outputMXD, '9.3')
        • Re: Problems with ArcPy replaceWorkspaces and findAndReplaceWorkspacePaths validation
          CumminsJP
          Yes.  NIM060315

          Our ArcSDE/SQL servers are 6 years old so we are migrating to new hardware.  The server name and IP address are changing so all MXDs are going to break.  We are also taking the "opportunity" to implement windows authentication for SDE connecitons.

          I've been testing out ArcPy scripts using both the replaceWorkspaces and findAndReplaceWorkspacePaths commands but have run into problems with each.  The findAndReplaceWorkspacePaths command seems to ingore the validation setting when set to false.  It works in the replaceWorkspaces command but python crashs at the mxd.saveACopy command whenever the MXD contains a image services.

          Anyone else experiencing these problems?

          # This works where there are image services in the MXD
          for myDataSource in uniqueDataSourceList:
              mxd.replaceWorkspaces(myDataSource, "SDE_WORKSPACE", outputGDB, "SDE_WORKSPACE")
          mxd.saveACopy(outputMXD, '9.3')

          # This crashes if there are images services in the MXD
          for myDataSource in uniqueDataSourceList:
              mxd.replaceWorkspaces(myDataSource, "SDE_WORKSPACE", outputGDB, "SDE_WORKSPACE", False)
          mxd.saveACopy(outputMXD, '9.3')
          • Re: Problems with ArcPy replaceWorkspaces and findAndReplaceWorkspacePaths validation
            kreuzrsk
            Yes.  NIM060315


            Unfortunately, this bug is not among the listed bug fixes for SP1  :(