Migrating from MinIO to VersityGW
Note: Replace
poolnamein all commands with your customer ID. If you don’t have one yet, choose any name – we will rename the pool on import.
MinIO stores objects in its own format (xl.meta and part files). VersityGW cannot use this data directly. The buckets are therefore mirrored over S3 from MinIO to VersityGW. Both run side by side while your backups keep running.
If you create the S3 users with the same credentials, your backup software needs at most a new address afterwards.
Requirements
- VersityGW is installed according to the guide and runs on port 7070, MinIO stays on its port (usually 9000).
- There is enough free space on the pool: during the migration the data exists twice.
zfs list poolname
- The MinIO client mc and rclone (for verification) are installed, and you have the admin credentials of MinIO (
MINIO_ROOT_USER/MINIO_ROOT_PASSWORD) and VersityGW (ROOT_ACCESS_KEY_ID/ROOT_SECRET_ACCESS_KEY).
1. Take inventory
List buckets and users with the MinIO client mc:
mc alias set old http://127.0.0.1:9000 minio_admin minio_admin_password
mc ls old
mc admin user list old
mc du old --recursive
MinIO does not show the users’ secret keys. You will find them in the configuration of your backup software.
2. Create users in VersityGW
Create each user with the same access key and secret key:
versitygw admin -a vgw_admin_key -s vgw_admin_secret -er http://127.0.0.1:17070 create-user -a user_access_key_id -s user_secret_access_key -r userplus
3. Copy the buckets
Add the new server to mc and mirror all buckets:
mc alias set new http://127.0.0.1:7070 vgw_admin_key vgw_admin_secret
mc mirror --watch --remove --preserve old new
mc mirror first copies the existing data and then keeps running: new, changed and deleted objects are synchronised continuously. Your backups can keep running. --preserve keeps the metadata. Start the command in screen or tmux so it keeps running until the switch.
4. Verify
Set up rclone with both servers for verification:
rclone config create minio s3 provider Minio endpoint http://127.0.0.1:9000 access_key_id minio_admin secret_access_key minio_admin_password
rclone config create vgw s3 provider Other endpoint http://127.0.0.1:7070 region us-east-1 access_key_id vgw_admin_key secret_access_key vgw_admin_secret
rclone check minio: vgw: --download
--download compares the content of every file. Without it, large objects (multipart uploads) cannot be compared by checksum. The output must end with 0 differences found. If a backup is running at the time, single differences may show up; check again after the backup.
The objects are now plain files under /poolname/versitygw/buckets.
5. Set bucket owners
After copying, the buckets belong to the admin. Assign each bucket to the right user:
versitygw admin -a vgw_admin_key -s vgw_admin_secret -er http://127.0.0.1:17070 change-bucket-owner -b bucket_name -o user_access_key_id
versitygw admin -a vgw_admin_key -s vgw_admin_secret -er http://127.0.0.1:17070 list-buckets
6. Switch over
Switch between two backup runs, so no backup writes partly to MinIO and partly to VersityGW.
- Wait until the last backup has finished and
mc mirrorhas transferred everything. Then runrclone checkas in step 4. - Point your backup software to VersityGW: switch the reverse proxy to port 7070 or change the address in the software. Credentials stay the same, region
us-east-1. - Stop
mc mirrorwith Ctrl+C and stop MinIO:systemctl disable --now minio - Run a backup and use the software’s verify function, e.g.
restic check.
7. Clean up
Only after your backups have run without errors on VersityGW for a few days, delete the old MinIO data and uninstall MinIO.
What is not migrated
- Older object versions: mc mirror copies only the current version of each object. With us, older states are covered by the ZFS snapshots anyway.
- MinIO policies, object lock, lifecycle rules and bucket notifications must be set up again if needed.
More options in the mc documentation for mirror.