Player data operations: support, restores and erasure

Run player data support for a live Roblox game with Beacon Yard, from a lost-coins ticket through the Data Stores Manager, entry versions and a safe Lune restore tool, to right-to-erasure templates, the erasure webhook and the privacy rules for player data.

Concept lesson, about 70 minutes, 12 steps

By the end you can

  • Find a player's ProfileStore entry in the Data Stores Manager, read its version history and know which versions Roblox keeps
  • Restore lost progress with a Lune tool that merges an old revision into the current profile, refuses while a server holds it, and keeps the entry's users
  • Set up right-to-erasure deletion for every key named after a user, and handle the webhook for data the templates cannot reach
  • Decide what player data a game may keep, log and send off Roblox, and when to ask a professional

Before this: Safety and compliance: ratings, age checks, policies, ProfileStore: the library pros use, Ecosystem tools: Lune, darklua, roblox-ts, Deploying with Open Cloud: staging and production

Step 1 of 12

A lost-coins ticket

The message reads: "I had 240 coins yesterday and now I have 3. I didn't buy anything." Beacon Yard at m14-ship keeps everything a player owns in one ProfileStore profile: coins, speedOwned, legacyImported, onboardingStep and recentPurchaseIds. It lives in the data store BeaconYard_v2 under the key Player_<UserId>, wrapped in ProfileStore's envelope (Data for those fields, MetaData for ProfileStore's own bookkeeping).

Support work starts with evidence, not with a gift. Adding 237 coins from an admin command feels kind, but it hides whatever went wrong, and it pays out again for every player who learns the trick of asking.

Choose one

What should the person handling the ticket do first?

What should the person handling the ticket do first?

Press 1 to 4 to choose, Enter to check.

Link to this step · This confused me

Step 2 of 12

Find the key in the Data Stores Manager

The Data Stores Manager is in Creator Hub: pick the game, then Configurations, then Data stores manager. It lists your data stores with their size and key count. Select one to list its keys, filter them with a prefix that starts with the scope name (Beacon Yard uses the default scope, global), and open a key to see its value, metadata, version history, status and last update1.

Creator Hub (illustration)
Illustration with sample data, not a live Creator Hub capture: the Data Stores Manager with BeaconYard_v2 open, one Player key selected, its ProfileStore Data and MetaData objects, and two UTC-hour versions selected for Compare versions.

Select a numbered pin, or a row below, to read what it marks.

One profile entry, its ProfileStore envelope and its versions. Illustration with sample data, not a live Creator Hub capture.

Pick a version and press Compare versions to see it beside the current value. Revert writes a new version with the old value. The game owner has full access. In a group game, each role gets only what it needs: viewing the page, deleting keys, deleting whole data stores, or full access1. Give support staff the view role. Only the person who restores needs more.

Choose one

A new support volunteer joins Beacon Yard's group. They answer tickets and confirm what happened. Which Data Stores Manager access fits?

A new support volunteer joins Beacon Yard's group. They answer tickets and confirm what happened. Which Data Stores Manager access fits?

Press 1 to 4 to choose, Enter to check.

Link to this step · This confused me

Step 3 of 12

Which versions Roblox keeps

Versions are not a full history. Roblox makes a versioned backup from the first write to a key in each UTC hour, and later writes in the same hour overwrite it. So each hour keeps only the last value written in it. A backup expires 30 days after a newer write replaces it, and the latest version never expires2. ProfileStore saves while the player is online and when they leave, so one evening of play leaves one version per hour.

Here is the player's day, in UTC. Run it to see what survived.

Luau
Ctrl Enter runs the cell. Checked against the expected output
Work it out

The coins broke at 14:20. What is the highest coin value you can restore from these versions?

coins

For updates that change how data is saved, there is a stronger net: the Snapshot Data Stores Open Cloud API takes a snapshot of every data store in the game, once a day. Take one right before such an update ships, and nothing written before it can be overwritten by the update's bugs2.

Link to this step · This confused me

Step 4 of 12

Why a whole revert is the wrong fix

Revert puts back the whole entry: every field of Data, and ProfileStore's MetaData too. For a profile, that takes things away.

  • A Speed upgrade bought after 13:55 disappears.
  • Purchase ids recorded after 13:55 leave recentPurchaseIds, the list that stops a redelivered receipt from paying twice.
  • If the old version predates the import of the player's BeaconYard_v1 record, legacyImported goes back to false, and the next session imports those old coins a second time.
  • The old MetaData may still name a server session that ended long ago.

Stored dataRemember: Session lock is the vault sign-out sheet: Server A has this account, signed at 14:02.

