Upgrade to 0.25.0¶
0.25.0 changes how data is stored: all published data and revision records move into the lake catalog under lake/. The curated/ and derived/ folders and the pointers and receipts under meta/revisions/ are no longer used. An existing lake needs one run of cne upgrade --apply.
Who needs to upgrade¶
- Lakes created by 0.25.0: no upgrade.
- Lakes created by 0.24.0 or earlier: upgrade once.
- 0.25.x is the last series that upgrades these older lakes. Later releases do not recognize a lake from before 0.25.0; upgrade it with 0.25.x first.
- To check:
cne upgradelists the steps still owed, andcne checksays so in its verdict. - Until the upgrade: reads work as before; writes (daily runs, backfills, derives, repairs) are refused with a pointer to
cne upgrade.
Before you upgrade¶
- Stop everything that uses the lake: schedulers,
cne serve,cne mcp, running queries and scripts. The upgrade waits up to 30 seconds for reads in progress; if a process is still reading or writing, it stops, explains why, and changes nothing. - Back up the whole data root (
data_root):- The upgrade deletes the old layout (
curated/,derived/,meta/revisions/), and this cannot be undone. - The upgrade's own backup (
backups/upgrade-<time>/) holds the lake's records, not its data files. - Rolling back needs this full copy.
- The upgrade deletes the old layout (
- Disk space: on a filesystem with hard links, data files are linked into the lake catalog and take almost no extra space. Without hard links, room for one more copy of the data is needed. The
cne upgradepreview gives an estimate. - DuckDB extensions: the lake catalog needs DuckDB extensions, downloaded on first use. If the official extension site is unreachable, set
EQUITYLAKE_EXTENSION_DIR(a local folder) orEQUITYLAKE_EXTENSION_MIRROR(a mirror). - Old snapshots: 0.25.x can still verify and restore snapshots made by
cne snapshot createbefore 0.25.0; later releases cannot read them. To keep one, restore it with 0.25.x (cne snapshot restore), or create a new snapshot after the upgrade.
Steps¶
- Install 0.25.x:
python -m pip install -U "cnequity==0.25.*". - Check the config:
- A config that extends the built-in defaults (
extends = "builtin") needs no change. - For a fully expanded config, review
cne config upgrade --dry-run, then runcne config upgrade.
- A config that extends the built-in defaults (
- Preview:
cne upgrade. Review the migrations and the disk and extension checks. For anything markedBLOCKED, follow its message; nothing has been changed. - Upgrade:
cne upgrade --apply. It backs up the lake's records, then runs the migrations in order and reports progress. If it stops, fix the reported problem and run the same command again; it continues where it stopped. - Verify: run
cne status --datasetsandcne check, then check key results with your usual queries. - Resume: restart
cne serveandcne mcp, and re-enable scheduled jobs.
What the upgrade does¶
cne upgrade --apply runs these migrations in order and records each result in meta/lake.json:
lake-catalog: registers every published dataset in the lake catalog and switches over only after a row-by-row comparison matches.revision-records: imports the revision records into the lake catalog.legacy-datasets: publishes datasets that an old sample or demo lake stored without a revision.- Data repairs from 0.18.0–0.23.0: only those this lake has not run yet; some need network access.
attempts-ledger: imports the coverage records frommeta/state/into the coverage ledger.explicit-holds: releases holds that were derived from revision ids found in text files; holds fromcne storage holdand case dependencies stay.drop-generations(cannot be undone): deletes the old layout the lake catalog replaced; held revisions stay for now.archive-held-revisions: moves the revisions that are still held into the lake catalog and deletes their old folders once the rows match. They remain readable by revision id.meta-layout: moves what is left inmeta/state/into its own folders and retiresmeta/state/.
To preview a single migration: cne migrate --only <migration ID>.
Changes after the upgrade¶
- External tools that read files directly: stop reading
curated/andderived/. Use instead:cne storage export <datasets…> --out <folder>, which writes plain Parquet;cne query --sql …, Pythonload(), or MCP.
- Snapshots: can only be created on an upgraded lake. The incremental commands
cne snapshot delta create|verify|applyare removed. - Removed commands and options:
cne storage sync-catalog,cne storage merge-files,cne storage apply;cne repair layout,cne repair repartition;cne audit --research-universe; use--universe-profile.
- Holds: come only from
cne storage hold(optionally--until <date>) or case dependencies. A revision id appearing in a file no longer keeps that revision. - Python API:
load(universe="all_a")raises an error; useprofile="legacy_all_a".- The old universe-profile function names (
get_universe_profile,list_profiles,show_profile,profile_json) are removed; useresolve_universe_profile,list_universe_profilesandshow_universe_profile. revision_receiptfromload_with_receipt()anddataset_state()isNone; the revision number, revision id and content digest are unchanged.
meta/state/is retired: scripts that read it should usecne statusordataset_state().- Run status values:
warningis nowdegraded, andskipped_*is nowskippedwith a reason code. - Config keys that no longer have an effect:
publishunder[storage], andplannedandplanner_onlyunder[datasets]. Leaving them in the config only produces a warning.
If something goes wrong¶
- The preview shows
BLOCKED: provide the extension or disk space and run it again; nothing has been changed. - Another process is reading or writing the lake: stop
cne serve,cne mcp, queries or scheduled jobs and run it again; nothing has been changed. - A migration fails: the steps before it are complete and recorded. Fix the reported cause and run
cne upgrade --applyagain. - To roll back: install the previous release and restore the full pre-upgrade copy of the data. Restoring
backups/upgrade-*alone is not enough.