ioBroker.js-controller
ioBroker.js-controller copied to clipboard
Question: Why saves iob backup ID values contents double in "value" and "doc"?
In the backup.json there is for each ID the object "value" and object "doc" with the same Content? Is it possible to save storage space? Or is there an special reason for that saving? https://forum.iobroker.net/topic/27267/test-adapter-iobroker-backitup-v2-4-x/1956
The content is not alwys the same ... but in fact I would say "this is historic" ... exact reasons would need to be deeply checked ... yes could save some megabytes :-)
It is the result from a getObjectList
call and yes it should be 100 % identical https://github.com/ioBroker/ioBroker.js-controller/blob/128e8b10f7b78bc7142a708d467270b661cdf15a/packages/db-objects-redis/src/lib/objects/objectsInRedisClient.ts#L4434 probably only there for backward compatibility.
On a first look restore only uses doc
, thus we could get rid of saving value
without breaking backward compatibility.
https://github.com/ioBroker/ioBroker.js-controller/blob/128e8b10f7b78bc7142a708d467270b661cdf15a/packages/controller/lib/setup/setupBackup.js#L482
Edit: no here value is used too https://github.com/ioBroker/ioBroker.js-controller/blob/128e8b10f7b78bc7142a708d467270b661cdf15a/packages/controller/lib/setup/setupBackup.js#L803
So first step would be to harmonize to use either doc
or value
in restore so we can later on remove it from the backup creation process.
But maybe rewritable to use doc too?
But maybe rewritable to use doc too?
Yes, but then we cannot remove it from backup creation process yet without breaking backward compatibility, see my latest edit.