On SharePoint 2007, it was possible before creating a template to exclude content
Site Settings page > Look and Feel section > Save site as template > Include Content section, uncheck the Include Content check box) guess it should be similar for SP2010 / 2013. (edit : indeed, it's like that in SP2010 as well)
An easy way would be to
- create a full backup of the site (
stsadm -o backup -url {your-site-collection-url} -filename "c:\temp.bak"
)
- empty all non required content from that site collection
- create a backup / template (or export the cleaned site)
- restore the temporary full backup (
stsadm -o restore-url {your-site-collection-url} -filename "c:\temp.bak" -overwrite
)
Third solution, I would investiguate into the trusty tool made by Chris O Brien http://spdeploymentwizard.codeplex.com/ which might help to get your expected requirement. The tool is open source, I guess it shouldn't be too hard to identify the component responsible for persisting the content and bypassing-it to get only the structure. Would love to have feedback from the master (or check the discussion on codeplex, someone might have thought of this before me !)