So basically, In a game I’m trying to fix, it has about 15 datastores for such small things that are still important to the game, such as points, hats, etc. However, how could I move all of the saved data from the roblox datastore to a single datastore solution such as ProfileService?
You can move it all to one data store without something like ProfileService.
ProfileService, and other data store modules, just simplify the data store process by handling things like request budgeting, BindToClose
, etc. If you are experienced enough, you could make your own module like this. It is extremely helpful when tailored to your game.
Storing different stats in different stores is not a great idea, it creates more opportunity for data loss and also can fill the data queue very fast. Instead, you should store a dictionary to the store. This way, you can simplify it all into one store - it’s so much more efficient.
Yes, of course. I did not make the game though. What I’m looking for is moving all the datastores to a single one. Just changing it won’t work because if you have a game with 3 million vists and 300 active players, you really don’t want to just wipe the data.
I’d say give it a window of time. Let your players know that after a certain date, data stores will be changed. Then, when saving data, not only save to your current stores but save your compressed version to a new store. Then, after that date, just stop using your old stores.
Ah, yes, I’ve had some experience with this scenario!
In a project I was working on, our approach was rather straightforward. When a player joined without an existing Profile, we began by checking if they had an old (unmigrated) datastore using migrated === nil || migrated === undefined
. If they didn’t migrate we then initiated the creation of a new Profile and copied data from the old datastore into this new Profile. Once this transfer was complete, we added/set the old datastore’s key as migrated = true
. From that point forward, we exclusively utilized the Profile for that specific user.
Then comes the question of how long do you want to support the old unmigrated data (it’s not hard at all, you just gotta let the script keep existing), I wanted to support it forever as to not punish anyone who did not play for a while, but people above me decided to only give player a 1 month window.
It’s simple, I’ve had this problem before. The best way is to slowly update the datastore whenever a player joins. Make a new datastore that’s if the player has had their datastore updated. If it isn’t updated, move the old data to the new one, and change it to true (updated). If it’s already updated then save to the new datastore.