Backup Keyboard Maestro -- Export ALL Macros, Clipboards and Variables

Hello,

... and sorry to ask this question again (I'm not sure of myself! ...):

How can I be sure to make a full backup of all Macros, Clipboards and Variables for installation on a new Mac?.

What are the differences between .kmlibrary and .kmmacros?

Thank you for your insights (and again sorry to ask this recurrent question).

Sylvain

1 Like

See the wiki: How do I backup / transfer my installation to another Mac?


EDITED 2018/09/07 09:47 CDT
    - Added some instructions.


Hey @tempo,

Below is an AppleScript packaged as a shell script, so it can be run from the Terminal.

Unzip it, and place it here:

/usr/local/bin/

This path might not be in the path set up on your system, and you can find out by pasting this into the Terminal.app and hitting Return:

echo $PATH

If usr/local/bin is NOT in your path then see this post:

Create a PATH Environment Variable for Keyboard Maestro and Add /usr/local/bin to the Default Path


Once your $PATH is squared away:


Rename the script file to something simple and mnemonic like:

kmbak

Then you can run it from the Terminal by just typing the name and Return.

I would just run it as a macro, BUT it's safer to quit the Keyboard Maestro Engine before backing up Keyboard Maestro's bits and pieces – and KM doesn't function without its engine running.

~/Library/Application Support/Keyboard Maestro/
~/Library/<Keyboard Maestro plist files>

These are placed in a dated folder on the Desktop.

You can examine the script file in any text editor.

I've marked it as executable which is required to run from the Terminal – so the system might complain it's from an “unknown developer” and make you authenticate it.

(I can help if you have any permissions issues.)

NOTE – I run my copy from FastScripts rather than the Terminal.

Let me know if you have any problems or questions.

-Chris


Download ⇢ Backup_Keyboard_Maestro_To_Desktop.sh.zip (2.2 KB)
Backup_Keyboard_Maestro_To_Desktop.sh.zip

2 Likes

Thank you very mush!... :wink:

Post #3 EDITED 2018/09/07 09:47 CDT
    - Added some instructions.

-ccs

I have my old ~/Library/Application Support/Keyboard Maestro folder on an external drive. How do I add it to the new installation? I tried just replacing the folder, but the macros aren't showing up.

See:

How do I backup / transfer my installation to another Mac?

The easiest way would be to launch Keyboard Maestro once on the target Mac which would create the folder, and then in Keyboard Maestro select Help ➤ Open Preferences Folder. Then quit Keyboard Maestro Engine (File ➤ Quit Engine) and Keyboard Maestro. Then find the old Keyboard Maestro Macros.plist file and copy it over the existing new small Keyboard Maestro Macros.plist file. Then relaunch Keyboard Maestro.

Be careful that you don't accidentally destroy your backup!

1 Like

Thanks Peter. That worked great.

1 Like

I needed to run your script but if I do it I get this error:

Do you know how I can give these permissions so the script runs?

By enabling "Full Disk Access" for the Terminal app under System Setting > Privacy & Security, I was able to bypass this error in macOS Sonoma.

Hi, I just got a new Mac and copying a few KM files and folders from my previous machine allowed me to immediately find all my workspaces, for each of my applications. A real joy !… :wink: