Hangfire icon indicating copy to clipboard operation
Hangfire copied to clipboard

Migration procedure when changing storage

Open andreireinus opened this issue 1 year ago • 1 comments
trafficstars

I am using the SQL storage as default, but I plan to move to Redis for performance reasons.

Do we have a migration path? With recurring jobs, it is easy to reregister during the startup, but what about existing jobs?

andreireinus avatar Dec 20 '23 07:12 andreireinus

Existing jobs can't be easily migrated, and it's a difficult thing to do on a storage that keeps transaction processing anyway. Usually, migration is performed in two steps:

  1. Initialize a new storage and put all the new background jobs to the new one, while processing jobs from both storages.
  2. Once all background jobs from the previous storage processed, safely remove it.

odinserj avatar Jan 25 '24 07:01 odinserj