A coming update to SourceHut's internal design calls for the values of the ID columns in our databases to be made uniform. Each database (e.g. for git, hg, builds, etc) maintained its own copy of tables with shared information, sourcing updates from via webhooks, but each of these rows had an ID specific to each database. This change will make these IDs uniform across all services in preparation for linking our services more tightly together through GraphQL Federation.

This document outlines the extra steps required to perform this upgrade for third-party instances.

Upgrade process

Ensure is running version 0.60.5 or later. Then, for each service, one at a time:

  1. Disable automatic migrations
  2. Shut off the service
  3. Run upgrades
  4. Run $service-migrate upgrade head (e.g. gitsrht-migrate) for each service and monitor the migration progress
  5. Turn on the service
  6. Re-enable automatic migrations if desired

Note: must be upgraded last, if present, and the other services must be running during its upgrade. and

Both and cache user IDs and usernames in Redis. Run the following command to clear the Redis cache after the services have been turned off and before they are turned on again:

redis-cli --scan --pattern "**" | xargs redis-cli del

A special upgrade process is required for, which does not use the same system for database migrations as other services. Perform the same steps as described above, then run the scripts in contrib in the following order:

  • ./contrib/ upgrade
  • ./contrib/ upgrade

To downgrade, repeat these commands in the reverse order with "downgrade".

Downgrade process

For each service (excluding, one at a time:

  1. Shut off the service
  2. Run $service-migrate downgrade $version, selecting $version from the list below, for each service
  3. Downgrade the software
  4. Turn on the service
  5. Re-enable automatic migrations if desired
Affected database schema revisions

Last schema revision prior to this change, for reference if downgrading:

  • f79186791a25
  • 64fcd80183c8
  • bb87b52896ac
  • de4adc3cc306
  • d4b5b0b5c3f6
  • 391282b09533
  • e1e2e901be0c
  • n/a
  • n/a
Additional resources

About this wiki

commit ee367906b281b9de7e0628a2a4322b545b704df1
Author: Drew DeVault <>
Date:   2024-02-09T10:14:51+01:00

packages: drop unofficial repos
Clone this wiki (read-only) (read/write)