Skip to content

Cloud Sync

errorfg edited this page Nov 3, 2026 · 3 revisions

English | 中文

Cloud sync

Syncs settings, local favorites, browsing history and reading progress between devices. There are three ways:

Way What you need Where the data is
S3-compatible storage (Cloudflare R2 included) a bucket and its access keys records/v1/ in the bucket
WebDAV (Jianguoyun, for example) a WebDAV account records/v1/ under the remote path
Sync server (database) a Cloudflare Worker and D1 database you deploy, see Sync service the D1 database

Every device should use the same way. The three do not share data.

Since 8.2.0 the three follow the same rules: one record per item, the later change wins, and deletions reach other devices. Every syncing device needs 8.2.0 or later: on S3 and WebDAV old and new versions do not receive each other's changes, and on the sync server part of the data no longer crosses over, see the next section.

Upgrading from 8.1.1 or earlier

S3 and WebDAV:

  1. Before upgrading, sync once on each old device, so that what has not been uploaded gets there.
  2. Upgrade one device at a time. The first device of the new version to sync takes over the old files (latest.json and the op packs) once and writes them to records/v1/; later devices do not read the old files.
  3. After that, the new version does not receive what old versions write, nor the old versions what the new version writes. Old devices can keep syncing among themselves in the old files, which stay in place and which the new version no longer writes.
  4. When another device joins later, its first sync treats data without a modification time of its own (settings, quick searches, search history, block rules, extension repositories) as additions only: it fills in what the records lack and overwrites nothing. History, reading progress, favorites and source settings are compared by time as usual.

Sync server: the server does not need redeploying. Browsing history, Tachiyomi extension repositories and source settings use new record types: the first time a device takes them, it takes over once what 8.1.1 and earlier wrote, except deletions of history; what old versions write later is not merged.

Reading progress and double pages: E-Hentai, nhentai and wnacg now keep them per site (eh:123, nh:123), so old versions cannot read progress saved by the new version. Records old versions saved under the bare number stay, as a fallback when a gallery has no new record.

No going straight back to an old version: the database moves to version 26, with the history and download rows of nhentai and wnacg in number ranges of their own (folder names do not change). If you install an old version over it, downloaded nhentai and wnacg galleries no longer find their folders. If you want the option of going back, back up the app's data before upgrading.

Opening the settings

Setting → Advanced → Cloud Sync Settings (named WebDAV/S3 Sync Settings before 8.0.37).

  • The other options show once Enable Sync is on.
  • In Sync Provider, choose S3-Compatible Storage, WebDAV or Sync server (database).
  • Fields save themselves about half a second after you stop typing; there is no save button.
  • Tap Test Connection and wait for "Connection Successful" before syncing.

S3-compatible storage

Setting What goes there
Endpoint The host name only, without https://. For Cloudflare R2: <account id>.r2.cloudflarestorage.com.
Access Key, Secret Key The access keys of the bucket.
Bucket Name jhentai-sync by default. Create the bucket first.
Region auto for Cloudflare R2 (the default); otherwise the bucket's region.
Object Key Prefix Optional, e.g. jhentai-sync/; a trailing / is added. Keeps the app's files apart from the rest of the bucket.
Use SSL On by default.

With Cloudflare R2: create a bucket in R2, then an API token with read and write access to it, which gives the Access Key ID and Secret Access Key; the account id for the endpoint is on the R2 overview page.

Test Connection checks that the bucket exists.

WebDAV

Setting What goes there
Server URL https://dav.jianguoyun.com/dav/ (Jianguoyun) by default.
Username Required.
Password For Jianguoyun, the app password created for third-party apps, not the login password.
Remote Path /JHenTaiConfig by default. No trailing /. The folder is created if missing.

Test Connection only checks that the server answers, not that the remote path can be written; the first successful sync confirms it.

What is synced

Sync Now lets you pick the types, all checked by default; automatic syncs always sync every type.

