Adjust encryption backup restore encrypted flag
PVince81 opened this issue · 1 comments
PVince81 commented
See https://github.com/owncloud/documentation/pull/2805/files
The part that says "set encrypted flag to 1" is wrong. I realized this later as we introduced the "encrypted signature version" security feature.
What the admin needs to do is find out what value the "encrypted" flag was in the backup's oc_filecache table and set that exact value to the filecache entry after restoring.
@settermjd can we adjust with higher priority as this could cause headaches for people who actually followed the old one ? (BadSignatureException)
PVince81 commented
Here are more detailed steps for an admin to restore an encrypted file "files/restorethis.txt" located in the storage of a user "user1":
- Find store numeric id in oc_storages (likely need other docs about this due to trickiness of said table: https://github.com/owncloud/core/wiki/Storage-IDs). Write down numeric id as
$storageNumericId
- In the real instance, find the oc_filecache entry of the file to restore:
SELECT * FROM oc_filecache WHERE path='files/restorethis.txt' AND storage=$storageNumericId
- Write down the real file id as
$realFileId
- Get hand on backup, which includes the data folder and database
- Find the file "data/user1/files/restorethis.txt" in the backup and copy it into the "data/user1/files/restorethis.txt" inside the real instance
- In the backup database, look at oc_filecache with
SELECT * FROM oc_filecache WHERE path='files/restorethis.txt' AND storage=$storageNumericId
(assuming the storage was still the same and the file was in the same location, else need to track down where the file was before) - Look at the integer value in the column "encrypted" from the result set, and write it down as
$encryptedVersion
- Update the real instance database with the found value:
UPDATE oc_filecache SET encrypted=$encryptedVersion WHERE fileid=$realFileId