Skip to content

Config migration does not preserve backup of old format #637

Closed

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.py — migrate_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.

Activity

  1. added
    bug
    on Feb 28, 2026
  2. claude commented on Feb 28, 2026

    @claude
    Contributor

    Claude encountered an error —— View job


    I'll analyze this and get back to you.

  3. phernandez commented on Mar 1, 2026

    @phernandez
    Member

    Fixed in 574a8f85. Config migration now creates a config.json.bak backup before overwriting the old format, so users can revert if needed.

  4. added this to the v0.19.0 milestone on Mar 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions