How can I migrate a KeePassXC two-factor-authentication TOPT code generation from one Linux machine to another?
This answer seems to suggest that copying the database should suffice and work out-of-the-box. Am I understanding it correctly? I can't seem to find relevant details in the KeePassXC user guide.
What I've tried
On 2024.01.06 I attempted to migrate a KeePassXC database (version 2.7.6) between two Ubuntu Mate 22.04 LTS machines, both by copying the Passwords.kdbx found in ~/.config/ and using the save database as then open database in the Database menu of KeePassXC.
Both approaches failed to correctly migrate the 2FA settings. KeePassXC on the target machine could not generate TOPT codes that would be accepted by Github. Github will accept TOTP codes generated by KeePassXC on the original machine, but not the codes generated by KeePassXC on the target machine ("Two-factor authentication failed").
One thing I can confirm is that, after cloning, KeePassXC on the respective machines seems to generate different TOTP codes, although this seems expected as I'm generating them 1-2 seconds apart?
Questions:
- Is this failure surprising? Do KeePassXC migrations via database cloning usually work automatically?
- Am I misunderstanding something basic about TOTP+KeePassXC+Github? If so, is there are more detailed step-by-step walk-through for what I want to achieve?