The restore has a second trap. ProfileStore's sign-out sheet is MetaData.ActiveSession: it holds a table while a server has the profile, and it is empty once the session ends. If a tool writes the entry while the player is still in a server, that server's next save overwrites the restore with the broken values it holds in memory.

Where does it break?“The vault sign-out sheet: Server A has this account, signed at 14:02” is a good picture of session lock. Where does it stop being true?

It breaks here. Nobody enforces the sheet; it only works because every server that touches the key checks it, and an unrenewed lock looks expired.

The true model. A session lock records which server holds a player's data so two servers do not write it at once. Beacon Yard's hand-rolled lock expires after 45 seconds so a crashed server cannot hold a key forever. ProfileStore renews its lock with an autosave every 300 seconds.

Choose one

Your Lune tool writes the restored profile through Open Cloud while the player is still playing. What stops the write?

Your Lune tool writes the restored profile through Open Cloud while the player is still playing. What stops the write?

Press 1 to 4 to choose, Enter to check.

Link to this step · This confused me

Step 5 of 12

A restore tool that merges

The safe restore is a merge, done only while no server holds the profile. Keep the higher coins, keep Speed if either copy has it, keep legacyImported if either is true, keep the furthest onboarding step, and keep every purchase id from both copies, each once, at most 50. Those rules are pure functions, so they live in the challenge file challenges/work/data_ops.luau and the tool requires the same module.

The Open Cloud data stores API has what the tool needs3:

StepRequestScope
List revisionsGET .../entries/Player_<id>:listRevisionsuniverse-datastores.versions:list
Read an old revisionGET .../entries/Player_<id>@<revisionId>universe-datastores.objects:read
Write the mergePATCH .../entries/Player_<id>universe-datastores.objects:update

Two details from the reference matter. A PATCH replaces the whole entry: if you leave out users or attributes, they are cleared, so send back the ones you read. And send the etag you read, so a write that raced yours fails instead of being overwritten3. The users list is where DataService tags the entry with the player when their session starts:

	session:AddUserId(player.UserId)
	session:Reconcile()
luau
-- tools/restore.luau
--   lune run tools/restore list 12345 2026-11-20T14:20:00Z
--   lune run tools/restore apply 12345 <revisionId>
local net = require("@lune/net")
local process = require("@lune/process")
local serde = require("@lune/serde")
local DataOps = require("../challenges/work/data_ops")
 
local apiKey = process.env.ROBLOX_API_KEY
local universeId = process.env.ROBLOX_UNIVERSE_ID
assert(apiKey and universeId, "Set ROBLOX_API_KEY and ROBLOX_UNIVERSE_ID first.")
local command, userId, arg = process.args[1], process.args[2], process.args[3]
assert(tonumber(userId) and arg, "Usage: list <userId> <incident> | apply <userId> <revisionId>")
 
local entry = "https://apis.roblox.com/cloud/v2/universes/" .. universeId
	.. "/data-stores/BeaconYard_v2/entries/Player_" .. userId
 
local function call(method: string, url: string, body: any?)
	local response = net.request({
		url = url,
		method = method,
		headers = { ["x-api-key"] = apiKey, ["content-type"] = "application/json" },
		body = if body then serde.encode("json", body) else nil,
	})
	assert(response.ok, "HTTP " .. response.statusCode .. ": " .. response.body)
	return serde.decode("json", response.body)
end
 
if command == "list" then
	local revisions = call("GET", entry .. ":listRevisions?maxPageSize=100").dataStoreEntries or {}
	for _, r in revisions do
		print(r.revisionCreateTime, r.revisionId, r.state)
	end
	print("Restore from:", DataOps.pickRevision(revisions, arg) or "nothing before the incident")
elseif command == "apply" then
	local current = call("GET", entry)
	assert(DataOps.canWrite(current.value), "A server holds this profile. Ask the player to leave, then retry.")
	local old = call("GET", entry .. "@" .. arg)
	local value = table.clone(current.value)
	value.Data = DataOps.restoredData(current.value.Data, old.value.Data)
	call("PATCH", entry, {
		value = value,
		users = current.users,
		attributes = current.attributes,
		etag = current.etag,
	})
	print("Restored: " .. value.Data.coins .. " coins")
end
Choose one

A teammate trims the PATCH body to just { value = value }. What changes for Beacon Yard?

A teammate trims the PATCH body to just { value = value }. What changes for Beacon Yard?

Press 1 to 4 to choose, Enter to check.

Link to this step · This confused me

Step 6 of 12

Right to erasure: delete what is theirs

The opposite ticket also comes. Privacy laws give people a right to be forgotten: when someone asks Roblox to delete their account, Roblox notifies the creators of games they played, so those creators can delete personal data they no longer need4. Roblox's docs treat data broadly: if a piece of data can be traced back to a user, it may be personal data, and they give user ids as an example45. Roblox sends you a message each day listing the requests that need action, and you stay responsible for deleting everything they cover.

Deletion templates do most of it for you. You list where user data lives with a {UserId} token, and when Roblox processes a request it deletes the matching keys. A game can have up to 100 templates. The user id must be part of the data store name, key or scope, in a fixed pattern, in a standard or an ordered data store. The token is case-sensitive, and the scope defaults to global. Set them up in the Data Stores Manager's RTBF Deletion tab, or with the Configs API6.

Where an erasure request reachesAn erasure request box on the left splits into two paths: Roblox's deletion templates remove the three keys named after the user, and your webhook removes the r_ receipt rows that templates cannot match.Erasure requestone UserIdTemplatesRoblox deletesYour webhookyou deleteThree keysnamed after the userr_ rowsPlayerId in value
Templates match key names; anything else is your webhook's job.
Choose all that apply

Which Beacon Yard keys can a deletion template reach?

Which Beacon Yard keys can a deletion template reach?

Press 1 to 4 to choose, Enter to check.

Link to this step · This confused me

Step 7 of 12

The erasure webhook, for what templates miss

For data a template cannot match, add a webhook: Configurations, then Webhooks, with the Right to Erasure Request trigger. Roblox posts JSON with NotificationId, EventType (RightToErasureRequest), EventTime and an EventPayload holding the UserId and GameIds, the start place ids of the games involved75. Your endpoint must answer with a 2xx within 5 seconds, Roblox retries a failed delivery 5 times, and the same NotificationId twice is a duplicate. With a secret set, verify the roblox-signature header first and reject old timestamps; Roblox's sample uses a 300-second window7.

Beacon Yard's handler deletes the user's r_ rows. The checks before it are pure, so run them here:

Luau
Ctrl Enter runs the cell. Checked against the expected output
Choose one

Your endpoint took 7 seconds to delete the rows, so Roblox sent the same notification again. What should the second delivery do?

Your endpoint took 7 seconds to delete the rows, so Roblox sent the same notification again. What should the second delivery do?

Press 1 to 4 to choose, Enter to check.

Link to this step · This confused me

Step 8 of 12

What you may keep, log and send

This section is not legal advice. Privacy law differs by country, and children's data gets extra protection in many places. If your game will store anything beyond gameplay data, ask a professional before you build it. What follows is what Roblox's own rules say, and what a careful team does anyway.

  • Collect only gameplay data. Beacon Yard's profile holds coins, an upgrade, a flag, a funnel step and purchase ids. Nothing in it describes the person.
  • Never ask players for personal information. Depending on their age, users may be barred from sharing or requesting email addresses, phone numbers, home addresses, full names, passwords and handles outside Roblox, so a game must not ask8.
  • No profiles for advertisers. You may not share personally identifiable engagement data with advertisers, build personalized activity profiles of users, or personalize ads for anyone under 188.
  • Logs are data too. A strike log or support note that holds a user id is personal data that an erasure request covers. Keep chat text, display names and free-form notes about a person out of logs, and delete old logs on a schedule.
  • Data you send off Roblox is still yours to delete. A round summary posted to your own server keeps the same duty: send only what you need, and delete it when an erasure request arrives4.
Choose all that apply

Which may go into Beacon Yard's support log for the lost-coins ticket?

Which may go into Beacon Yard's support log for the lost-coins ticket?

Press 1 to 4 to choose, Enter to check.

Link to this step · This confused me

Step 9 of 12

Which restore, when

Other ways pros do this

OptionWhat it isWhen pros pick itTrade-offs
Data Stores Manager RevertWrites an old version of the whole entry back as a new version.Simple records with one field, or a whole store you broke in one update.Puts back every field, including ProfileStore's MetaData; no merge, no live-session check.
Open Cloud restore toolA Lune or Node script that reads a revision and writes a merge.Profiles, repeat tickets, anything a second person should be able to run the same way.You must check ActiveSession, send back users and attributes, and guard the API key.
ProfileStore MessageAsyncSends a message to the profile, which the session owner handles in game code.Changes for a player who is online, such as a refund or a support grant.You write and test a handler; nothing happens until a server loads the profile.
ProfileStore VersionQuery in a serverReads past versions of a profile from Luau.An in-game admin panel that lists a player's history.Runs inside a live server, so admin checks and audit logs are on you.
Choose one

Twelve lost-coins tickets arrive within an hour of an update. What does a professional team do?

Twelve lost-coins tickets arrive within an hour of an update. What does a professional team do?

Press 1 to 4 to choose, Enter to check.

Link to this step · This confused me

Step 10 of 12

Build along: restore and erasure for your test experience

Use your own published test copy of Beacon Yard and your own account only. Never practise a restore on a real player's data.

