Skip to content

feat(saves): back up a save directly to a USB drive on the PS5#145

Open
Twice6804 wants to merge 1 commit into
phantomptr:mainfrom
Twice6804:feat/saves-usb-backup
Open

feat(saves): back up a save directly to a USB drive on the PS5#145
Twice6804 wants to merge 1 commit into
phantomptr:mainfrom
Twice6804:feat/saves-usb-backup

Conversation

@Twice6804

Copy link
Copy Markdown
Contributor

Pull Request

Description

Adds a "Save to USB storage" action to the Saves screen that backs a save up
directly to a USB/extended-storage drive plugged into the PS5 itself,
without round-tripping through a host PC. The destination base path is
configurable in Settings (default /mnt/usb0/savedata); each backup lands
at <savePath>/<title_id>/<timestamp>/<title_id>.zip.

Addresses the first half of #144 ("Save a complete backup of all save games
in one click... in a folder on the USB drive with timestamps folders").

Type of Change

  • New feature (non-breaking change which adds functionality)

Changes Made

  • New savePath setting (Settings screen + localStorage + ~/.ps5upload/settings.json mirror), default /mnt/usb0/savedata.
  • New per-row "Save to USB" button and a header "Back up all to USB" bulk button on the Saves screen.
  • The backup flow reuses the existing download → finalize → zip pipeline, then uploads the zip back onto the PS5 via the existing transfer_file single-file upload — no new wire protocol, no payload/engine changes.
  • Pre-flights the USB mount (writable, not a placeholder) via the existing checkDestinationFreeSpace helper and re-checks for a stale host before uploading, mirroring the Restore flow's existing safety guards.
  • New backupTimestamp helper (YYYY-MM-DD_HHMMSS, local time) and saveSettings store, both unit-tested.

Documentation Updates

Did you update the documentation? [ ] Yes [x] No

The existing Backup/Restore save feature isn't documented in README/FAQ either; this follows the same precedent — the feature is self-explanatory from the Saves/Settings UI.

Testing

  • npm run validate (lint, typecheck, full Vitest suite — 754 passing, i18n coverage gate, Vite production build all green)
  • npm run coverage
  • Built PS5 payload successfully (no payload changes in this PR)
  • Cross-platform CI target checks passed
  • Tested on real PS5 hardware
  • Tested desktop app
  • Verified all example commands in docs work
  • Tested edge cases and error handling

Note: the Rust cargo check for the desktop Tauri shell could not be run in my sandbox (missing system GTK/WebKit dev packages, e.g. libwebkit2gtk-4.1-dev / libgtk-3-dev) — a pre-existing environment limitation, not something this PR's code touches (zero Rust files changed). CI will run the full gate.

I also don't have PS5 hardware to test against in this environment — would appreciate a hardware smoke test (plug a USB stick into the console, run a per-row and a bulk backup, confirm the zip lands at the expected path and round-trips through Restore) before merge.

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have updated the documentation to reflect my changes
  • My changes generate no new warnings
  • I have tested my changes on PS5 hardware (or simulated environment)
  • All example code in documentation has been tested and works

Additional Notes

Part 2 of #144 (convert game folders to/from exfat/ufs via UFS2Tool, and zip/7z on-console for non-save game backups) is out of scope for this PR.

Adds a configurable PS5-side save path (Settings, default /mnt/usb0/savedata)
and a "Save to USB" action (per-row + bulk) on the Saves screen that pulls a
save off the console, zips it, then pushes it back to
<savePath>/<title_id>/<timestamp>/<title_id>.zip on a USB/extended-storage
drive plugged into the PS5 itself — no host PC round-trip needed.

Reuses the existing download/finalize/zip pipeline and single-file transfer
(transfer_file); no payload/engine changes required. Pre-flights the USB
mount via the existing checkDestinationFreeSpace helper and re-checks for a
stale host before uploading, mirroring the Restore flow's safety guards.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@Twice6804 Twice6804 requested a review from phantomptr as a code owner June 18, 2026 04:21
@Twice6804

Copy link
Copy Markdown
Contributor Author

@phantomptr quick PR to backup save games to usb drive, adresses the first part of #144

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant