Skip to content

Memcard: Add automated rolling local backup system#14472

Draft
chaoticgd wants to merge 2 commits into
PCSX2:masterfrom
chaoticgd:memory_card_rolling_backups
Draft

Memcard: Add automated rolling local backup system#14472
chaoticgd wants to merge 2 commits into
PCSX2:masterfrom
chaoticgd:memory_card_rolling_backups

Conversation

@chaoticgd

@chaoticgd chaoticgd commented May 19, 2026

Copy link
Copy Markdown
Member

Description of Changes

Not yet ready for testing.

This adds an automated rolling local backup system for memory cards, as well as some new classes for handling ZIP files.

Memory cards will be automatically copied at most once a day, and older backups will automatically be deleted according to a configurable disk space usage limit.

TODO:

  • Add libzip wrapper classes.
  • Implement logic for making and restoring backups.
  • Implement logic for deleting old backups.
  • Hook up the Qt UI.
  • Add ImGui UI for it.
  • Implement support for cancelling saving of the ZIP file, so the backup thread can stop immediately.
  • Synchronise backups with the memory card system, so that we cancel a backup if we want to write to the card.

Rationale behind Changes

A while back there was a conversation about changing the design of the memory card busy dialog to make it harder to accidentally corrupt your memory card. Ultimately, nothing was done to it, but this got me thinking about what we could do to improve the situation.

By the time the memory card busy dialog appears, depending on circumstances it may already be too late. The game may have crashed while saving for example, so forcibly shutting it down may be the only option. Hence, modifying the design of this dialog alone would not be a bullet proof solution.

This brought me to the idea of automated backups.

I've tried to make the limitations of this system very clear in the UI, to prevent confusion:

This system protects your save games in the case that a game crashes or is forcibly shutdown
while saving, but NOT in the case that the drive used to store the memory card files is 
damaged, so this does NOT replace a traditional backup system.

The zip classes I'm adding were originally written for #13763 (but extended to support extracting folders from the zip, and adding them to the zip recursively). This way the classes can be integrated with our Error class. I didn't want to build on top of the existing ZipHelpers functions because they have broken error handling.

Suggested Testing Steps

Not yet ready for testing.

Did you use AI to help find, test, or implement this issue or feature?

No.

@chaoticgd chaoticgd force-pushed the memory_card_rolling_backups branch 2 times, most recently from bd647bc to ef4e50c Compare June 4, 2026 20:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants