I have just installed Libre Office on a new Linux Mint desktop, and in order to get my macros on the new Libre Office I copied the folder
Home/.config/libreoffice/4
to the new PC, but at the first try to run a macro of mine on a Calc file on the new PC I got the error message attached
Have a look at ~/.config/libreoffice/4/user/basic/Standard. There should be one .xba file for each Basic module. If the modules are there but invisible in the dialogs and macro editor, you can fix the modules registration: Where did all my macros go? - #6 by Regina
Go to Tools - Macros - Organize Macros - LibreOffice Basic and click the Organizer button. In the Libraries tab, select your library (e.g., BIB001) and click the Export button. Select the Export as extension option and click OK to save your extension with a name, for example, NAME-BIB001.
The exported file will be named NAME-BIB001.oxt. Copy this file to the new machine and double-click to install.

See Organizing Libraries and Modules :
Application Macros : libraries stored in this container are available for all users of the computer and are managed by the computer administrator. The container is located in the LibreOffice installation directory.

I would suggest to not try it this way. The installation of LibO (newer version? …?) on the new computer (new OS version?) creates a rather cryptic large file named registrymodifications.xcu containing lots of informations of which some may be specific to the situation on the new computer and incompatible with the previous situation.
Your proceeding will overwrite this file with the one from the old computer, and there may arise conflicts.
Take the time to inspect the old profile (/user/) and to move only selected content (folders) to the respective location of your profile on the the new computer:
/autocorr/ containing your autocorrection settings
/autotext/ containg your autotext objects
/basic/ containing your basic scripts and the structure they are placed in
/template/ containing your registered templates
/Scripts/ if applicable containing your non-Basic scripts .
= =
Test the result after each listed step.
Some additional steps of copying may be useful if you had created user defined dictionartys or color palettes, or …
= =
Do not copy registrymodifications.xcu .
Because this file will be already overwritten by your actions, it will be necesary to uninstall LibO on the new computer and to install it anew before you continue as described above.
< edit >
Without re/new install:
Rename the user profile (user to user.old e.g.) on the new computer and call your newly installed LibO.
This will creatw a new default user profile with minimal content in the same place.
Close LibO then and continue with the above describad steps.
< /edit >
Specifically experienced users:
Please post your critique and corrections.
I did as you said Lupp but with no avail: I restored the default user in the new installation and then copied only the /basic/ folder from my old .config/libreoffice/user to the new one but still my macros there are not in the new installation of LO Calc.
PS: In the old .config/libreoffice/user folder in addition to the basic folder (the one I copied) there is also a basic1 one (that looks empty)…
Sorry! No clue.
I personally run one LibO with two different user profiles (using the option
-env:UserInstallation= and moving one of the described subfolders between both profies, it works as I described it.
That’s true even between user profiles for my recent 25.8.4 and old 32-bit portable versions (4 or higher) which I keep for such experiments.
However, I have no Linux Mint at hand to do further testing.
