If I use :GetDataStore() and then change it to :GetOrderedDataStore() later on, will the data stay the same?

The title is basically the question lmao

The data does not stay the same. Completely wipes the other data.

I don’t think it wipes the other data; it just gets it from a different datastore.

yeah i exxagerated a bit. im just trying to use :GetSortedAsync() but its too late to change now since all of my players data is going to be reset if i do

So you are trying to convert DataStore into OrderedDataStore?

yes, but im not sure if i really can because i use 1 datastore that has all the players data in a table, and i dont think :GetOrderedDataStore() supports tables/dictionaries as values

You could transfer the data with Open Cloud.

can i transfer tables to :GetOrderedDataStore() ?

1 Like

Yes, you can use Open Cloud to fetch data from the old non-ordered DS, then reupload it to a new ordered DS.

You could use DataStoreOptions to retrieve data fom DataStore to put into the OrderedDataStore.

local dataStoreOptions = Instance.new('DataStoreOptions')
local dataStore = dataStoreService:GetDataStore('dataStore', dataStoreOptions)

local orderedDataStore = dataStoreService:GetOrderedDataStore('dataStore', dataStoreOptions)

local success, pages = pcall(function()
	return dataStoreBadges:ListKeysAsync()
end)
-- Get datastore pages

while task.wait() do
	local Items = pages:GetCurrentPage()
		
	for _, Data in ipairs(Items) do
		orderedDataStore:SetAsync(Data.KeyName, Data)
	end
		
	if pages.IsFinished then break else pages:AdvanceToNextPageAsync() end
end
1 Like

I didn’t know that was a thing, apparently you don’t need Open Cloud to copy data between DataStores.

1 Like

Your data has dictionaries. Are you making a leaderboard that shows players’ points or something?

1 Like

@AlaTomKing @yname
ok guys all i really want to know is if its possible to transfer tables at this point, because i know how to transfer now, but the normal datastore has tables for every player, and im not sure if it will let me transfer.

1 Like

yeah

asldkjfa;lsdjf;alskdjfk;lasd

1 Like

You could make a new OrderedDataStore and only transfer the players’ points.

not sure how i can loop through every players stats, copy the points, format it so that its only a key and points, and then paste it into a new OrderedDataStore. might you know?

I’m not sure how your data is structured tho

local defaultData = {
	["Wins"] = 0,
	["Money"] = 0,
	["Trails"] = {},
}

And do you usually store them using the key of player’s UserId?

1 Like

yes

ajsk;ldf;alksdjf;lasjdk;lfajsl