main 7ab9936

Export World of Warcraft: Forever client data (DB2 tables and hotfixes) from a local install into SQLite

forever-db

forever-db exports the game data of a local World of Warcraft: Forever client into a SQLite database: every DB2 table the client ships, with the hotfixes cached in DBCache.bin applied on top. It only reads the game files and never modifies them. Only the Forever product (wowf) is supported.

Install

go install bnema.dev/forever-db@latest

Or from a checkout:

make build   # produces build/forever-db

Usage

forever-db export --dir "<WoW dir>" [--hotfixes FILE]
forever-db export --cdn [--hotfixes FILE]
forever-db status --dir "<WoW dir>" [--json]
forever-db defs show [--json]
forever-db defs update --dir "<WoW dir>" [--fresh] [--output FILE] [--offline]

--dir is the folder that contains .build.info, for example in a Wine prefix: ~/.wine/drive_c/Program Files (x86)/World of Warcraft.

Flag / env Meaning
--dir, FOREVER_DB_WOW_DIR Game directory (required by export without --cdn, status and defs update)
--out, FOREVER_DB_DATA_DIR Output directory, default $XDG_DATA_HOME/forever-db (~/.local/share/forever-db)
--force Export even when the database is already up to date
--cdn Export the latest build from the Blizzard CDN instead of a local install (--dir is ignored)
--hotfixes FILE DBCache.bin to apply; default: the install's, none with --cdn. On a local export it implies --force
-v, --verbose Debug logging

A flag always wins over its environment variable.

Each local export writes wowf-<version>.sqlite and points the current.sqlite symlink at it. A --cdn export writes wowf-<version>-cdn.sqlite and leaves current.sqlite alone: it always tracks the local install.

CDN source

export --cdn needs no game install: it reads the latest wowf build from Blizzard's public CDN (build list over HTTPS from <region>.version.battle.net). The first run downloads about 300 MB (encoding, root, archive indexes, the DB2 files); indexes and loose files are cached in $XDG_CACHE_HOME/forever-db/cdn, so later runs of the same build download a few MB. Hotfixes are not on the CDN: without --hotfixes FILE the export has none (dbcache_status missing).

scripts/compare-exports.sh A B compares the craft tables of two exports (row counts and EXCEPT both ways).

Definitions

export uses the network only with --cdn. The table definitions and encryption keys for the Forever client ship inside the binary as a small snapshot.

After a game patch, export may report tables without a definition (status no_definition) and suggests forever-db defs update. That command downloads WoWDBDefs and TACTKeys (cached and revalidated in $XDG_CACHE_HOME/forever-db), reads the installed client, and writes <data dir>/defs.json.gz, which overrides the embedded snapshot. By default the new definitions are merged with the current ones: the snapshot in use (<data dir>/defs.json.gz, else the embedded one), or, with --output FILE (written there instead), that file if it exists, else the embedded snapshot. --fresh starts from scratch, --offline uses the download cache only. Apart from export --cdn, defs update is the only command that uses the network.

forever-db defs show prints which snapshot is in use (embedded or local), its builds, WoWDBDefs commit, generation time, table, layout and key counts, and an attribution line for the data sources (attribution object with --json).

Hotfixes change after a patch or a game session. forever-db status reports up to date, stale (with the reasons: build_changed, hotfixes_changed, schema_changed, defs_changed when the definitions snapshot in use differs from the one of the export, source_changed if current.sqlite points at a non-local export) or never exported; run export again when it is stale.

Exit codes: 0 success (including per-table failures, listed in the summary and _tables), 1 fatal error. Use status --json (state) and _tables.status in scripts.

Database layout

  • One table per DB2 table, named like the DB2 table (SpellReagents, ItemSparse, …). Columns follow the WoWDBDefs definition; arrays become Name_0, Name_1, … The record ID is the INTEGER PRIMARY KEY.
  • _meta: key/value pairs: schema version, tool version, source (local or cdn), build version and key (the build config hash with --cdn), locale, export time, DBCache hash and status (applied, missing, invalid, build_mismatch), definitions snapshot origin (embedded or local), its WoWDBDefs commit, generation time and SHA-256, table counts.
  • _tables: one row per table: status (ok, absent, no_definition, failed), error message, base row count, hotfix counts (upserts, deletes, reverts, errors), skipped rows and sections.
  • _columns: one row per SQL column: type (int, uint, float, string), bit size, array index, and ref_table / ref_column for columns that reference another table. Use these to find joins.
  • _hotfixes: every hotfix entry of a known table with the action taken (upsert, delete, revert, ignored, error).

Integers are stored as SQLite INTEGER. Unsigned 64-bit values keep their bit pattern as a signed int64, so values above 2^63 read back as negative numbers.

Example queries

Cooking (SkillLine 185) recipes that use a given reagent item (?1 = item ID):

SELECT DISTINCT s."Spell" AS craft_spell, i."Display_lang" AS reagent
FROM "SpellReagents" r
JOIN "SkillLineAbility" s ON s."Spell" = r."SpellID"
JOIN "ItemSparse" i ON i."ID" = ?1
WHERE s."SkillLine" = 185
  AND ?1 IN (r."Reagent_0", r."Reagent_1", r."Reagent_2", r."Reagent_3",
            r."Reagent_4", r."Reagent_5", r."Reagent_6", r."Reagent_7");

The recipe item that teaches a craft spell (? = craft spell ID). A recipe item has an ItemEffect with TriggerType = 6 (learn spell) whose SpellID is the craft spell; ItemXItemEffect links that effect to the item. An empty result means no item teaches that craft:

SELECT x."ItemID", i."Display_lang" AS recipe
FROM "ItemEffect" ie
JOIN "ItemXItemEffect" x ON x."ItemEffectID" = ie."ID"
JOIN "ItemSparse" i ON i."ID" = x."ItemID"
WHERE ie."TriggerType" = 6 AND ie."SpellID" = ?;

Limits

  • Client data only. Vendors, prices, drop rates, NPC spawns and most quest details live on the server and are not included.
  • A few encrypted sections use keys that are not public. Their rows are skipped and counted in _tables.skipped_rows.

Tests

go test ./... runs the unit tests on synthetic fixtures. Tests against real data are skipped unless these variables are set:

Variable Points to
FOREVER_DB_TEST_WOW_DIR A WoW Forever install (folder with .build.info)
FOREVER_DB_TEST_DEFS A definitions snapshot (defs.json.gz), e.g. pkg/defs/data/forever.json.gz
FOREVER_DB_TEST_DBD_DIR A WoWDBDefs definitions/ folder
FOREVER_DB_TEST_MANIFEST A WoWDBDefs manifest.json
FOREVER_DB_TEST_TACTKEYS A TACTKeys WoW.txt file
FOREVER_DB_TEST_TABLES Optional comma-separated table names to limit the WDC5 sweep
FOREVER_DB_TEST_GOLDEN Optional JSON file of expected sample rows for the WDC5 sweep

Data sources and licences

The definitions snapshot (embedded, or written by defs update) is derived from these projects and is licensed under CC BY-SA 4.0; see pkg/defs/data/README.md. The CASC, BLTE and WDC5 readers follow DBCD and TACTSharp (MIT); see NOTICE.

Copyright (C) 2026 bnema. SPDX-License-Identifier: AGPL-3.0-or-later. The project code is licensed under the GNU Affero General Public License v3.0 or later (see LICENSE).

forever-db is an unofficial tool and is not affiliated with or endorsed by Blizzard Entertainment.

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. On pages with a side panel: into the panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit; in a file, click a line number to select it, shift-click for a range
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 2

Tags 1

↑↓ moveenter openesc close