Questarr

Migration Guide: PostgreSQL to SQLite

Questarr v1.1+ moves from PostgreSQL to SQLite to simplify deployment and reduce resource usage. This guide explains how to migrate your existing data.

Prerequisites

Compatibility

The migration tool is compatible with all Questarr versions from v1.0.0 onwards. It automatically handles, table renames, column renames & missing columns.

Migration Steps

  1. Stop the current application:
    docker compose down app
    
  2. Run the migration: This special compose file spins up your old database and the new migration tool. It will automatically initialize the SQLite database (if it doesn’t exist) and copy your data.

    You can download the docker-compose.migrate.yml here.

    docker compose -f docker-compose.migrate.yml up --abort-on-container-exit
    
  3. Verify the output: A new file sqlite.db should be created in the data/ directory (created in your current folder).

  4. Update your docker-compose.yml: Update your main docker-compose.yml to use SQLite by removing the postgres service and updating the app service to mount the SQLite data volume. Your configuration should look similar to this:

    services:
        app:
            image: ghcr.io/doezer/questarr:latest
            ports:
                - "5000:5000"
            volumes:
                - ./data:/app/data # Maps your SQLite database file
            environment:
                - SQLITE_DB_PATH=/app/data/sqlite.db
            ... rest of definitions
    
  5. Start the new version:
    docker compose up app -d
    

    At this point, check that everything is as expected, and you are free to remove the db and the migrator from your docker project. Just add --remove-orphans to the previous command (when starting the container).

Alternatively, you can run Questarr directly with Docker:

docker run -d -p 5000:5000 -v ./data:/app/data ghcr.io/doezer/questarr:latest

Troubleshooting