You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using depot.io.boto3.S3Storage backend with buckets with Versioning disabled.
But on AWS to make an S3 backup, Versioning on bucket must be enabled.
Looking at the source of depot.io.boto3.S3Storage class:
the __save_file() method uses the Object.put() boto3 method which return the VersionId of the created file if Versioning is enabled, but put response is ignored;
the delete() method uses the Object.delete() boto3 method which deletes only the null version of the Object if exists, so trying to delete a versioned object, nothing will be deleted.
How can I use depot.io.boto3.S3Storage with Versioning enabled?
Thanks
The text was updated successfully, but these errors were encountered:
DEPOT is designed to keep its own transactional behaviour, so it never rewrites existing files. Any time you edit a file a new file with a different unique id is created. So every file would always only have one single version, making the versioning system pretty useless.
Using S3Storage with S3 versioning enabled shouldn't change much for DEPOT. It's true that when you issue a delete command the underlying file wouldn't be actually deleted. But a deletion market would be saved by S3 and thus from the external point of view the file would behave as it was deleted. It doesn't really get deleted because that's the whole concept of versioning. If you really deleted the file you wouldn't be able to move back to the previous version and thus restore the deleted file.
S3 versioning with DEPOT is mostly useless, but shouldn't impair the correct functioning of DEPOT. You will just end up with tons of historical versions around if you frequently modify depot managed attachments, but that's the whole purpose of versioning.
Also be aware that strictly speaking, S3 Versioning is not a backup mechanism. It wouldn't protect you from a bug or a person accidentally deleting all versions on an object.
Hi,
I'm using
depot.io.boto3.S3Storage
backend with buckets with Versioning disabled.But on AWS to make an S3 backup, Versioning on bucket must be enabled.
Looking at the source of
depot.io.boto3.S3Storage
class:__save_file()
method uses theObject.put()
boto3 method which return the VersionId of the created file if Versioning is enabled, butput
response is ignored;delete()
method uses theObject.delete()
boto3 method which deletes only thenull
version of the Object if exists, so trying to delete a versioned object, nothing will be deleted.How can I use
depot.io.boto3.S3Storage
with Versioning enabled?Thanks
The text was updated successfully, but these errors were encountered: