Table of Contents

If you intend to reinstall your operating system, your Keybase device configuration must be backed up otherwise you will lose the device. The impact of this may be so harmful that it can lead up to an account reset, which makes you lose all kbfs files, teams, devices and more. Even worse, stuff like teams, device names are permanent and as such cannot be reused. Best of all, I found zero documentation anywhere on the web about how to make a backup of your valuable device configuration. Thereby this is for keybase/client git:

Backing up a Keybase Windows device

Be on the safe side

Grab it all, this includes chat databases and more (not GPG):

%userprofile%\AppData\Local\Keybase
%userprofile%\AppData\Roaming\Keybase

Minimum required to restore device

Replace “username” with your own Keybase username:

%userprofile%\AppData\Local\Keybase\username.ss
%userprofile%\AppData\Local\Keybase\config.json
%userprofile%\AppData\Local\Keybase\secretkeys.username.mpack
%userprofile%\AppData\Local\Keybase\session.json

Lucky225 reported that in newer versions of Keybase the following files are needed:

%userprofile%\AppData\Local\Keybase\username.ss2
%userprofile%\AppData\Local\Keybase\username.ns2
%userprofile%\AppData\Local\Keybase\config.json
%userprofile%\AppData\Local\Keybase\secretkeys.username.mpack

Since developers may be changing the format and locations of configuration files, I can only recommend you backup the installer of the Keybase version you were using at the time of the backup. So you can restore with the same version and then update later. Do I need to mention that your backup better be well encrypted and safely stored?

Restoring a Keybase Windows device

Reinstall Keybase. If Keybase has been automatically started, click the Keybase tray icon and select Quit from the preferences icon in the Keybase client (quitting the main window is not sufficient). Then open Task Manager and kill the following processes in this order:

keybase.exe
kbfsdokan.exe

Copy over the following files from your backups, where “username” was replaced with your own Keybase username:

%userprofile%\AppData\Local\Keybase\username.ss
%userprofile%\AppData\Local\Keybase\config.json
%userprofile%\AppData\Local\Keybase\secretkeys.username.mpack
%userprofile%\AppData\Local\Keybase\session.json

Lucky225 reported that in newer versions of Keybase the following files are needed:

%userprofile%\AppData\Local\Keybase\username.ss2
%userprofile%\AppData\Local\Keybase\username.ns2
%userprofile%\AppData\Local\Keybase\config.json
%userprofile%\AppData\Local\Keybase\secretkeys.username.mpack

Restart Keybase. You may see a “Login” button, if you see one then just click it. Either way you will be logged into your Keybase account automatically using your previous device configuration. Restoring chat databases, imported keys and other stuff is outside the scope of this document, it just handles restoring your previous device so you are not losing it. If you created a full backup as stated above and fiddled with restoring further relevant data - and you would like me to extend (or correct) this document, feel free to msg Chotaire on Freenode or Keybase.

John (kg4zow) has tested backing up and restoring the two entire directories (instead of just the identity files) as stated above and confirmed that it works. However, he had run into issues quitting the client before restoring the files: Clicking the tray icon didn't do anything on Windows 7 (32 bit), thereby he couldn't quit the Keybase client and would be left with open filehandles even after killing the processes. As such he had to uninstall Keybase again and reboot before the destination directories could be replaced, followed by reinstalling Keybase. This means he could simply have done the following: First restore the directories, then install Keybase. He also noted that when reinstalling, it was necessary to run the installer with parameter 'driver=1' for KBFS to work. Thanks for the feedback.