Sync store still gives me "attempting to decrypt with incorrect key" errors

I am attempting to get 4 different machines to all sync to my hub account.

Macbook Pro:
Where I originally install Atuin, about 2 years ago. Atuin account was created from this machine. I have my atuin key, username, and password.

MacStudio:
Recently acquired, finally setting up Atuin on it. I messed up the original set up because I let it generate its own key and still logged into my existing account - thinking that would automatically allow the 2 machines to sync with each other.

Ubuntu Server 1:
Just like on the MacStudio, I let Atuin do the default workflow, logged into my existing account, thinking that would allow the 3 machines to sync.

I noticed inconsistencies with atuin behavior (based on what I was used to from using it on the Macbook). Thought, oh, I probably didn’t set this up correctly. I’ll re-install and do it right this time. Except I didn’t.

Ubuntu Server 2:
I thought I set this one up correctly from the beginning, but I know I didn’t because there was no history and when I ran atuin sync -f I didn’t get all the history from my Macbook.

I eventually came across the correct way to setup multiple machines, but I have “old stuff” in my Atuin Hub store and I don’t know how to clear that up.

My Macbook is the original, with the long history, that I want to preserve. I don’t care about any captured by my MacStudio or Ubunu Server.

From my Macbook, I followed these instructions by Ellie on how to (hopefully) clear things up. Except it’s not working like I thought it would. I still get “attempting to decrypt with incorrect key” errors.

So, I would like to get some clarification on a couple of things to make sure I understand how this works:

  1. After purge and verify, when I run atuin store push –force , does that overwrite everything in the hub store, or only everything associated with the current key?

I think it’s everything with the current key, rather than “everything” everything.

  1. If so, is there a way to purge my existing hub store of everything and start over with just the existing local history from my Macbook?

  2. Lastly, what do the api_tokens in my hub account signify? I assume every time I logout/login from the CLI, I end up generating a key api_token, but I can’t find any documentation on it.

I think I found the answer:

Starting fresh with sync

If you use sync and want to start completely fresh, --delete-it-all alone is not enough. Atuin sync works by recording every action (including deletions) as encrypted records. Deleting 100,000 entries locally creates 100,000 delete records that still need to sync. When your other machines pull those records, they process every single one, and your database still contains the overhead of all that history.

The cleaner approach is to delete your sync account and start over:

# Delete your sync account and all server-side data
atuin account delete

# Register a new account
atuin register

# Import your shell history fresh (optional)
atuin import auto

This gives you a clean slate on the server with no leftover records. Your other machines can then register with the new account and start fresh too.

If this is the best choice, I have a couple of questions:

  1. Is there some way to preserve the existing history associated with my Macbook? I think that if I just do the steps for account delete, account register, import, then when I sync it should push my local history to the “new” hub account, effectively starting over - correct?

  2. I assume I should probably atuin logout on all the other machines first?

  3. While I realize the other machines have no/very little history right now, should I run atuin earch –delete-it-all from each to clear them completely?

I did not run --delete-it-all.
I did run atuin account delete.
I then ran register, but did not run import.

I ran atuin sync, checked status again, and everything seemed to be ok. Came back a couple hours later, and I got an error when I tried to verify the store. When I look at the status output, I feel like it picked up my old hub account when I registered again - even though I deleted the old account.

atuin store verify

 atuin store verify
Verifying local store can be decrypted with the current key
Failed to verify local store encryption: attempting to decrypt with incorrect key. currently using k4.lid.q_6Sz7yzDUI62aywGLl33WmvAoo282cNOOIjBFwPgksh, expecting k4.lid.x5a6ftdDm9CvFHQMbrvFJAzX94bsrObhCM-XCUXYE9HK

Here’s doctor output

Atuin Doctor
Checking for diagnostics


Please include the output below with any bug reports or issues

