When app shutdowns or startups, you can save the signalr hub, connections, and state by using the PersistentConnection.Extensions assembly which contains the OnDisconnected and OnConnected methods. Essentially, the OnDisconnected method stores the state in persistant storage (like a file or database) on shutdown and then retrieves that state via the OnConnected method when the app starts up.
You can also use the IUserIdProvider interface to identify which hub connections and state need to be saved and restored. In addition, you can use the HubPipeline to pipe delegation events, like a Disconnect, to save and restore the state.
Overall, saving and restoring signalr hub, connections, and state on app shutdown/startup can be a tricky process but it can be done reliably with the help of the PersistentConnection.Extensions and IUserIdProvider interfaces, as well as the HubPipeline.