1

I am due to finish work with my current employer, and leave all my QGIS work behind. I have about 100 different project files set up, each for a different client. Some pull from a common GIS database, other have client specific files.

What I want to do is to remove the hard drive from this computer, create it as a shared drive on another computer, but unfortunately this will change the file paths on ALL projects...insted of c:/ etc. it will now be g:/

all the rest should remain the same....is there an easy way to do this?

1

One tool to look at is the QConsolidate plugin.

What it does is to collect the files together from all the layers in a project (from wherever they are) and put them into a single directory (or rather, into a subdirectory of a folder), and it does all the editing of project XML files for you to point to the new location.

You choose a target directory, end up with a folder containing your project, and a subfolder containing all the files needed.

enter image description here

This suits my workflow as my projects often refer to common shapefiles, which I store once (organised by theme or source), rather than taking new copies into each new project's folder. Doing this lets me package them as standalone projects to send to others, for example.

Of course, back up everything first, and test migrated projects thoroughly. ;)

It's certainly okay with things like shapefiles, but you might need to migrate some types of file yourself (not sure if it handles style files, sqlite databases and so on)

But this will probably be less error-prone than manually editing your xml files.. but sounds like it'll still be a lot of work.

You may end up with a lot of duplicate data on your target drive, but this might not be a problem if you tend to copy common files amongst your projects anyway.

1

All QGIS files, setings, project files, style files, etc are all open format text or open formats. The project file is a XML file. Replacing the paths is as simple as opening it in a text editor and updating the text.

Here is example of a ogr based layer:

<datasource>F:/gis_data/QGIS/Data Entry/Pipes.shp</datasource

2
  • but in essence i have to do this for all individual projects
    – Ger
    Sep 30 '15 at 11:10
  • 1
    Sure but Notepad++ (and anything else good) can do it in batch if you want. Do it all the time for clients that update paths.
    – Nathan W
    Sep 30 '15 at 11:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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