0

I'm editing this post because multiple users are having the issue in our organization. Using qgis 3.34LTR and 3.36, multiple people are reporting they can't open their qgis project files. They get an error message saying qgis cannot unzip the file.

I have been able to open these files using 3.36 and save them as a .qgs file and it seems to save everything appropriately. But any ideas why they are getting this error??

Another thing - not sure if it's related, but our organization has recently switched to using gpkg instead of zip files. And I've been saving vector layer styles to the gpkg. I'm not sure if this could be partially responsible?

Update - for one qgz file with this issue, the only thing in the qgz file is a qgs file and a styles.db file which will be the styles that should be saved in the gpkg

########## Original question ###########

I'm in trouble with a .qgz file that I can't unzip in QGIS 3.36.1

I have try to rename it and unzip it with 7zip, but it say "unable to unzip the file"

The file is 476 ko.

How I can fix it ? It's all my work from a years ! I don't have saves.

1
  • 2
    you can rename your *.qgz file to *.zip file to extract the *.qgs project file that can be opened with any text editor and changed or looked through. Commented Apr 17, 2024 at 8:55

1 Answer 1

2

A .qgz file is just a zipped store of project files, the most important of which is the .qgs file, which contains all the project settings, layer information, etc. However, actual layer data is stored separately.

It sounds like the zipped store has gotten corrupted. Your first step should be to un-corrupt it, and try to recover the .qgs file inside. You have already tried to just rename it and unzip, but didn't succeed. You can try a number of zip recovery software packages and see what they can do. WinRAR is one which often comes up, as well as EaseUS Recovery for Windows. Note many of these are paid packages, though sometimes the free trials will work completely or at least reassure you they can fix the archive before you have to pay.

It is unfortunately quite likely that at best, the .qgs file will be prematurely truncated (since many zip file corruptions are truncations). In this instance, it is quite likely QGIS will choke when opening it, since it will doubtless be not quite valid as an XML file. Impossible to tell before you try how badly this will be, i.e. whether QGIS will open but with warnings, or be unable to open. So you may need to manually edit the .qgs file in a text editor to at least terminate tags, etc.

Finally, in QGIS the actual layer data (i.e. map features, rasters, etc) are stored separately. The .qgs/.qgz files contain project-level data and all the info in layer properties. So you may find it more time-effective to recreate the project, importing and re-styling all the layers you had. Your time loss should not include the layer data itself.

The latter also allows a bit of a hybrid approach. Re-create a new project with appropriate structure, and then use your corrupt/truncated recovered old .qgs to manually guide you how to re-implement symbology, layouts, forms, calculated virtual fields, etc. in the new one. Or even, with great care, to copy over recovered blocks of data from the recovered corrupt project file to the new one.

Not pretty, and probably not what you wanted to hear. Good luck!

1
  • Thank you. I'm going to try zip recovery software. Commented Apr 17, 2024 at 14:07

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.