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 don't know if there is an answer to this question, aside from the obvious.

I have about 30 different QGIS Project files for 30 different clients. Each is saved onto my computer and all their relevant vector and raster files are all saved locally.

We are now in the process of moving office and upgrading our computers.

As a result, I need to move all my files from my computer onto the network drive, thus destroying any previous file references.

Aside from manually clicking on each file and looking for each ones new location, is there any other way around this.

(Each project could have a few hundred links to update)

share|improve this question
add comment

3 Answers

up vote 13 down vote accepted

I'm not sure what version of QGIS you are using, however in v2.0.1 you may use the "Handle bad layers" window like this:

enter image description here

  1. Select all layers in common directory while holding Ctrl key
  2. Double click on last one you select
  3. Re-path one of you layers and select Open
  4. Repeat process for additional directories

This will batch update files by directory

enter image description here

share|improve this answer
1  
Thanks for pointing this out! I've been looking for a feature like this since ArcGIS added the Repair datasource option a few versions ago. –  HeyOverThere Nov 13 '13 at 14:43
    
I didn't know you could update multiple layers with a common directory at once. Thanks! –  SAnderka Nov 13 '13 at 15:45
    
Cheers! this seems to be what i am looking for. I have not tried it yet but will do today. if it works i will acept the answer. –  Gerald Nov 14 '13 at 11:38
    
It is nice but it doesn't seem to be able to work with file geodatabases as it only wants a file not a directory. As a test I tried to see if one of the arcane named gdb files might work but after trying most I gave up. –  johns Nov 19 '13 at 20:48
add comment

The QGIS project files are simple text files. You can search and replace the content with any text editor.

Just look up how the files are referenced in the old and new storage location, and you know what has to be changed.

Notepad++ allows even for batch processing across several files in one step.

share|improve this answer
    
Thanks, as always andre great answer. –  Gerald Nov 14 '13 at 11:39
add comment

If you save the project with relative path links before you move your data you shouldn't need to fix any links in the new projects.

In QGIS v2.01 Go to Project > Project Properties and select Save Paths Relative before you move your data across, then as long as you are just copying the data across and retain the same folder structure the files should work when you reopen the projects from your network drive.

Saving relative paths

share|improve this answer
    
Unfortunately the first bit of the structure will be different at the very least. –  Gerald Nov 14 '13 at 11:39
    
OK, relative paths will still work as long as the projects and data are saved in the same structure relative to each other even if the first part changes. In the example below as long as you move and keep everything below the Work folder level the same the initial part of the path can be as different as you want. Projects = C:/Work/Projects/myproj.qgs and Data = C:/Work/Data/myfile.shp –  MAJ742 Nov 14 '13 at 11:56
    
Accepted it is just the C:// wil have completly changed to a networked drive. –  Gerald Nov 15 '13 at 12:32
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.