I'm trying to convert a polygon GeoJSON of countries into a line layer that contains *only the borders*. It should **not** contain the edges of the polygons that border the ocean (in my polygon dataset, nothing).

How can I in QGIS 3.8 do that? Basically, "give me the linestring of this polygon data, but only where there is a polygon on both sides of it".

I've checked similar answers and they don't cover this case. Most importantly, I actually want the data, not just set the display fill style to none.