Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Server & Keep History #182

Open
Dashboy1998 opened this issue Feb 20, 2024 · 2 comments
Open

Add Server & Keep History #182

Dashboy1998 opened this issue Feb 20, 2024 · 2 comments

Comments

@Dashboy1998
Copy link

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.

@Dashboy1998 Dashboy1998 changed the title Add Server Add Server & Keep History Feb 20, 2024
@ddworken
Copy link
Owner

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.

@dstengle
Copy link

dstengle commented Mar 6, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants