If you open a .QGS with a text editor you will see some XML code. Your project layers are inside
<projectlayers> ... </projectlayers> tags and each layer is in
<maplayer>...</maplayer> tags. Search through the
maplayer tags until you find the broken one that has a missing source. You can search for the
layername tag to help you.
Once you find that, search for the next
<renderer-v2> tag. This is the style definition for that layer. Copy all the text including the open
<renderer-v2> and closing
</renderer-v2> tag. All that text is a valid QGIS style definition which we can put into a QML file.
Put that text into a new file with a header with a
<qgis ... tag so the start looks like this:
<!DOCTYPE qgis PUBLIC 'http://mrcc.com/qgis.dtd' 'SYSTEM'>
<qgis simplifyDrawingHints="1" simplifyLocal="1" maxScale="0" simplifyMaxScale="1" styleCategories="AllStyleCategories" version="3.4.2-Madeira" simplifyDrawingTol="1" labelsEnabled="0" minScale="1e+8" readOnly="0" hasScaleBasedVisibilityFlag="0" simplifyAlgorithm="0">
<renderer-v2 type="singleSymbol" enableorderby="0" symbollevels="0" forceraster="0">
<symbol name="0" type="marker" alpha="1" clip_to_extent="1">
and it ends with
</renderer-v2>. Save this file as
Then in QGIS from the properties dialog of an existing layer you can load this QML file and use it to style it. Note it has to be compatible - you'll struggle to apply a polygon style to a point layer, for example.
I'm working with QGIS 3.4, and it saves
.qgz files, which are zipped
.qgs files. You can run your standard unzipping program on a
.qgz to get a
.qgs which you can edit to get the style info in the
If you have a lot of these to do then a short Python program could be written to extract all the renderer info from a QGS and save it in separate QML files - it would not surprise me if something like this didn't already exist or was part of a QGIS plugin...