Hazel doesn't close tabs because it's 'like a trip down memory lane.' Mozilla says it has some profile and tab group features coming later this year that might help her organize those memories.
I didn't know, that sucks so much.
Though, someone made a post on superuser and a reply said that you can back up the database, so at least something is salvageable
Making a backup every 60 days seems to be sufficient to keep all history. sqlite doesn't reuse old ids (I think?) so merging the backups shouldn't be too hard.
But they haven't tested it, also I wonder if once you do that successfully, Firefox will just delete all the extra records at the next startup, so idk
The entries would still be datestamped and as firefox clears up the history the older ones would be deleted.
In my other comment I linked something that said firefox just starts tidying up as performance starts to degrade, rather than a fixed limit of history entries.
Therefore, if your history is more or less full, and you just import a heap more history, firefox is just going to "tidy up" everything you just imported surely.