Search code examples
databasebackupparse-platformdatabase-backups

How to perform scheduled backups on parse.com?


Do you have any suggestions for backing up a parse.com database regularly?

Information about this are quite scarse, and I'd like to perform something similar to the manual export data function in the dashboard, but daily.

Does anyone have a script or something like this that they would like to share?

Parse said they were going to think about this feature but a year has passed.


Solution

  • To backup your Parse data, you simply would need to get all the records for every Parse Class that you have. For this example, I'll borrow from the Parse REST API documentation. Parse has SDK's for JavaScript, .NET, and iOS/OS X, all of which provide a similar functionality to what is described here.

    To get records from a Parse Class called 'GameScore', you could do something like:

    curl -X GET \
      -H "X-Parse-Application-Id: <YOUR APPLICATION ID>" \
      -H "X-Parse-REST-API-Key: <YOUR PARSE REST API KEY>" \
      -G \
      --data-urlencode 'limit=1000' \
      --data-urlencode 'skip=4000' \
      https://api.parse.com/1/classes/GameScore
    

    Here limit=1000 means you are going to get 1000 records at a time (the biggest amount possible), and skip=4000 means we want to skip the first 4000 records. Basically you would just repeat this command, starting with skip=0 and incrementing skip by 1000 every time until the number of records that comes back is less than 1000 (no more records left). Rinse and repeat for all of your Parse Classes and your data will be backed up.