Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save TheoKondak/5e98dc6bed63ed0490d968f929244609 to your computer and use it in GitHub Desktop.
Save TheoKondak/5e98dc6bed63ed0490d968f929244609 to your computer and use it in GitHub Desktop.
How to migrate Logitech HUB Profile details to another Windows Account/Device

The Problem:

I want to use Logitech Hub profiles in multiple Windows accounts and multiple Windows Devices. Logitech Hub allows me to upload a profile linked to my account or public, when I download the profile on the second account/machine, the profile is being assigned to the default profile. I was not able to find a way to reassign macros etc to the actual Application profile.

The Solution:

The problem is that in each instance of Logitech Hub, each app has a unique ID, this ID is not transferable to another instance of the application. Even when I upload a profile to my online Logitech profile when I download it back to my device, it can't assign it to the correct ID, so it stays in the Default profile.

So the only way I found to make it work, is to open the database, extract the JSON data to a place where you can edit them (for example VS Code) and then do the manual work of migrating each macro and setting of each application to the other windows account/machine. A detailed way to do it is below.

⚔️⚰️⚰️⚰️⚰️⚰️⚰️⚰️⚔️

DISCLAIMER

I am not responsible for any data loss or other problems.

This stuff requires some technical know-how and is not an easy process. Some basic knowledge of what an object is ({...}) or what an array is ([...]) is quite useful

Please before doing anything keep in mind that you might end up ruining your current setup and make Logitech Hub crash.

Always keep backups of your original settings.db in a safe place.

⚔️⚰️⚰️⚰️⚰️⚰️⚰️⚰️⚔️

Until recently, the data related to the profiles etc, were in a plain JSON file. In the latest versions of Logitech Hub, the settings are actually in an SQLite file. So in order to open the file, you need some software like DB Browser for SQLite (https://sqlitebrowser.org/dl/). Also, you need an advanced text editor to edit the JSON data. Try VS Code or Notepad++, both are free. I am using VS Code, and thus the shortcuts mentioned below will only apply to VSCode.

The Procedure step by step

This procedure MERGES profiles. So if you copy the data from one machine to the other, unless you start afresh, you will end up with the new and the old macros This procedure is ment for Windows, but it should be similar to any other major OS

  • From System Tray find Logitech Icon right click disable
  • Go to windows services and make sure that no service related to Logitech Hub is running. Right-click stop if some runs (optional)
  • Press ctrl + shift + esc to launch Task Manager, short alphabeticaly, and close all processes related to Logitech Hub (optional)
  • Assign the .db files to the application to open the right file with a double click
  • Open settings.db file (find it in %appdata% -> ..\Local\LGHUB)
  • MAKE A BACKUP of the file. If you lose or corrupt this file you lose all your current profiles and settings. Also, feel free to make backups of the data at any point, it will save you time in case something goes wrong Also make sure you organize your backups in such a way that you know what is what and how to restore it
  • When the DB loads, find "Browse Data" Tab (top left), at the right you will see the JSON code. Keep in mind that depending on your computer, this might take a while and programs might become unresponsive
  • In VS Code you need to create a new JSON file. Press ctrl + N, click on the Select Language... and type JSON
  • Copy the JSON data from DB Browser to VSCode for easier editing

At this point it would be a good idea to save the JSON file and keep a backup as well. In case something goes wrong, this will be a good checkpoint to begin troubleshooting

  • In VS Code press ctrl + k + 0 to collapse all the brackets. Feel free to use that at any point to collapse the brackets. VS Code will keep opening some during the procedure

  • At the left, you will see the number of each line. Keep in mind that this file might be quite large, quite often over 100000 lines of data. The > symbol will appear if you hover with your mouse

    1 > {
12604   }
12605

  • Now you need to find the application you want to migrate. Each Application has an ID applicationId, you can find the right macros using this value
  • To find the App Id you are looking for, hit ctrl + f and then type the name of the application
"applications": {
      "applications": [
        {
          "applicationFolder": "C:\\Program Files\\Epic Games\\Borderlands3",
          "applicationId": "68152248-ccc4-4bab-93c3-140ea036d8be",
          "applicationPath": "C:\\Program Files\\Epic Games\\Borderlands3",
          "categoryColors": [
            {
              "hex": "#fbee13",
              "tag": "Movement"
            },
            {
              "hex": "#f13525",
              "tag": "Combat"
            },
            {
              "hex": "#8d40ff",
              "tag": "Weapons"
            },
            {
              "hex": "#59a4e8",
              "tag": "Social"
            },
            {
              "hex": "#bafcfc",
              "tag": "Miscellaneous"
            },
            .
            .
            .
  • Now use ctrl + k + 0 to collapse the data and start afresh. What you are looking for is the cards array. Press ctrl + F to open search and type "cards": [

If you want to keep things more manageable feel free to create a new JSON file and copy the content of the cards array ([...]) in a new file, and also keep a backup of it. If something is going to go wrong, chances are that this might happen in the next few steps


  • This is how the cards array looks like. It contains objects with data. If the "attribute" has a value of "MACRO_PLAYBACK", it obviously means that its the data that are related to a macro. Now you will need the "applicationId" from a few steps above to locate the macros that are related to the specific app
    "cards": [
              {
    "applicationId": "3f728914-a477-4c98-921d-50ba449b9ded",
    "attribute": "MACRO_PLAYBACK",
    "id": "8f26e77f-9d34-43d4-a8f2-c23d15381509",
    "macro": {
      "onboardable": true,
      "sequence": {
        "defaultDelay": 50,
        "heldSequence": {},
        "pressSequence": {},
        "releaseSequence": {},
        "simpleSequence": {
          "components": [
            {
              "keyboard": {
                "displayName": "F11",
                "hidUsage": 68,
                "isDown": true
              }
            },
            {
              "delay": {
                "durationMs": 50
              }
            },
            {
              "keyboard": {
                "displayName": "F11",
                "hidUsage": 68
              }
            }
          ]
        },
        "toggleSequence": {},
        "useDefaultDelay": true,
        "useSimpleActions": true
      },
      "type": "SEQUENCE"
    },
    "name": "Step in"
  }
             ]

Each Macro etc also has an ID id, but you don't need it for just copying the macros

  • Now find all the macros you want to copy for one application at a time (use applicationId)

    Optionally create a new JSON file for each app you want to copy

  • Then you need to replace the applicationId with a bulk replace ctrl + h in each JSON file from the prev step
  • That's the important part. Each instance of the application (Diff windows account, or machine) assigns different applicationId for the same application, so when you import profiles using your Logitech account, the macros are passed to the Logitech software, but not in the right profile and that's what this guide solves

Now that you have the data, you can migrate them to any other account/machine.


Keep a backup of the settings.db file you are about to migrate the data to in case something goes wrong. This is a critical step.

To do that, follow the procedure from the step where you open the settings.db file, to the step where you find the cards array. "cards": [...] then add the macros and settings you saved during the procedure. Here is where things might go wrong

  • Finally, go back to the JSON file that came from the original settings.db file, and paste the JSON for each application from the prev step where the rest of the macros are saved:

"cards": {
"cards": [
{...I AM A MACRO!...},
{...I AM ANOTHER MACRO!...},
...
]
}

  • Next step, go back to DB Browser and remove the original JSON then copy the code from the file you just edited back to DB Browser and hit apply (right below the text area)
  • Save the changes shift + ctrl + s
  • Relaunch Logitech Hub, all services should restart and the macros should be synced to the right App
  • At this point you will have to re-login to your Logitech account if you use one

Troubleshooting

  • I have finished the process, but the Logitech HUB will not launch.

    That probably means that the database file you just edited is somehow corrupt. This might be caused for a few reasons.
    • First, try to restore your original backup file. Remember you might have to restart the services and application each time you replace the db file, alternatively, do a windows restart
    • If that works, you might want to restart the procedure. Otherwise, if you have backup files from various stages, you can try going through these first
  • My final settings.db file is humongous, its is more than 50MB in size

    This could be because you copied duplicate data. You might want to check your data and see where it went wrong
  • After this process, Logitech HUB became very slow

    If it became slow, it is probably because you have duplicate data. See the step above
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment