ddworken / hishtory

Your shell history: synced, queryable, and in context

Home Page:https://hishtory.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add Server & Keep History

Dashboy1998 opened this issue · comments

I am currently using hishtory with a local file.

I have a hishtory server setup, the linuxserver.io image. But I'm not sure how to sync my current history with the server.

It appears running hishtory init ${SECRET_KEY} will erase my current history.

Thanks for opening this issue! Currently, there isn't a clean way of doing this (though this is a great feature request that I will work on!). But if you're up for a hacky way of doing this, you should be able to:

  1. Back up your ~/.hishtory/ directory to somewhere safe, this contains everything you need
  2. Reinstall hishtory with it configured to use your API server that you set up
  3. Copy over the DB files from the backup. This is all of the .hishtory.db* star files that are in your backed up ~/.hishtory/ folder.
  4. Run hishtory reupload to re-upload all of the entries that are now in the DB

I think this should work. And if it doesn't work for some reason, you can always just restore the entire ~/.hishtory/ directory which will definitely work to serve as a backup.

Is there some reason you couldn't do a hishtory export, reinstall with sync and then do an import from the cli?