Page MenuHomePhabricator

Migrating Repository Shards
Updated 796 Days AgoPublic

Version 2 of 3: You are viewing an older version of this document, as it appeared on Sep 28 2019, 2:59 PM.
  • Create the new shard ( and service ( following Adding Hardware.
  • Add the new service ( to the instance.
  • Disable allocations on the old service (
admin/ $ PHABRICATOR_INSTANCE=admin /core/lib/instances/bin/instances set-service-property \
  --instance turtle --service --key disable-allocations --value true
  • Review service configuration in web UI.
  • Sync services.

The instance is now running with two repository service shards, and only the new shard accepts new allocations. This is a stable state. From here, we'd like to migrate existing repositories to the new shard.

For each repository (from bin/repository list), save the state:

src/ $ PHABRICATOR_INSTANCE=turtle /core/lib/services/bin/services save-repository \
    --repository rXYZ --maintenance <message>

...then load it on the destination shard:

dst/ $ PHABRICATOR_INSTANCE=turtle /core/lib/services/bin/services load-repository \
    --repository rXYZ --file <phid> --activate-device

Once this is finished:

  • Disable daemons on the old shard.
admin/ $ PHABRICATOR_INSTANCE=admin /core/lib/instances/bin/instances set-service-property \
  --instance turtle --service --key disable-daemons --value true
  • Synchronize services.

For historical context, see T13393.

Last Author
Last Edited
Sep 28 2019, 2:59 PM

Event Timeline

epriestley created this object.
epriestley added a project: Phacility.