Hello,
I can see the code snippet here Exporting data and backups — DatoCMS but I don’t actually know how to go about using this.
I’d like to take a backup of all of the data content in my project. Please can someone explain the steps?
Thank you!
Hello,
I can see the code snippet here Exporting data and backups — DatoCMS but I don’t actually know how to go about using this.
I’d like to take a backup of all of the data content in my project. Please can someone explain the steps?
Thank you!
It’s a NodeJS script @steven. Paste the code into a .js file (ie. run.js
), install the required dependencies which are datocms-client
and request
in this case with:
npm install --save datocms-client request
And then run the script with:
node run.js
Hi @s.verna, thank you!
That’s working perfectly
In the snippet, it references allPages
but looking at the records.json
file It appears to export all of the different models and not just pages
. Is that correct?
allPages
simply mean “paginate all the results, and get every record”
Thank you!
I don’t need to do a data restore, but is there a process for that also?
Of course it’s possible with our REST API, but it will be more complicated than a single generic script
Ok, thank you that’s good to know for the future!