The impact of the capping process on the structural and morphological properties of GaN quantum dots (QDs) grown on fully relaxed Al0.5Ga0.5N templates was studied by transmission electron microscopy. A morphological transition between the surface QDs, which have a pyramidal shape, and the buried ones, which have a truncated pyramid shape, is evidenced. This shape evolution is accompanied by a volume change: buried QDs are bigger than surface ones. Furthermore a phase separation into Al0.5Ga0.5N barriers was observed in the close vicinity of buried QDs. As a result, the buried QDs were found to be connected with the nearest neighbors by thin Ga-rich zones, whereas Al-rich zones are situated above the QDs.