-
-
Notifications
You must be signed in to change notification settings - Fork 565
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
[Bug]: atuin does not sync correctly #2406
Comments
This is because new installations are automatically migrated to sync v2, while the old are still on sync v1. So your old machine will still have synced OK, it's just not stored in a place that the new machine can find it. Sync v1 had a whole bunch of issues which have been resolved in the new version. The next release will auto-migrate users, however making the process automatic has been tricky. Sync v2 is enabled by the following
Which you will find in your new machine's config. Disable it to download from the old store, and then enable it again to migrate to the new. |
Hi, @ellie. I think I faced the same issue. I have an old laptop that runs Atuin, which was installed by Nix over a year ago. Now, I have a new computer and want to sync history, but I was unable to. Your comment describes the issue I most likely face. So, what is the proper sequence of actions to make everything work, considering I have already tried to log in from the new computer and pushed some data to sync V2? Are there any migration guides for situations like this? |
There's not much of a process. They just need to be on the same version of sync, in order to sync If you enable
On your old machine, it'll work. Run (what I wrote previously is because OP no longer has access to the old machine, so needs to flip it off/on again)
Addressing this explicitly, there's no need to be concerned about conflicts/etc there 😊 |
Thank you, Ellie. I will try to upgrade my old laptop with a newer version of Atuin because the version I'm using does not support Sync v2. |
Ok, it seems now the data is synced and after looking at the sqlite db itself, I see recent data from the decommissioned laptop. So no data was lost after all. Yay and sorry for the scare! What this still cannot explain is why the data was not synced (down!) in one go but only across multiple atuin sync commands and not even that downloaded everything? E.g. I opened I do share configs between all my computers, so all atuin instances ran with the old sync method, even the computer I just installed. I just switched the new computer to the new method and it uploaded all the items. Is it in general better to always use the new sync version? SELECT count(*) from history;
-- 21967 entries
SELECT datetime(timestamp/1000000000 , 'unixepoch', 'localtime'), * from history
where hostname like '%old-hostname%' and "timestamp" > 1727165683559360000
order by timestamp desc;
-- Shows the last entry at 1727165683559360000, which is 2024-09-24 10:14:43 and looks about right
SELECT count(*) from history
where "timestamp" > 1727165683559360000;
-- Returns about 900 entries UPDATE: I just turned it on on my private laptop as well and it has now more or less (+/- 1 entry for the latets sync run) the same number. So this feels much more reassuring that it has all the data. :-) |
What did you expect to happen?
I wanted to setup a new laptop and expected that after
atuin login
, all old shell history from other computeres were available. It was not. Also, when I checked on other computers, they did not have the same amount of history, even afteratuin sync
.What happened?
This is the session of an old computer running for days. As far as I can see, it shows that it didn't download history which was uploaded by another computer. I had to run
atuin sync -f
to get it to download additional history entries. I then ran it as well on a new computer (with ~40 entries) and it also started downloading entries there. Still, the new computer now shows 20425 entries (after about fiveatuin sync -f
runs over 20min, similar increasing items like the below session), the old computer shows now 20728 (see latest run below):I then checked for the history of the computer I decommissioned a few days ago (and have not available anymore!) and the latest data I have from that laptop is from "1mo ago" (I just checked for a command which run almost daily, no idea if there is a better way to search for by hostname?). So apparently, atuin did NOT sync for about a month? Thankfully I didn't do a lot of new stuff during the last month, so that's not the end of the world, but it is still scary that sync doesn't work correctly. :-(
Atuin doctor output
Code of Conduct
The text was updated successfully, but these errors were encountered: