Skip to content

Config migration does not preserve backup of old format #637

@groksrc

Description

@groksrc

Description

When the dev branch's config migration runs (migrate_legacy_projects() in config.py), it converts the old project format (string paths) to the new format (ProjectConfig dicts) in-place. No backup of the previous config is created before saving.

This means:

  1. Running the dev version migrates ~/.basic-memory/config.json to the new format
  2. Running the released homebrew version (0.18.5) after that fails with ValidationError: projects.main - Input should be a valid string
  3. There's no way to recover the old config without manual intervention

Steps to Reproduce

  1. Install homebrew basic-memory (v0.18.5) and create a working config
  2. Run the dev branch version — config auto-migrates to new format
  3. Run the homebrew version again — fails with validation error

Expected Behavior

The migration should create a backup (e.g., config.json.bak) before writing the new format, so users can revert if needed.

Relevant Code

  • src/basic_memory/config.pymigrate_legacy_projects() model validator
  • ConfigManager.save() writes directly without backup

Impact

Users who switch between dev and released versions lose their config without recovery path.

Recommendation

Release v0.18.6 with config backup support before deploying the new format to production. This ensures existing users have a safe upgrade path and can roll back if needed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions