samply / blazectl

Control your FHIR® Server from the Command Line
Apache License 2.0
17 stars 5 forks source link

Implement Backup #8

Open alexanderkiel opened 4 years ago

alexanderkiel commented 4 years ago

The idea doesn't work, because referential integrity will most likely violated on restore. But I'll leave this here for possible improvements.

The idea is to implement a simple backup using the system history interaction.

Full Backup

A full backup can be obtained by paging through the whole output of the system history interaction. Such paging should be stable on a FHIR server. So no versions should be missing or duplicate.

Incremental Backups

After the first download of all versions, incremental backups are possible using the _since query parameter. The last seen versions timestamp can be obtained through response.lastModified.

Full Restore without History

The history bundles can be processed from the most recent to the least recent. For each entry:

Transaction bundles are then POST'ed to the server to restore. The result would be that all resources are restored but without any history.