How to migrate all settings, preferences, histories, layouts, ... _everything_ user related from 2013a to 2014a?
113 views (last 30 days)
Show older comments
Alan Peters on 22 Jul 2014
Commented: IGNACIO on 9 Feb 2023
I spent significant time and effort to get the user interface for v2013a set up exactly the way I wanted it. Plus, my use of matlab is ongoing. What I was doing yesterday using 2013a, I want to continue today using 2014a.
A migration of all user-related info ought to be about the first thing that matlab does when upgrading between versions. But it does not. Therefore there ought to be something inthe installation manual, or at least a README file that explains how to make the yearly transition seamless. If there is something there, I cannot not find it.
According such documentation as I could find, all one has to do is delete the 2014a prefs folder,
and matlab will automatically recreate it and migrate everything from
to the new version.
Well, of course it does not. I've tried manually copying the contents of the 2013a folder to the 2014a folder, but that results in a huge spewing of java errors on the command window when I attempt to open the history window. It appears that nothing at all is migrated.
So, how do I do migrate ALL my settings, histories, layouts, paths, etc. from one version to the next?
Namita Vishnubhotla on 22 Jul 2014
MATLAB preferences will get automatically migrated to new installations, but user-defined preferences will not.
To manually migrate user-defined preferences to a new installation, use the following procedure:
1) In the older installation, execute the command,
2) Look in the directory from step 1 to find a file called 'matlabprefs.mat'.
3) In the newer installation, execute the command,
4) Copy the file from step 2 into the directory from step 3.
Note that this will erase any user-defined preferences in the newer installation.
Will Reeves on 7 Sep 2022
Seriously? How is this an "accepted answer"? Why isn't the answer to this question:
"Yes, sorry for the inconvience we will of course put a check box in the next Matlab installer that will give you the option of copying all your preferences (including java path definitions files) to the new installation"?
I've had/chosen to do this twice a year for over a decade and it's really irratating and unnescessary. And yes, I have submitted a feature request on this topic...
More Answers (4)
Jude Sauve on 2 Jun 2020
The case, as documented, for me was when upgrading by more than 3 half versions, it wouldn't auto update. For me, upgrading from 2018a to 2020a (Three half versions before 2020a was 2018b).
Under C:/Users/<User>/AppData/Roaming/MathWorks/MATLAB/, I found it sufficient to (while all matlabs closed) delete the directory corresponding to my new version, ex 2020a, then rename the dir with my preferences to the oldest "supported" version. Ex rename/F2 the 2018a/ dir to 2018b/. Then on opening the new version of matlab (2020a) it did grab the old preferences from that directory. Then close new matlab (2020a) and change the name of the directory back. (If you don't just delete already).
Alan Peters on 7 Oct 2019
Sanjay Manohar on 15 Sep 2020
@Peter, the directory /RnewV means "R" followed by the new-version number, e.g. "/R2020a"
James Brown on 8 Dec 2020
Migrate preferances from a previous version
Run the old MATLAB version and find the preferance folder
OldFolder = prefdir % run in old version
Run the new MATLAB version and find the preferance folder
NewFolder = prefdir % run in new version
Exit matlab, then zip all the files in NewFolder in case something goes wrong
Copy all the files & folders from OldFolder to NewFolder (overwrite existing files!)
As of migrate to 2020b, everything seems to migrate
I'm using "Home" version, but I'm thinking they'll all work this way except possibly network instalations
I have built a simple application for launching Matlab that can not only migrate preferences, but also have saved preferences for different projects and allow to start Matlab with the preferences (working directory, history, etc.) for the project you want in each moment. This allows me to easily separate history and other settings per project (by the way, I also think this should be a Matlab menu option).
It's far from a fully finished solution, but I been using it daily for 3 years and works like a charm.
Instead of launching directly Matlab, my Direct Access runs my utility, that requires 3 arguments:
--exe=path to matlab executable
--default=where Matlab stores its default environment
--user=where I whant to have my preferences divided by project
MatlabLauncherUPP --exe=D:/MATLAB/R2022b/bin/matlab.exe --default=C:/Users/MyUserName/AppData/Roaming/MathWorks/MATLAB/R2022b --user=C:/Users/MyUserName/MyMatlabPreferences
The application (really small) is written in C++ under Qt-Creator, but could be done in any language as at the end if does a quite simple thing:
It maintains a txt file with one entry per project: "name , last date and hour activated, default working directory" and one directory per project that will be the prefdir (where the settings are saved) when selected.
Upon selection of a project, Matlab is started as a new process with the environment variable MATLAB_PREFDIR pointing to the desired directory, and the working directory pointing to the default working directory. The launch part looks like this, even if you don't know C++ and Qt-SDK I think it's easy to understand:
proc.setProgram(matlabExe); // matlabExe is a QString parsed from command line option --exe=...
proc.setEnvironment(QProcess::systemEnvironment() << env);
When launching Matlab, all the changes in the preferences (history, etc.) will be automatically saved in the PREFDIR by Matlab, so they will be used again when the same project is selected in a new session.
For a new project, the utility allows to create a new entry and to copy the initial settings from an existing project.
Using this small utility, apart of the convenience of having something like separate workspaces or sessions, I've just upgraded from Matlab R2016a to R2022b, and only changed the directories in the launcher to have the same configuration I had.
I forgot to mention, the editor open files are also one the settings that are saved and recovered per project, so each time I launch Matlab from the utility I automatically have in the editor the .m files that are useful for the specific project, what is also very convenient.
Find more on Environment and Settings in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!