Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I have a backed up file GDB which I have to use because the current one had some broken models in it. I got this backup delivered on my local D:\ drive and have to copy models from this GDB to a current one, which sits on a network location.

Now the problem is that all the links to data in the models have been reset to this local drive, whereas they should point the network location. When I now edit the model and set back the paths to the correct locations (e.g. in the 'feature class to feature class' tool), all my fieldmaps that were adjusted in the backed up models will change (originally deleted fields appear again, adjusted field names get lost). This is a problem because not only do I have a couple of models where this has to be changed, also the feature classes within them have a lot of fields. This means a lot of tedious work that I want to avoid by all means, especially as the correct field mapping is available in my backed up models.

I’m using ArcGIS 9.3, the ‘Store relative path names’ option is checked in all the models. May that have caused the problem? It does however not make a difference if I change to ‘absolute path names’ now, as the field map gets lost as soon as I change the location of my data in the model. This question may be a basic one, but I could not find a solution so far, neither in the ArcGIS help nor on the web. Maybe someone can point me in the right direction?

share|improve this question
1  
This drives me nuts. –  nmpeterson Mar 13 '13 at 2:47
2  
Field mapping is still an issue at 10.1. if I absolutely need to have it in a model, I normally put that section in a submodel, fiddle with the field mapping, then save and clear any data from the main model. Once I open the submodel, the field mappings are still intact, even if I move the model to a different location. It's a ridiculous workaround, but if you don't want to go the Python route as blah238 mentioned (although I do agree with the viewpoint), it might be worth a try. –  Arabella Mar 13 '13 at 5:05
    
I found that the main field mapping issue that plagued me at 9.3 (which sounds like the one described here) went away at 10.0 - if not totally then at least largely. If upgrading to 10.x is an option (and you want to use ModelBuilder) then I would definitely try that first and get a much better environment to undo/redo, iterate, tool tips, etc, etc. –  PolyGeo Mar 13 '13 at 10:28
    
Thanks for all your comments and answers. I was afraid that there is no proper solution to this problem. Looks like I have some work ahead of me.. –  David Mar 13 '13 at 22:43
add comment

1 Answer 1

up vote 1 down vote accepted

I dislike the ModelBuilder environment for many reasons such as this one. It has a very convoluted validation system that tends to get in the way more than it helps. I suspect it is trying to be "helpful" by noticing you updated the data source of some upstream data element and "helpfully" wipes out your field mappings.

Perhaps you could export your working models to Python and run it as a script tool instead of a model. At least with Python it would be a simple search/replace to update your hardcoded paths. The export process should retain your original field mappings, although other things might not work correctly, and if your model is large it will be generally unworkable without significant refactoring.

share|improve this answer
    
I agree with @blah238 that Python will be a better option than ModelBuilder when you start to run into problems like this. ModelBuilder is great for simple tools but for any sizable application a high Python:ModelBuilder ratio is best - just use ModelBuilder for the more straightfoward bits and to provide self-documenting processes at its highest level. I wrote a dozen or so 400 element models with two levels of looping in the worst one at 9.3 and it was no fun - thanks largely but not entirely to the field mapping bug mentioned here. –  PolyGeo Mar 13 '13 at 10:35
    
Thanks again to all your suggestions. It finally worked out for me using an old backup and make sure to have "relative path names" selected in the model properties. An interesting thing was though, that this did not work for all models when copying the backup on a network machine, but it was okay doing it in my Citrix environment. Probably has to do something with different user settings. All in all, making Python scripts is definitely the way of handling these issues in future. –  David Mar 20 '13 at 1:38
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.