Skip to content

Conversation

mtlynch
Copy link
Contributor

@mtlynch mtlynch commented Oct 13, 2025

Description

Modifies litestream's restore command so that it creates the parent directory for the output file if the parent directory does not already exist.

Motivation and Context

In litestream v0.3.x, the litestream restore command would create the necessary parent directory to receive the output database file if the directory did not exist. This behavior regressed in v0.5.0, so this change restores the v0.3.x functionality to ensure that an output directory exists when litestream attempts to restore from backup.

How Has This Been Tested?

I updated TestReplica_RestoreAndReplicateAfterDataLoss to exercise this behavior, and I tested it one of my apps.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (would cause existing functionality to not work as expected)

Checklist

  • My code follows the code style of this project (go fmt, go vet)
  • I have tested my changes (go test ./...)
  • I have updated the documentation accordingly (if needed)

In litestream v0.3.x, the litestream restore command would create the necessary parent directory to receive the output database file if the directory did not exist. This behavior regressed in v0.5.0, so this change restores the v0.3.x functionality to ensure that an output directory exists when litestream attempts to restore from backup.
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.

2 participants