Skip to content

[Bug]: Installer overwrites existing massCode.db without backup or migration prompt when upgrading from v3.x to v4.7.1 #745

@Worl0-Creater

Description

@Worl0-Creater

Describe the bug

Description

When upgrading from MassCode v3.x to v4.7.1 on Windows 11, the installer overwrites the existing massCode.db database file located at the same library path, resulting in complete data loss. No backup, migration, or warning prompt was presented during installation.

Two years of code snippets were wiped out in seconds. This was devastating.


Steps to Reproduce

  1. Have MassCode v3.x installed with an existing library at a custom path (or default path)
  2. Confirm the library path contains a valid massCode.db with user data
  3. Download and run the MassCode v4.7.1 installer (.exe) from GitHub
  4. Proceed with default installation, do not modify the library path
  5. Launch MassCode v4.7.1

Expected Behavior

The installer should either:

  • Detect the existing database and offer a migration option, or
  • Prompt the user to back up the old database before proceeding, or
  • Create a backup (e.g., massCode.db.backup or massCode_old.db) before overwriting

Actual Behavior

The existing massCode.db was silently overwritten with a new, empty database. No warning, no backup, no migration.


Environment

Item Details
OS Windows 11 (22H2 / 23H2)
Old MassCode version 3.x.x (exact minor version not remembered)
New MassCode version 4.7.1
Library path (both old and new) D:\MyCodeBase_Local\massCode
Installation method (old) Standard installer, default path
Installation method (new) .exe installer downloaded from GitHub releases, default installation, library path unchanged

Recovery Attempts (unsuccessful)

  • Windows 11 Recycle Bin
  • Everything full disk search (massCode.db, massCode, .db)
  • Manual search in Documents, AppData, ProgramData
  • EaseUS paid data recovery software

Additional Context

  • No backup or migration prompt was shown during installation
  • No third-party backup tools were used (e.g., Windows Backup, File History)
  • The user was not aware that upgrading would destroy existing data

Suggested Fix

At minimum, the installer should:

  1. Detect an existing massCode.db at the target library path before overwriting
  2. Display a clear warning
  3. Offer to create a backup (e.g., copy to massCode.db.pre-v4)
  4. Optionally, provide migration logic from v3.x schema to v4.x

Severity

Critical – Permanent data loss for users upgrading without manual backup.

To reproduce

  1. Have MassCode v3.x installed with an existing library at D:\MyCodeBase_Local\massCode (contains old massCode.db with user data)
  2. Download and run MassCode v4.7.1 installer (.exe) from GitHub Releases
  3. Proceed with default installation, do not modify the library path
  4. Launch MassCode v4.7.1
  5. Observe that the library is now empty - all previous code snippets are gone

App Version and Architecture

4.7.1 (x64)

System info

System:
    OS: Windows 11 10.0.22631
    CPU: (32) x64 AMD Ryzen 9 7945HX with Radeon Graphics
    Memory: 4.31 GB / 15.69 GB

Validations

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions