Simple script to backup your Pryv.io data
Prerequisites: Node
In your terminal, run the following commands:
git clone https://github.com/pryv/pryv-account-backup.git
to download the script
cd pryv-account-backup
to go in the script folder
npm install
to download required dependencies
npm start
to launch the backup script.
This will ask you for the service-info url, username and password of the Pryv account you wish to back up.
You can finally choose to backup also trashed data as well as attachment files.
Your data will be downloaded in ./backup/{apiEndpoint}/
This downloads the following in JSON format:
- Public profile
- Accesses
- Followed slices
- Streams
- Events
- Account Info
As well as the following in binary files:
- Attachment files
The operation might take a while in case the data size is substantial. Please, leave requests here
It is also possible use the backup function in your code.
Add the following to your package.json
: "pryv-backup":"git+ssh://git@github.com:pryv/pryv-account-backup.git"
then use it as following:
const backup = require('pryv-backup');
const settings = {
service: SERVICE_INFO_URL,
username: USERNAME
password: PASSWORD,
includeTrashed: true, // default: false
includeAttachments: true // default: false
};
settings.backupDirectory = new backup.Directory(apiEndPoint);
backup.start(settings, function (err) {
if (err) {
// manage error
}
// ...
});
## (Experimental) Restore Streams and Events to another account
npm start restore <path to backup dir>
Prerequisites: Node v8+
Install dependencies: npm install
Run tests: npm run test
MIT License as included