---
title: "Data, backups, and sync"
description: "Manage local database snapshots and sync them to another device with WebDAV or S3/R2."
version: "en"
---

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

# Data, backups, and sync

Connections, MCP servers, skill repositories, settings, and some usage data live
in the local OcHub database. Remote sync uploads the database and managed-skill
snapshot; it does not copy every AI tool's full live configuration directory.

## Local data directory

The default data directory is `~/.ochub/`. It contains the database, backups,
and managed skills. Change it under **Settings → Data and backups**.

Restart after changing it so the UI and background services open the same
location. Restoring the default only removes the path override; it does not
merge two directories.

## Automatic backups

Under Data and backups, configure:

- **Automatic backup interval**: how often to create a local database snapshot.
- **Backups to keep**: older snapshots beyond this limit are pruned.

Use a shorter interval while frequently changing connections or sync settings.
Lower retention when disk space is limited.

## Manual backup and restore

Open **Advanced tools → Database backups**:

1. Select **Create backup**.
2. Rename the snapshot to record its purpose and date.
3. Before restoring, verify the name. OcHub first makes a safety backup of the
   current database.
4. Restart and inspect connections, MCP, skills, and settings after restoration.

Deleting a backup cannot be undone. Keep at least one verified copy outside the
active OcHub data directory.

## Choose a remote target

OcHub supports WebDAV and S3-compatible storage. A saved configuration should
use one target. If both are detected as enabled, the page infers the current
one from the most recent sync; verify it before saving.

### WebDAV

Enter the WebDAV URL, username, and password. The URL must start with `http://`
or `https://`.

### S3 / R2

Enter Access Key ID, Secret Access Key, Region, and Bucket. AWS S3 can leave a
custom Endpoint empty. Cloudflare R2 normally uses its supplied Endpoint and
the region `auto`.

Both targets also have:

- **Profile**: a logical name under one remote directory; default `default`.
- **Remote directory**: the snapshot root; default `ochub-sync`.

Devices must use the same target, remote directory, and profile to share data.

## Test, save, and upload

1. Enter connection information.
2. Select **Test**. A test does not save the fields you just entered.
3. Select **Save** at the bottom of the page.
4. After saving, select **Upload local snapshot**.
5. Check the most recent sync time and error status.

With Automatic sync enabled, database changes queue an upload. This is not
real-time bidirectional merging: simultaneous edits on multiple devices can
cause the later snapshot to overwrite the earlier one.

## Restore from remote

Restore from remote downloads a snapshot and replaces the local database:

1. Stop making changes on other devices.
2. Verify the target, profile, and last sync time.
3. Confirm the restore.
4. OcHub backs up local data before replacing it.
5. Restart and inspect critical configuration.

If the remote restore fails after the safety backup was created, fix the
connection instead of repeatedly starting another restore.

## Import from cc-switch again

Use **Settings → Data and backups → Import from cc-switch** to rerun migration.
Records with the same ID are replaced by the cc-switch version, and OcHub makes
a database snapshot first. It reads `~/.cc-switch/` without changing cc-switch.

See [Migrate from cc-switch](/guides/migration) for first-time migration,
collision rules, staged verification, and rollback.

Source: https://docs.ochub.org/advanced/data-sync/index.mdx
