An tool for importing old zsh history into histdb
For histfile without timestamp, current timestamp will be used as timestamp for every entry, this will make the order of the commands in database after import different from the histfile, to preserve this order, use env PRESERVE_ORDER. Importing might take longer if preserving order, depend on how large the histfile is
$ export PRESERVE_ORDER=trueBy default, this tool will read the default path of both histfile and db ($HOME/.zsh_history and $HOME/.histdb/zsh-history.db), to change this use DB_PATH and HISTORY_PATH.
$ export DB_PATH=/home/user/zsh_history.db
$ export HISTORY_PATH=/home/user/.histfileIf for some reason importing directly into currently using db ($HOME/.histdb/zsh-history.db) success but histdb return error, try import into template.db and replace instead.
Remember to take backup of the current histfile and db
Edit main.go if needed
$ git clone https://github.com/FuLygon/go-histdbimport.git && cd go-histdbimport
$ go build main.go