Build along

m14-ship

  • challenges/work/data_ops.luau
  • tools/restore.luau
  1. Make challenges/work/data_ops.luau pass first: play, then run game.ServerScriptService.RunGameTests:Invoke("player-data-ops", "player-data-ops-tools") in the server command bar.

    You should see The player-data-ops test prints TEST PASS for all 25 checks and a pass code.

  2. Play the published test experience, collect some coins and leave. Play again in the next UTC hour and leave again. Open Configurations, Data stores manager, BeaconYard_v2, find your key, and compare the two versions.

    You should see The Data Stores Manager shows Player_ followed by your user id in BeaconYard_v2, with at least two versions to compare.

  3. In the RTBF Deletion tab, create a Standard Key template for BeaconYard_v2 with the key pattern Player_{UserId}, a Standard Key template for BeaconYard_v1 with {UserId}, and an Ordered Key template for BeaconYard_BestMatch with {UserId}, each in the global scope.

    You should see The RTBF Deletion tab lists three templates whose sample output shows your patterns with a user id in place of the token.

  4. Create an API key with only universe-datastores.versions:list, universe-datastores.objects:read and universe-datastores.objects:update on the test experience. Save the tool as tools/restore.luau, set ROBLOX_API_KEY and ROBLOX_UNIVERSE_ID, run list with your id and a time, then apply once while you are playing and once after you leave.

    You should see list prints your revisions and a revision id to restore from; apply refuses while you are in a server and restores after you leave.

Link to this step · This confused me

Step 11 of 12

Challenges

Level 3, Professional

Challenge

Fix challenges/work/data_ops.luau so the restore and erasure rules in this lesson hold. The test is challenges/player-data-ops.luau and the written solution is challenges/solutions/player-data-ops.md. It touches no data store.

Start from
The game at milestone m14 (download)
Grade it
In Studio, press Play, then run game.ServerScriptService.RunGameTests:Invoke("player-data-ops", "player-data-ops-tools") in the server command bar. Copy the pass code from Output.

Done means

  • pickRevision returns the newest revision strictly before the incident that is not DELETED, from a list in any order
  • restoredData keeps the higher coins, Speed if either copy owns it, legacyImported if either is true, the furthest onboarding step and every purchase id once (at most 50, newest kept), without changing its inputs
  • canWrite refuses while MetaData.ActiveSession is a table and refuses a missing entry
  • rtbfTemplates covers Player_{UserId}, {UserId} and the ordered {UserId} leaderboard; receiptRowBelongs reads PlayerId; parseErasure checks the type, the id and the start places
  • challenges/player-data-ops.luau prints TEST PASS for every check

The Course Runner prints this code when the test passes.

Level 2, Builder

Challenge

Write Beacon Yard's player data runbook and data map in your copy's docs/ folder. This is a self-check; no test grades it.

Start from
The game at milestone m14 (download)

Done means

  • A one-page support runbook: how to find the key, which versions exist, when to restore, when to escalate to an incident, and what goes in the ticket log
  • A data map listing every place Beacon Yard stores data about a player (three template keys, the r_ rows, any logs or backend copies) and how each one is erased
  • An end-to-end erasure test plan on a test game with a dummy account, as the RTBF docs suggest, with the date to check the result
  • The runbook says plainly that it is not legal advice and names who on the team decides legal questions

Meet the criteria above, then record your own result. No test grades this check.

Choose one

Beacon Yard's erasure webhook was down for a week, and several requests were missed. The templates still ran. What is left to delete?

Beacon Yard's erasure webhook was down for a week, and several requests were missed. The templates still ran. What is left to delete?

Press 1 to 4 to choose, Enter to check.

Link to this step · This confused me

Step 12 of 12

Recap

Recap

  1. A lost-coins ticket starts in the Data Stores Manager: find Player_<UserId> in BeaconYard_v2 and read its versions. Roblox keeps the last write of each UTC hour, for 30 days after it is replaced.
  2. Restore by merging, never by reverting a whole profile: higher coins, everything bought since, legacyImported kept, purchase ids kept. Refuse while MetaData.ActiveSession is set, and send back users, attributes and the etag.
  3. Deletion templates erase every key named after a user (Player_{UserId}, {UserId}, the ordered {UserId}); the r_ rows need the erasure webhook or a sweep, and the daily message is your checklist.
  4. Collect only gameplay data, never ask for personal information, keep names and chat out of logs, and get professional advice before storing more. This lesson is not legal advice.

Session lock is the vault sign-out sheet: Server A has this account, signed at 14:02, until nobody enforces the sheet; it only works because every server that touches the key checks it, and an unrenewed lock looks expired.

Next Localization: reaching other languages

Link to this step · This confused me