Confluence can backup all the content, comments and attachments for a space. The process involves converting the data in the space into XML format. The end product is a zip file that contains XML file(s) and optionally, all the attachments in the space. To transfer this data to another Confluence site, you simply restore this zip file.
Instructions on how to create a backup for a space can be found here.
Instructions on how to restore or import the backup of a space can be found here.