Most of the migration is the same work applied to a different contract: different paths, different filter syntax, different idempotency scope. Update Ledger Clients covers that.
This page covers the Ledger 2.x capabilities that have no call-for-call equivalent. They fall into two groups:
- Replaced in Ledger 3.0: Ledger 3.0 provides the capability another way. The workflow keeps working once you move it to the replacement.
- What does not carry over: Ledger 3.0 does not provide the capability. A workflow that depends on one needs a design decision, not a new call site.
Check your workflow inventory against both lists before planning the client work. For the path of every other call, see the Endpoint Map.
The authoritative list lives with the code, in Missing Features and Intentionally Removed Features. This page carries the entries that reach an application client; that document also records contributor-facing gaps and the reasoning behind each removal.
Replaced in Ledger 3.0#
| Ledger 2.x | Ledger 3.0 replacement | What differs |
|---|---|---|
prefix= and reference= query parameters | filter=: address ^= "users:" textually, {"$match":{"address":"users:"}} structurally when the value ends with :, and {"$match":{"reference":"..."}} to select by reference | A request that still sends prefix= or reference= is not rejected; the parameter is ignored and the list is not narrowed |
GET /accounts/{address}/balances | GET /v3/{ledgerName}/accounts/{address}: the account carries volumes per (asset, color), balance included | No separate route |
GET /accounts/{address}/volumes | The same account read, or GET /v3/{ledgerName}/volumes with an account filter for aggregates | No separate route |
preCommitVolumes | postCommitVolumes, returned on every transaction in creates, reverts, reads, lists and prepared-query results. The pre-commit figure is postCommitVolumes minus the transaction's postings | There is no request flag to toggle volumes and no expandVolumes |
Account date fields firstUsage, insertionDate, updatedAt, returned on the account and usable in filters and pagination | A typed datetime account metadata key with an index, see below | Ledger 3.0 does not maintain the value: your application writes it. The account object is address, metadata, volumes, and no date condition is valid on the accounts query target |
Log import: POST /v2/{ledger}/logs/import, fctl ledger import | A mirror ledger, which follows a running Ledger 2.x and is promoted to a normal ledger at cutover | The import route exists and returns not-found |
Log export: POST /v2/{ledger}/logs/export | An event sink. A new sink replays every supported event still in the log, then follows new commits, to HTTP, Kafka, NATS, ClickHouse, or Databricks | Events cover ledgers, transactions and metadata, not configuration changes such as indexes or account types. The export route exists and returns not-found |
Buckets used to keep workloads apart: the bucket field on ledger creation | One ledger per workload, or one cluster where you need physical isolation, see Buckets | A bucket value sent on creation is ignored, not rejected. Every ledger in a cluster shares the cluster's storage |
Count endpoints: HEAD /v2/{ledger}/transactions and HEAD /v2/{ledger}/accounts, with the total in the Count header | GET /v3/{ledgerName}/stats returns the unfiltered transactionCount | There is no account count and no filtered count |
What does not carry over#
Ledger 3.0 does not provide these, and no other mechanism covers them.
| Ledger 2.x | Ledger 3.0 | What to do instead |
|---|---|---|
postCommitEffectiveVolumes, preCommitEffectiveVolumes | Not returned | Derive effective-date figures from transaction history |
/volumes point-in-time reads: startTime, endTime, insertionDate | Not accepted. Ledger 3.0 /volumes takes useMaxPrecision, groupByPrefixes and collapseColors | Nothing queries a stored historical balance projection. Derive the figure from transaction history, or stamp the value you need as metadata when it is produced |
dryRun on transaction creation and metadata writes | Not accepted | No way to evaluate a write without committing it |
metadataCount in ledger stats | Not returned | No replacement |
Per-ledger features on ledger creation (HASH_LOGS, MOVES_HISTORY…) | No equivalent field. POST /v3/{ledgerName} takes metadata, mode, mirrorSource, defaultEnforcementMode, initialSchema and accountTypes | The behaviors those toggles gated are not per-ledger options. For the integrity story, see Integrity |
Bucket delete and restore: DELETE /v2/_/buckets/{bucket}, POST /v2/_/buckets/{bucket}/restore | No bucket routes | Delete each ledger separately; a deleted ledger cannot be restored, see Buckets |
Three further changes are rewrites rather than removals, and are covered where you will meet them: bulk moves to /v3/{ledgerName}/bulk with a different failure model (Update bulk handling), Ledger Schema splits into separate resources, with transaction templates becoming programs in the Numscript library and query templates becoming prepared queries and indexes (Replace Ledger Schema workflows), and idempotency keys move to a cluster-wide namespace (Redesign idempotency keys).
Account date fields#
This is the removal most likely to be load-bearing, because the fields backed cohort queries, dormancy sweeps and date-ordered account pagination — and because the loss is silent: a Ledger 2.x filter on first_usage does not degrade, it fails.
Ledger 2.x maintained first_usage by lowering it on every write that touched the account. Ledger 3.0 does not return the account date fields. Typed metadata replaces them.
Reading#
Declare an account metadata key as datetime, which parses the RFC3339 value you write into signed int64 epoch microseconds. Create an account metadata index on that key, wait for it to report ready, then range-filter it:
filter=metadata[first_usage] >= 1704067200000000The operand is microseconds, not RFC3339
Metadata range operands are parsed as integers. RFC3339 coercion applies to the builtin date and timestamp fields, which are not valid on the accounts target at all. Declaring the key datetime governs how the stored value is read, not how the filter operand is written.
The same filter works on GET /v3/{ledgerName}/volumes, which compiles its filter for the accounts target. See Filters and Pagination and Indexes.
Writing#
There is no set-if-absent. Account metadata writes overwrite, and Numscript's set_account_meta has no conditional form, so a rule that stamps the key on every transaction records last usage rather than first.
To stamp once without a client-side read, send the opening transaction through the bulk endpoint with a per-address reference and the skip opt-in. skippableReasons sits on the entry, not inside data:
[ { "action": "CREATE_TRANSACTION", "skippableReasons": ["TRANSACTION_REFERENCE_CONFLICT"], "data": { "reference": "open:users:alice", "postings": [{ "source": "world", "destination": "users:alice", "asset": "USD/2", "amount": 100 }], "accountMetadata": { "users:alice": { "first_usage": "2024-01-01T00:00:00Z" } } } }]Reference uniqueness is arbitrated in consensus order, so every later attempt is skipped instead of overwriting. The unitary POST /v3/{ledgerName}/transactions deliberately does not expose the opt-in and answers 409 on the second attempt. The transaction must carry at least one posting, so this fits a ledger with a real opening transaction and is awkward where accounts appear implicitly.
Carrying the value across#
Copying the Ledger 2.x value into the typed metadata key at cutover is the only lossless option, and mirroring does not do it for you.
Reconstruction after the fact is possible, but it has to reproduce what the source actually means. Ledger 2.x lowers first_usage from two paths: the effective date of every transaction the account takes part in, and the log date of every account-metadata save. An account that only ever received metadata has a first_usage and no transaction behind it. So the equivalent is the minimum over both, per address, across the whole log.
A transaction-only scan is wrong
Scanning transactions alone returns a later date for any account given metadata before its first posting, and misses metadata-only accounts entirely. The same applies to shortcuts through per-log volume annotations: a backdated transaction against an already-materialized account lowers the source value without creating a new cell.
Buckets#
In Ledger 2.x, a bucket was a separate storage namespace in the PostgreSQL database, holding one or more ledgers. Teams used buckets to keep workloads apart in the database, and to delete or restore a group of ledgers as one unit. Ledger 3.0 does not have buckets, and nothing replaces the bucket delete and restore routes. POST /v3/{ledgerName} has no bucket field. A bucket value sent by a Ledger 2.x client is ignored, not rejected: the request returns 201 and the ledger is created in the shared cluster. Audit your ledger creation calls for a bucket value. Where Ledger 3.0 APIs still say "bucket", for example the gRPC BucketService or GET /v3/_/indexes?scope=bucket, it means the whole cluster, not a Ledger 2.x bucket.
What to do instead depends on what the bucket gave you:
| What the bucket gave you | Ledger 3.0 |
|---|---|
| Separate accounts, transactions, and metadata per workload | Create one ledger per workload. Each ledger has its own accounts, transactions, metadata, and indexes |
| Deleting a group of ledgers together | Delete each ledger with DELETE /v3/{ledgerName}. Each delete is a separate call, so deleting a group is not atomic. Deletion is permanent: unlike a Ledger 2.x bucket, a deleted ledger cannot be restored, and its name can never be reused |
| Physical separation: storage, capacity, backup and restore, upgrade timing | Run a separate cluster. Ledgers in one cluster share its storage, and backup and restore cover the whole cluster |
Idempotency keys are shared across ledgers
Separate ledgers in one cluster do not get separate idempotency namespaces. Keys are cluster-wide, so two workloads that reused the same key in different Ledger 2.x buckets now collide. Prefix keys with the workload or ledger name, as described in Redesign idempotency keys.
Before you plan the client work#
For each row above that your inventory hits, decide and record:
| Decision | Why it belongs in the migration record |
|---|---|
| Whether the workflow still needs the capability at all | Some Ledger 2.x reads exist because the field was there, not because a business process consumes it |
| The replacement, and who owns building it | A typed metadata key with a stamping rule is application work, not a client-library change |
| Whether historical values must survive the cutover | This is the only decision that expires: the source value is available until you stop writing to Ledger 2.x |
| The read path's index, and its readiness gate | A filter that needs an index fails until the index is ready, and readiness is per replica |
Carry these into the migration record described in Migration Overview, then return to Update Ledger Clients.