Type Contents
Read Progress Reading progress of every source, Komga included.
Quick Search, Search History The merged search history keeps at most 50 entries.
Block Rules Synced by rule group; a group is changed and removed as a whole.
Gallery History Galleries of the same number on E-Hentai, nhentai and wnacg are kept apart.
nhentai Favorites, wnacg Favorites, JM Favorites, Tachiyomi Favorites Favorites kept on the device.
Watched progress What was read in the watched list, bookmarks and where you left off.
Sync settings The sync settings themselves, storage credentials included; the provider and switches are not part of it.
Komga server Server URL, username, password and API key.
nhentai API Key
Telegraph bot The eh2telegraph address and token.
JM account
E-Hentai account The account and the cookies that belong to it; each device fetches its own igneous.
Tachiyomi extension repositories The added extension repositories. Which extensions are installed is each device's own; sync neither installs nor removes them. See Tachiyomi extensions.
Tachiyomi source settings (may include logins) Each extension's settings. Before synced settings first replace different ones on a device, that device keeps a copy; Restore the settings this device had on that source's settings page brings it back.

Not synced: the source chosen, the JM lines, the nhentai and wnacg domains.

When sync runs

With Auto Sync on Startup on, sync also runs by itself:

  • when the app starts;
  • when the app comes back to the foreground: a full sync if the last one was more than 30 seconds ago, otherwise reading progress only;
  • after every 5 new history entries;
  • reading progress when the reader closes;
  • when logging in to or out of nhentai or JM;
  • after the watched list has changes and is left alone for about 30 seconds, watched progress is synced.

By hand:

  • Sync Now, with a choice of types;
  • tapping the title of any site's home page syncs everything and shows a progress bar under it.

One sync runs at a time, for at most 15 minutes. A failed automatic sync shows no message, only a log entry; use a manual sync to check.

How data is merged

  • When both devices changed the same item, the later change wins.
  • Deletions are synced. Unfavoriting, removing history, and removing a quick search or a block rule group reach other devices. Up to 8.1.1, S3 and WebDAV did not carry deletions.
  • On S3 and WebDAV only a 404 counts as no file; any other error fails the sync without overwriting the remote data.
  • When there is no remote data, the sync counts as the first one and uploads this device's data.
  • The provider, Enable Sync and Auto Sync on Startup are each device's own and are not changed by another device's sync settings (before 8.0.37 they travelled with "syncSetting").

Files on S3 and WebDAV

The data is in records/v1/. Please do not edit it by hand:

  • manifest.json: the manifest, which also notes the device that took over the old files;
  • packs/<device>/: the record packs of each device; a device writes only its own;
  • snapshots/: written once there are more than 200 packs, deletions included; packs are removed only when a snapshot holds them and they were uploaded over 7 days ago;
  • backups/: history versions.

History versions (S3 and WebDAV)

With Enable History (in History Version Settings), a sync keeps a dated copy in records/v1/backups/ when the settings-type data changed; history, reading progress and watched progress are not in it. Max Versions is 10 by default and Auto Cleanup is on; View History restores or deletes a version, including those saved by 8.1.1 and earlier.

After a restore, the next completed sync treats the restored types as changed on this device just now: what the version holds wins over deletions from other devices, and what it does not hold is deleted.

Sync server

  • Data is stored item by item in a database; each sync transfers only what other devices wrote since.
  • Deletions (unfavoriting, removing history) reach other devices; for the same item the later change wins.
  • Deployment: see Sync service. In the app, choose Sync server (database), fill in Server address and Token, then tap Test Connection.
  • After switching from the sync server back to S3 or WebDAV, the first sync uploads everything once.

Export and import

Setting → Advanced → Export Data saves the items you pick as JHenTaiConfig-<time>.json; Import Data reads such a file. The file contains the credentials of sync and of your accounts, so keep it safe.

Common errors

Message Cause and what to do
Connection Failed Wrong address, keys, bucket name, or no network. An S3 endpoint has no https://.
Sync Failed: Sync already in progress Another sync is running; wait for it.
Sync Failed: Sync timed out after 15 minutes Slow network or much data; retry on another network.
Sync Failed: …Remote config exists but could not be downloaded The remote file is there but could not be downloaded, usually a network or permission problem. The sync stopped and the remote file was not overwritten.
Sync Failed: WebDAV server URL and username are required The WebDAV server URL or username is empty.

Clone this wiki locally