Skip to content

Instantly share code, notes, and snippets.

@MahdadGhasemian
Last active May 24, 2025 21:21
Show Gist options
  • Save MahdadGhasemian/416476b536f9a1334382065a7c44b33c to your computer and use it in GitHub Desktop.
Save MahdadGhasemian/416476b536f9a1334382065a7c44b33c to your computer and use it in GitHub Desktop.
Steps to backup and restore Minio Buckets

Restore Backup with Minio (Minio <----> Local)

Instructions for restoring buckets using Minio mirror features.

Install Minio Client

Install Link install link

Linux AMD64 DEB:

wget https://dl.min.io/client/mc/release/linux-amd64/mcli_20240722200249.0.0_amd64.deb
sudo dpkg -i mcli_20240722200249.0.0_amd64.deb

Add minio server to minio alias:

mcli alias set myminio/ MINIO_SERVER_URL MINIO_ADMIN_USERNAME MINIO_ADMIN_PASSWORD

Commands:

List all contents of BUCKET_NAME

mcli ls myminio/BUCKET_NAME

Backup to local

mcli mirror myminio/BUCKET_NAME path-to-your-local-backup-folder/BUCKET_NAME --overwrite

Restore from local

mcli mirror path-to-your-local-backup-folder/BUCKET_NAME myminio/BUCKET_NAME --overwrite
@yazanstash-foodics
Copy link

Thank you for this β™₯️

@Gotoro
Copy link

Gotoro commented Apr 30, 2025

To anyone coming to this, this works with MinIO's mc utility too

@rbozan
Copy link

rbozan commented May 5, 2025

To anyone coming to this, this works with MinIO's mc utility too

Thanks for the info!

@dermodmaster
Copy link

To anyone coming to this, this works with MinIO's mc utility too

This saved some minutes of my lifetime lol. Thank you πŸ™πŸ»

@MahdadGhasemian
Copy link
Author

To anyone coming to this, this works with MinIO's mc utility too

Just to clarify for other: in the gist, I'm using mcli as a custom alias for MinIO's official command-line tool, which is actually mc.
So if you're following the steps, make sure you've installed MinIO's mc utitily, and either use mc directly or alias it as mcli like I did:

alias mcli='mc'

That way, the commands in the gist will work seamlessly.

Thanks again for the helpful comment! πŸ™πŸ»

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment