# Where diagrams are stored A diagram is two things: the source, and the macro that points at it. The source lives in your Confluence site, as custom content or as a page attachment, and the macro on the page holds a reference to it. That is why permissions work without any extra configuration, and why a diagram survives being copied, exported or migrated with the page. --- ## When this matters * Security reviews and data mapping exercises. * Understanding what happens when a page is deleted or moved. * Planning a migration or a backup strategy. --- ## The detail | **Thing** | **What happens** | | --------------- | ------------------------------------------------------------- | | Source | Custom content or a page attachment, in your Confluence site. | | The macro | Holds a reference to the source, plus display settings. | | Preview image | An attached rendering, used by exports and anonymous readers. | | Version history | Kept with the source, so earlier versions can be restored. | --- ## A few things that catch people out * Deleting the page deletes the diagram source with it. That is Confluence's behaviour, not ours. * Copying a page copies the diagram, so the copy is independent. * A diagram reference points at the original, so it follows that page's lifecycle rather than its own. --- ## Related [draw.io XML inside PNG filesThe picture is also the source.](https://help.gocapable.com/diagrams/draw-io-xml-inside-png-files.html) [Stored previews and thumbnailsWhat makes offline views work.](https://help.gocapable.com/diagrams/stored-previews-and-thumbnails.html) [ExamplesWorking diagrams you can copy.](https://help.gocapable.com/diagrams/examples.html) --- _Ask us the awkward questions. They have answers._