Migrate to 0.1.0
💥 Breaking Changes
See the original announcement for more context
Stump has migrated from using Prisma to SeaORM for its database layer and from REST to GraphQL for its API. This was effectively a ground-up rewrite of a large portion of the entire codebase, and as such, there are several breaking changes that users should be aware of before upgrading to version 0.1.0 or later.
Incompatible Database
I tried to minimize the number of breaking changes in the database, but there were some changes that were unavoidable. As a result, the database itself is not compatible with previous versions of Stump.
The list of notable database changes are as follows:
- Convert all Prisma-specific join tables to use more semantic naming conventions
- Reduce the usage of UUIDs in favor of auto-incrementing integers for primary keys for smaller tables with less user-facing exposure
- Standardize all enumerations to use
SCREAMING_SNAKE_CASEinstead of a mix ofsnake_caseandPascalCase - Replace
Blobtypes withJsontypes for potentially improved filtering
Non-Recoverable Data
Thankfully, the vast majority of data is migratable. However, there are some pieces that are not recoverable due to the nature of the changes. These include:
- API keys
- User-assigned permissions
- Smart lists
- Scheduled job configurations
- Bookmarks and highlights
To be clear: these pieces of data will be lost during the migration process. Please take extra care to re-assign permisions to users and re-create API keys after the migration is complete.
Migration Steps
There are NO guarantees that this migration will work for everyone. There are so many different configurations and setups that it's hard to account for all of them.
Please report any issues you encounter during the migration process.
This section outlines the steps needed to migrate your existing Stump instance to version 0.1.0 or later. Please note that these steps only apply if you are upgrading from a version prior to 0.1.0.
I should also note that if you don't have a complicated setup, and you don't care about losing things like reading history, it might just be easier to start fresh with a new Stump instance. The migration process is primarily intended for users who have a significant amount of data and configurations that they wish to retain.
Backup Your Data
Before proceeding with the migration, ensure you have a complete backup of your Stump database. This is crucial in case anything goes wrong during the migration process.
Create a separate Stump instance
I absolutely do not recommend updating your existing Stump instance in place. Please do not do that. This process should be in total isolation from your existing instance to avoid any potential data loss. We will bring over your existing configs and database in the next steps.
You could do something like the following:
/stump-old/ # Your existing Stump instance
├── docker-compose.yml
└── config/
└── stump.db
/stump-new/ # Your new Stump instance
├── docker-compose.yml
└── config/ # Empty, first start will create what you needThe important part here is to ensure you have an upgraded instance running to get the new database created and migrated, which happens automatically after the first start.
A few suggestions:
- If your existing setup uses
latestalias for the Docker image, pin it to0.0.12instead to avoid accidental upgrades - Make sure to fully stop your existing Stump instance before starting the new one (even though they are isolated)
Start the new Stump instance
Start the new Stump instance to allow it to create all the fresh configs and database files. Once you see the startup messages in the logs, fully stop the instance.
Be sure your old Stump instance is fully stopped as well. At this point, you can copy over your old instance's stump.db file into the new instance's config directory as stump-legacy.db (or any other name you prefer, just not stump.db). You may also mount is separately if preferred.
Download the backfill.sql Script
The backfill.sql script will be one of the downloadable assets in the release page for 0.1.0.
Download the backfill.sql script from the release page for 0.1.0.
If you continue with this guide, you will not need to make any edits to this script file. The migration tool will handle executing the sql for you.
If you would prefer to attempt to run the migration manually, please carefully review the script instructions. The important part is that you will need to replace the placeholders at the top of the script with your actual database paths.
Migrate Your Database
The updated Stump instance includes a CLI tool to help with the migration process. Before continuing, please ensure the following:
- The new Stump instance has been started at least once, has not been configured, and is fully stopped. There should be a new database created with no data in any of the tables
- The old Stump instance is fully stopped
- The old Stump database is accessible (if running Docker, ensure both database files are mounted properly or you copied it over accordingly)
To migrate your database using the CLI tool, run the following:
# If using Docker, exec into the NEW stump container
./stump system sea-orm-migrationThe tool will prompt you for the necessary information to pull data from the old database and insert it into the new one. Follow the prompts carefully. A loose outline of the prompts is as follows:
- Confirm you want to proceed with the migration
- Enter the path to the legacy database file (with the data you want to migrate)
- Confirm the path to the new database file (this should be pre-filled with the correct path)
- Monitor the migration progress (should be very quick)
Added Features
There are several new features that were added as part of this release that I think are worth highlighting:
- The alphabet filter (#709)
- Adjustable cover sizes (#724)
- Basic metadata editing and calibre tags (#735)
- An entire mobile application:
- Native Kotlin/Swift Readium ebook reader
- On deck support
- Built-in file browser
- Offline reading
- OIDC authentication support (#246)
- Improved smart list performance
- Refreshed UI components and styles