[GH-ISSUE #198] --data-dir cannot migrate an existing install whose files are in a nested Strata-data folder — it silently re-downloads everything #101

Closed
opened 2026-11-04 01:39:55 +07:00 by bsakaguchi · 2 comments
Owner

Originally created by @zackstantz on GitHub (Sep 30, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/198

--data-dir cannot migrate an existing install whose files are in a nested Strata-data folder — it silently re-downloads everything

Related: #162, #135 — same family, but this is a distinct blind spot that neither answer covers.

Symptom

I deleted my old Strata folder, unzipped a fresh copy into a new location, and ran setup with a new data folder. Instead of moving my existing ~84 GB of model files, setup started the full download again, and the data folder kept resolving back to the old location.
This happens on every retry: --data-dir <new> never finds the files, so the download always restarts.

Environment

  • Windows 10/11, Strata setup.py from main (engine 0.1.27)
  • Install folder: C:\Strata\Strata-main
  • Existing model files: C:\Users\<user>\Downloads\Strata-main\Strata-data\models\IQ3_S\ (the pre-0.1.16 layout, where Strata-data sits inside an older Strata folder)
  • Requested: --data-dir C:\Strata\Strata-data

Root cause

Two independent reasons the migration loop cannot see the files.
1. has_data() only looks one level down (setup.py:1145):

def has_data(folder: Path) -> bool:
    for d in DATA_ITEMS:          # ("models", "packs", "mtp")
        if (folder / d).is_dir() and any((folder / d).iterdir()):
            return True

It checks <candidate>/models, not <candidate>/Strata-data/models.
2. The migration loop never considers the remembered data dir as a source (setup.py:1246):

for folder in [ROOT, *other_installs(settings)]:
    if folder == dest or not has_data(folder):
        continue

settings["data_dir"] is used only to compute the destination (setup.py:1239). It is never iterated as a source, even though it points directly at the model files.
So for the pre-0.1.16 layout the candidate folder is ...\Downloads\Strata-main, whose direct children are models/packs/mtp only via the nested Strata-data\ — has_data() returns False, the folder is skipped, nothing is moved, and setup falls through to a fresh download.
The case that the code does handle (files directly at <old Strata folder>\models, as in #135) works fine, which is why this one slipped through.

Steps to reproduce

  1. Have an install in the pre-0.1.16 layout: ...\Strata-main\Strata-data\models\IQ3_S\* (both shards complete).
  2. Delete the Strata app folder contents, leaving Strata-data where it is (or restore it), then unzip a fresh copy elsewhere.
  3. Run START-HERE.bat --setup --data-dir <new path> (same drive as the existing files).

Expected

The existing model files are moved to <new path> (a same-drive rename, instant) and setup proceeds without downloading.

Actual

The files are not found. Setup announces a full model download. The data folder continues to resolve to the old location because %APPDATA%\Strata\settings.json still holds it.

Workaround

Move the files by hand first, so the destination already contains them, then rerun setup. have_model then short-circuits the download:

robocopy "<old>\Strata-data" "<new>\Strata-data" /E /MOVE
START-HERE.bat --setup --data-dir <new> ...

Suggested fix

In data_folder(), treat settings["data_dir"] as a migration source, and/or let has_data() recognise <folder>\Strata-data as well as <folder>:

for folder in [ROOT, *other_installs(settings), Path(settings["data_dir"])]:

with has_data() checking both folder / d and folder / "Strata-data" / d. This would also cover the "setup recognises already-downloaded files on another drive" improvement mentioned in #135.

Originally created by @zackstantz on GitHub (Sep 30, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/198 # `--data-dir` cannot migrate an existing install whose files are in a nested `Strata-data` folder — it silently re-downloads everything Related: #162, #135 — same family, but this is a distinct blind spot that neither answer covers. ## Symptom I deleted my old Strata folder, unzipped a fresh copy into a new location, and ran setup with a new data folder. Instead of moving my existing ~84 GB of model files, setup started the full download again, and the data folder kept resolving back to the old location. This happens on every retry: `--data-dir <new>` never finds the files, so the download always restarts. ## Environment - Windows 10/11, Strata `setup.py` from `main` (engine 0.1.27) - Install folder: `C:\Strata\Strata-main` - Existing model files: `C:\Users\<user>\Downloads\Strata-main\Strata-data\models\IQ3_S\` (the pre-0.1.16 layout, where `Strata-data` sits *inside* an older Strata folder) - Requested: `--data-dir C:\Strata\Strata-data` ## Root cause Two independent reasons the migration loop cannot see the files. **1. `has_data()` only looks one level down (setup.py:1145):** ```python def has_data(folder: Path) -> bool: for d in DATA_ITEMS: # ("models", "packs", "mtp") if (folder / d).is_dir() and any((folder / d).iterdir()): return True ``` It checks `<candidate>/models`, not `<candidate>/Strata-data/models`. **2. The migration loop never considers the remembered data dir as a source (setup.py:1246):** ```python for folder in [ROOT, *other_installs(settings)]: if folder == dest or not has_data(folder): continue ``` `settings["data_dir"]` is used only to compute the *destination* (setup.py:1239). It is never iterated as a *source*, even though it points directly at the model files. So for the pre-0.1.16 layout the candidate folder is `...\Downloads\Strata-main`, whose direct children are `models`/`packs`/`mtp` **only via** the nested `Strata-data\` — `has_data()` returns `False`, the folder is skipped, nothing is moved, and setup falls through to a fresh download. The case that the code *does* handle (files directly at `<old Strata folder>\models`, as in #135) works fine, which is why this one slipped through. ## Steps to reproduce 1. Have an install in the pre-0.1.16 layout: `...\Strata-main\Strata-data\models\IQ3_S\*` (both shards complete). 2. Delete the Strata *app* folder contents, leaving `Strata-data` where it is (or restore it), then unzip a fresh copy elsewhere. 3. Run `START-HERE.bat --setup --data-dir <new path>` (same drive as the existing files). ## Expected The existing model files are moved to `<new path>` (a same-drive rename, instant) and setup proceeds without downloading. ## Actual The files are not found. Setup announces a full model download. The data folder continues to resolve to the old location because `%APPDATA%\Strata\settings.json` still holds it. ## Workaround Move the files by hand first, so the *destination* already contains them, then rerun setup. `have_model` then short-circuits the download: ``` robocopy "<old>\Strata-data" "<new>\Strata-data" /E /MOVE START-HERE.bat --setup --data-dir <new> ... ``` ## Suggested fix In `data_folder()`, treat `settings["data_dir"]` as a migration source, and/or let `has_data()` recognise `<folder>\Strata-data` as well as `<folder>`: ```python for folder in [ROOT, *other_installs(settings), Path(settings["data_dir"])]: ``` with `has_data()` checking both `folder / d` and `folder / "Strata-data" / d`. This would also cover the "setup recognises already-downloaded files on another drive" improvement mentioned in #135.
Author
Owner

@Niko1221 commented on GitHub (Sep 30, 2026):

Confirmed, thanks for the analysis. In 0.1.28 (in testing) --data-dir also moves the files of the data folder used before, and of a Strata-data folder nested one level down.

<!-- gh-comment-id:5908110519 --> @Niko1221 commented on GitHub (Sep 30, 2026): Confirmed, thanks for the analysis. In 0.1.28 (in testing) `--data-dir` also moves the files of the data folder used before, and of a `Strata-data` folder nested one level down.
Author
Owner

@Niko1221 commented on GitHub (Sep 30, 2026):

Fixed in 0.1.28: --data-dir also moves the files of the previous data folder and of a nested Strata-data folder. Thanks @zackstantz for the analysis!

<!-- gh-comment-id:5908635972 --> @Niko1221 commented on GitHub (Sep 30, 2026): Fixed in [0.1.28](https://github.com/Niko1221/Strata/releases/tag/v0.1.28): `--data-dir` also moves the files of the previous data folder and of a nested `Strata-data` folder. Thanks @zackstantz for the analysis!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#101
No description provided.