{
  "atuin": {
    "version": "18.16.0",
    "commit": "04a5f5fdb67d90e8221accb1c9abace9a1efbb16",
    "sync": {
      "auth_state": "Hub (authenticated)",
      "records": true,
      "auto_sync": true,
      "last_sync": "2026-05-01 19:20:34.752816 +00:00:00"
    },
    "sqlite_version": "3.46.0"
  },
  "shell": {
    "name": "zsh",
    "default": "zsh",
    "plugins": [
      "atuin"
    ],
    "preexec": "built-in"
  },
  "system": {
    "os": "Darwin",
    "arch": "arm64",
    "version": "15.7.5",
    "disks": [
      {
        "name": "Macintosh HD",
        "filesystem": "apfs"
      },
      {
        "name": "Macintosh HD",
        "filesystem": "apfs"
      }
    ]
  }
}

atuin store status

atuin store status
host: 0196834a-c38b-7a51-a692-23b6e250d66e <- CURRENT HOST
	store: history
		idx: 12004
		first: 0196834a-ff47-7253-aed4-67c052373f70
			created: 2025-04-29 15:44:12.487897 -05:00:00
		last: 019de500-11d2-7853-9db0-b1a4371fc2ab
			created: 2026-05-01 14:24:40.274782 -05:00:00

host: 019db32f-ea9a-7d40-a56e-708e9a36578c
	store: history
		idx: 289
		first: 019db32f-eaea-7330-9688-b8eeb021136d
			created: 2026-04-21 22:15:55.242820966 -05:00:00
		last: 019dde71-6416-7ec2-8c65-ac8ade6bec72
			created: 2026-04-30 7:51:06.390128034 -05:00:00

host: 019dcd32-68d2-7203-baa6-9a88ed364b0b
	store: history
		idx: 235
		first: 019dcd32-68d9-7151-8953-ea014c19e335
			created: 2026-04-26 23:28:46.169753603 -05:00:00
		last: 019de3d0-a35c-7c71-a149-380a7d0d7db6
			created: 2026-05-01 8:53:14.588633235 -05:00:00

host: 019dde4c-6a9f-7f90-9373-5646ccfe375b
	store: history
		idx: 4
		first: 019dde4c-6aef-7713-8624-03f0abfeaeb4
			created: 2026-04-30 7:10:43.311237913 -05:00:00
		last: 019dde4d-29c7-7713-8a61-94e6a6c1623c
			created: 2026-04-30 7:11:32.167501145 -05:00:00

host: 019de36f-853e-7a62-a6dc-4a228f487d75
	store: history
		idx: 4
		first: 019de36f-8587-74d3-8bbf-7c8f9c410c0e
			created: 2026-05-01 7:07:09.959144 -05:00:00
		last: 019de37c-9301-7d70-80fd-65ccc7c9218e
			created: 2026-05-01 7:21:25.377976 -05:00:00

host: 019de3d0-cdc2-7b83-87b0-83933b451efd
	store: history
		idx: 7
		first: 019de3d0-dea6-7280-b9da-123c28c9ca24
			created: 2026-05-01 8:53:29.766418 -05:00:00
		last: 019de3e2-7494-7cd0-89a1-3b5f916b53d2
			created: 2026-05-01 9:12:42.26057 -05:00:00

host: 019de3e6-bc62-7d02-a8d3-72c2e0212f9c
	store: history
		idx: 10
		first: 019de3e6-bc8e-7de3-8115-86386ab035d6
			created: 2026-05-01 9:17:22.830276 -05:00:00
		last: 019de3ed-2273-7e50-bac2-0ac8ff5056f6
			created: 2026-05-01 9:24:22.131961 -05:00:00

host: 019de3f5-e699-71e2-8f61-dc6ebc3c8fb5
	store: history
		idx: 1
		first: 019de3f5-e6ca-7a22-a96f-2e18c2256517
			created: 2026-05-01 9:33:56.682271349 -05:00:00
		last: 019de3f6-e218-75e0-82bc-1830bb2b383a
			created: 2026-05-01 9:35:01.016062279 -05:00:00