Migrate primary storage from Swift to S3

I have Nextcloud installed with Swift as primary storage by following the documentation.

I’d like to migrate to S3.

Is it doable ?

I was thinking about cloning the swift bucket to S3 using rclone and editing the config.php file to use the S3 bucket instead.

Has anyone any experience in migrating the primary storage from Swift to S3 ?

I have used S3 configured as primary storage in the config.php and it sucks because every file that goes in the bucket is transformed into giberish and it is hard to transfer the data to another type of storage. What you can do is mount the S3 storage on your server and just give the path of the mounted S3 to the config.php so the files structures is more manageable.

You can mount the S3 bucket with s3fs.

My /etc/fstab to mount the bucket below.

s3fs#YOURBUCKETNAME /mnt/YOURDATADIR fuse _netdev,allow_other,passwd_file=/etc/passwd-s3fs,umask=0007,uid=33,gid=0,mp_umask=0097,nonempty,url="S3URL"/ 0 0

Do not forget to create the dir with mkdir /mnt/YOURDATADIR and also give the username and password of the bucket on a file /etc/passwd-s3fs