You can get everything as JSON through the REST API. Go to Developer Tools → API Explorer → Persistence and you will find where you can query the database for a given Item. Put in a start time far enough in the past to catch all the data.
Beyond that you can use HowTo Change values in an rrd4j database as a template to write something in Java to do this for you.