I would like to move an SQLite db to a new directory on my computer. The SQLite file is in the same folder as a Qgis project file. I copied the parent folder to a new location. When I try to open the Qgis project file, I get a bad layers error for the SQLite db.

What am I doing wrong?

Alternatively, if I try to open the SQLite db from its new location in a new QGIS project, I cannot open it properly.

  • 1
    You can try opening the QGIS project file in a good text editor like notepad++, search and replace the path to the database.
    – AndreJ
    Oct 24, 2017 at 6:22

2 Answers 2


You could try updating the file path within the bad layers dialogue. You can edit the file path directly within this dialogue box, just hit apply and your project will be updated.

If you move the database then try to connect to it in a new project, then you need to delete the old connection stored in QGIS. When you connect, it will be still looking for database in the old folder.


Copy the SQLite db to the new directory. Open the QGIS project and use the changeDataSource plugin to change the layer sources "en mass". Save the project, delete the old SQLite db and you are good to go.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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