HDD-Housing e.U.

Migrating from MinIO to VersityGW

Note: Replace poolname in 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

zfs list poolname

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.

  1. Wait until the last backup has finished and mc mirror has transferred everything. Then run rclone check as in step 4.
  2. 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.
  3. Stop mc mirror with Ctrl+C and stop MinIO: systemctl disable --now minio
  4. 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

More options in the mc documentation for mirror.