-1

Is it possible to change the directory of a layer's source file without deleting and re-importing the layer?

Taras
  • 32,823
  • 4
  • 66
  • 137
ChameleonScales
  • 337
  • 1
  • 13

1 Answers1

3

Yes, with the plugin Change datasource, it's the easiest way to change the path of a layer in QGIS.

Copy the layer file (or multiples files in the case of a shapefile) into the new directory and then open your project and change the source with the plugin.

romainbh
  • 1,045
  • 7
  • 13
  • The plugin is a bit opaque to me. It asks for a string to be replaced with another string, but that does not seem to work. Any suggestions? Do I need to really use this in QGIS.3.22? The Bad Layers handler launches in the beginning but does not seem to work for me, hence I went to this plugin... – Sharad Feb 27 '22 at 11:19
  • UPDATE: I figured out that if I ignore QGIS' native "Handle Missing Layers" dialogue (click "Keep unavailable layers") and then go and 'fix' one of the layers that has a 'bad data source', the others also get fixed automatically. Rather counter-intuitive, but worked. (I did not use the plugin at all) – Sharad Feb 27 '22 at 11:52