changeDataSource plugin release 1.0

the new qgis plugin allows to change the datasource of layers already loaded preserving all properties and settings (symbology, labels, joins, relations) using methods already exposed. The plugin operates in two operating modes: per layer or per project. In the first way it is possible to operate directly on layer right clicking on legend items, modifying the datasource type and string and applying the edits.

Screenshot 2015-09-30 20.25.02Screenshot 2015-09-30 20.29.09

in the second way clicking on toolbar icon, the plugin exposes on an editable table datasource types and connection strings for all the loaded layers allowing global edits with a find and replace function or a direct edit on the cells. Datasource are not modified directly; modified cells are marked in yellow and the edits have to be applied to be effective, and visible on map canvas. Valid edits are marked in green while the invalid ones in red.


Download plugin



  1. Pingback: changeDataSource plugin release 1.0 for QGIS |
  2. Baswein

    Enrico, Thanks for the great plug-in. Efforts like yours seem to be what keeps QGIS thriving. Now if the “handle bad layers” would let me save the layers to reconnect latter with your plug-in when I am back on the network. That would be even better.

    • enricofertest

      I am happy to know you find it useful. “Handle bad layers” is a core feature that I don’t figure how to manage it in a plugin. Maybe intercepting project reading layer signal… I promise I will have a look.
      I was expecting to change datasources from property dialog for a long time, so I decided to write it by myself, but it would be a nice new core feature.

    • Baswein

      Thanks! I installed it. I experimented a little with a shape file by moving the shape file and all it’s associated fils to a subfolder. It moved the layer to the unhandled layer (great). When I reconnected the file with the global toolbar icon it told me that my shape file was the wrong file type. When I reconnected using the right click method it reconnected fine. I did lose my styles that I had set up for the layer is that normal? Thanks for doing all of this!

    • enricofertest

      Yes. It should be possible, as any other datasource, but, at the moment, I have not a testing mysql db server to verify it.

  3. lulferts

    QGIS3 is great! The only thing I’m painfully missing is your “changeDatasource”. Are you planning the migration to P3/QT5?

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s