Skip to content

Comments

Fix various migration issues#5723

Merged
WithoutPants merged 7 commits intostashapp:developfrom
WithoutPants:issues/migration-bugs
Mar 18, 2025
Merged

Fix various migration issues#5723
WithoutPants merged 7 commits intostashapp:developfrom
WithoutPants:issues/migration-bugs

Conversation

@WithoutPants
Copy link
Collaborator

@WithoutPants WithoutPants commented Mar 14, 2025

Thanks to @cj12312021 for the massive database to test the migration process against. Resolves the following issues found while testing:

  • UI now shows when the database is being backed up in the first step
  • close the migration connection to the database before re-connecting the main database. This should hopefully address the database locked and database corruption issues that were encountered
  • when running a vacuum, the wal file is now flushed so that we're not left with a wal file the size of the whole database file
  • removed the post-migrate vacuum. In many cases this isn't necessary, and it takes a very long time on larger databases. In future it might be worth adding an option to enable it, or to automatically do it after large schema restructures. Alternatively, we can just recommend it as a user-initiated post-migrate step.

@WithoutPants WithoutPants added the bug Something isn't working label Mar 14, 2025
@WithoutPants WithoutPants added this to the Version 0.28.0 milestone Mar 14, 2025
Copy link
Collaborator

@feederbox826 feederbox826 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

feederbox approved

@WithoutPants WithoutPants merged commit daed09e into stashapp:develop Mar 18, 2025
2 checks passed
XGFan pushed a commit to XGFan/stash that referenced this pull request Mar 27, 2025
* Indicate while backing up database
* Close migrate connection to db before optimising
* Don't vacuum post-migration

In most cases is probably not needed and can be an optonal user-initiated step

* Ensure connection close on NewMigrator error
* Perform post-migration using migrator connection

Flush WAL file at end of migration
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants