Migrating from v1 to v2
This page is the step-by-step checklist for moving an existing modernGraphTool v1 database to v2.
For a feature-level overview of what's different, see What's New in v2. This page stays focused on the migration procedure.
Compatibility
Your existing data works as-is. The folder structure and file formats are unchanged:
phone_book.json— same structure, same location (data/phone_book.json)- FR measurement files — same
.txtformat indata/phones/ - Target curve files — same
.txtformat indata/target/ - Preference Bound files —
Bounds U.txt/Bounds D.txtstill.txt, but their location changed (see Migration Steps below — moved from v1'sextensions/preference-bound/data/todata/)
config.js retains the same general structure. All v1 settings (INITIAL_PHONES, INITIAL_TARGETS, NORMALIZATION, VISUALIZATION, INTERFACE, PATH, WATERMARK, TARGET_MANIFEST, etc.) remain compatible. v2 adds a few optional new sections — see What's New in v2.
Deployment is also the same — v2 outputs a fully static SPA to dist/. Copy the folder to your web server. The .htaccess file for Apache SPA fallback is included.
Migration Steps
-
Download the latest v2 release.
-
Copy your data — Move your
data/folder (phones, targets,phone_book.json) into the v2 release folder. -
Move Preference Bound data files — In v1,
Bounds U.txtandBounds D.txtlived inextensions/preference-bound/data/. In v2 they must sit directly indata/, alongsidephones/andtarget/. If you skip this, the Preference Bound overlay will silently fail to render when enabled. The base DF target file (e.g.KEMAR DF (KB006x) Target.txt) should already be indata/target/as part of step 2. -
Migrate
config.js— Copy your v1config.jssettings into the v2config.jstemplate. The core settings are the same; review the new sections (SQUIGLINK,TARGET_CUSTOMIZER,PREFERENCE_BOUND,SAMPLES,CDN_MODE) and adjust as needed. The oldMULTI_SAMPLEandHPTFsections are still read for compatibility, butSAMPLESreplaces both — convert them while you are here. You can use the Config Editor to easily migrate and review all settings; it does theSAMPLESconversion for you. -
Migrate
theme.css— If you customizedtheme.css, port your color values to the v2 format (CSS custom properties for graph styling, plus OKLCH-based UI variables). The Theme Generator can help. -
Migrate page metadata (
index.html) — v2 ships with its ownindex.html, so any edits you made to your v1index.htmldo not carry over automatically. Re-apply them in the v2index.html:<title>and<meta name="title"><meta name="description">and<meta name="keywords">- Open Graph tags:
<meta property="og:title">,<meta property="og:description">,<meta property="og:url">,<meta property="og:image"> <link rel="canonical">- Favicons:
<link rel="icon">,<link rel="shortcut icon">,<link rel="apple-touch-icon"> <meta name="apple-mobile-web-app-title">- Web app manifest:
<link rel="manifest">(if you had one)
The Customizing the Page → Changing Page Metadata section has the field-by-field reference.
Source buildersIf you build from source, edit
src/app.htmlinstead ofindex.html. The outputdist/index.htmlis generated from that template. -
Delete extensions — The
extensions/folder is no longer used. Any extension settings should now be inconfig.js. -
Test locally — Open the page in a browser and verify your data loads correctly.
Picking a Deployment Option
v1 shipped as a pre-built drop — you downloaded a release, uploaded it, and that was the only path. v2 adds three more:
- Pre-built Release — The one-for-one replacement for your v1 setup. Download the release, copy your data and config in, upload. No surprises, no
BASE_PATHto set, works exactly like v1 did. - CDN Deployment — Recommended, and a thinner drop: only your
index.html,config.js,theme.css,data/, andassets/live on your server; the app bundle itself loads from jsDelivr and auto-updates. - GitHub Pages — CDN deployment hosted on GitHub for free, if you'd rather not keep running a web server for this.
- Building from Source — For developers and forks.
Instead of hosting the full pre-built release, consider the CDN deployment mode. You don't need to manage the app code, and future updates apply automatically with it.
If you pick CDN mode, watch out for BASE_PATH
In v2 CDN mode, any deployment not at the root of its (sub)domain requires CDN_MODE.BASE_PATH in config.js. Without it, the home page loads fine but every share link 404s. The fix is one config line. For a site at example.com/headphones/:
CDN_MODE: {
MAJOR_VERSION: 2,
BASE_PATH: "/headphones",
},
Full explanation and worked examples: Why BASE_PATH is almost always required.
squig.link operators typically run two instances on the same subdomain: <username>.squig.link/ for earphones (at the subdomain root — no BASE_PATH) and <username>.squig.link/headphones/ for headphones (needs BASE_PATH: "/headphones"). Each instance has its own config.js, so set BASE_PATH only on the /headphones/ one. The root earphones instance stays as-is.
Personal databases under a subdirectory like example.com/headphones/ need BASE_PATH to match. A database at example.com/ (domain root) does not.
Switching between CDN and pre-built later
Everything that isn't the app bundle itself (data, config, theme, Preference Bound files) is identical between the two options. You can switch back and forth by swapping your index.html file and optionally adding or removing the CDN_MODE section from config.js. There's no lock-in.