Migration of S3 bucket using tools such as s3cmd and rclone

I am planning to migrate a deployment that relies on a storage backend of S3.

Although, as I understand, S3 as primary storage is a case still not supported officially, I have been generally satisfied.

To be completely clear, the deployment scenario is that the local file system is not used for storage of user files, and also, no S3 storage is designated as external storage. Rather, the primary storage is maintained via S3, and files stored as such are presented to users exactly as normally would be presented to users the files stored in the local file system. Access details for the S3 bucket are provided in the main configuration file, under the field objectstore.

I wish for a means of verifying that migration has been completed seamlessly, including of identifying any missteps, that could cause loss of data, before the data is actually lost.

Generally, the current state of a Nextcloud deployment is represented by three different loci of data, which must be maintained in a state of mutual consistency. First are the application files served and executed by the web server, generally placed in a location designated as public by the web server. Second are the data files, referenced in the configuration as datadirectory, that are subject to manipulation by the application through its operations, but are not served by the web server. Third is the database, generally managed by MySQL/MariaDB, which may be cloned through serialization to a file.

Generally, it is quite feasible, in undertaking a migration, to copy each such loci of data to a new destination, as an identical clone, while completely preserving the original, which may needed for fallback.

S3 storage adds additional complexity.

I have been advised that buckets may be replicated using tools such s3cmd and rclone, but my knowledge of Nextcloud and S3 is too limited to understand the means of performing or verifying an exact copy of the contents of one bucket to a new, empty bucket.

Ideally, a new bucket could be validated as an exact drop-in replacement, before being used by Nextcloud.