> ## Documentation Index
> Fetch the complete documentation index at: https://docs.vitasync.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Cloud backup

> The states your account moves through, and how two phones agree on a day.

Cloud backup is off until you turn it on. Once on, the phone keeps your account up to date in the background and reads back what other phones sent.

## The states

```mermaid theme={null}
stateDiagram-v2
  state "Local only" as LocalOnly
  state "Backing up" as BackingUp
  state "Linked to your email" as Linked
  state "Signed out" as SignedOut
  [*] --> LocalOnly: First launch
  LocalOnly --> BackingUp: Turn on cloud backup
  BackingUp --> Linked: Add your email and the six-digit code
  Linked --> SignedOut: Sign out
  SignedOut --> Linked: Sign in
  BackingUp --> LocalOnly: Turn off cloud backup
  Linked --> LocalOnly: Turn off cloud backup
  Linked --> [*]: Delete account and data
  LocalOnly : Nothing uploads. No account exists.
  BackingUp : Private account, no email yet. No restore without one.
  Linked : Restore on another phone works.
  SignedOut : Data stays on the phone. Uploads paused.
```

Turning backup on creates a private account with no email. Adding your email links it to that same account, so nothing is copied or lost in the move. Your email is how you get the backup back, not what switches uploading on. Those are two separate facts.

## How two phones agree on a day

Each phone sends only the fields it changed. Your account merges them field by field, so edits to different fields of the same day both survive.

```mermaid theme={null}
sequenceDiagram
  participant A as Phone A
  participant S as Your account
  participant B as Phone B
  A->>S: Tuesday: mood 7
  B->>S: Tuesday: steps 9,000
  Note over S: Merged per field
  S-->>A: Tuesday: mood 7, steps 9,000
  S-->>B: Tuesday: mood 7, steps 9,000
```

Two limits, stated plainly:

* **The same field on two phones: the last one to arrive wins.** There are no per-field timestamps.
* **Habits, goals, reminders and settings are one block.** They are kept as a unit, and the last phone to send them wins the whole block. Editing habits on two phones at once can lose one phone's change.

## Reading back

When you open the app, it asks your account for anything changed since it last looked. A day with an edit on this phone that has not gone up yet is skipped, because this phone holds something newer. It is fetched again once the edit has gone up.

## Restore is download first

A normal check-in with your account sends first and reads second. A restore does the reverse. On a fresh install, sending first would push this phone's empty defaults over your account. So a restore downloads the whole account first, and nothing uploads until that download has finished.

## Who owns the data on this phone

The first account to back up a phone's data owns it. Restoring a different account on that phone does not merge the two. The screen asks, and only an explicit replace moves the data across. Days logged before any backup existed have no owner and join freely.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.