How do sidekiq jobs get re-created after a restore?

I want to move a site’s postgres and redis servers to a different machine. Moving postgres is fairly straightforward. But there are several hundred jobs queued in sidekiq (ToggleTopicClosed and UnpinTopic at least mostly). There doesn’t seem to be a straightforward way to move a redis database (you can copy the whole of redis, but that’s no good to move just a single numbered database). If I do a full backup/restore, will those jobs get created? And if they will, can I kick that off by hand some easy way once the move is complete?

Or do I decide not to care about those queued jobs? (That doesn’t seem very nice :thinking:)

2 Likes

You can save a snapshot of the Redis database to dump.rdb by executing BGSAVE or SAVE from the command line.

This Redix command will create a new file named dump.rdb in the same folder as Redis.

Then, you can copy dump.rdb to another other server running Redis.

Then when Redis starts on the new server, it will look for dump.rdb to initialize Redis.

Not sure about how sidekiq will update after restoring Redis, but seems worth a try.

4 Likes

Right, but my understanding is that doing that saves ALL databases on the server, not just the one. Other sites have already moved to the other server, so backup/restore of all databases isn’t an option.

1 Like