Migrating existing Ban Datastore to the new Ban API

The official Ban API has been out for a while. I would like to apply it to my game which used Datastores as the ban system. However, I can not see how I can properly migrate it from the Datastore to the API, nor has anyone discussed this.

As it was officially mentioned:

I do know a way where I can list all pages of a Datastore. However given the number of bans are unknown, wouldn’t take days or even months to loop through all bans and transfer it to the ban API? Is there a more efficient way, or has anyone have already successfully migrated to the new API from a Datastore?

If you have an absurd amount of them, probably. you could use the datastore open cloud api to fetch all the pages and write the userids to a file, through some js script running on your computer in the background.

while possible to do so by fetching through a script inside studio, i fear you could possibly rate limit your game

Just adhere to the limits and you’ll be fine.

You can technically do it in studio if you’re more comfortable writing your migration in Luau, Studio has much higher limits than a live server. You can confirm this using DataStoreService:GetRequestBudgetForRequestType(). Just be careful of the throughput limits, which is limited to 25 MB/key across all servers.

I’m not too versed on the server limits for BanAsync, would do some research if I were you. I believe all limits are documented for Open Cloud APIs though.

1 Like