Hangfire
Hangfire copied to clipboard
Migration procedure when changing storage
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?
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:
- Initialize a new storage and put all the new background jobs to the new one, while processing jobs from both storages.
- Once all background jobs from the previous storage processed, safely remove it.