Match the history to the db format.