Clear Filters
Clear Filters

How to migrate all settings, preferences, histories, layouts, ... _everything_ user related from 2013a to 2014a?

64 views (last 30 days)
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,
C:\Users\<user name>\AppData\Roaming\MathWorks\MATLAB\R2014a
and matlab will automatically recreate it and migrate everything from
C:\Users\<user name>\AppData\Roaming\MathWorks\MATLAB\R2013a
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?

Accepted Answer

Namita Vishnubhotla
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,
>> prefdir
2) Look in the directory from step 1 to find a file called 'matlabprefs.mat'.
3) In the newer installation, execute the command,
>> prefdir
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.
Peter Cervelli
Peter Cervelli on 7 Oct 2019
Please answer Eric's question from October 6, 2019 -- I'm suffering from the same issue. I spent a lot of time setting preferences so that they're exactly the way I want them, and it's very frustrating to fire up the latest version of Matlab only to find that they've been completely ignored. I've been using Matlab more or less continuously since 1996, and I manage a group of users comprising more than 30 licenses so a quick answer to Eric's question is pretty important to me.
Will Reeves
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...

Sign in to comment.

More Answers (4)

Jude Sauve
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
Alan Peters on 7 Oct 2019
Here is a way to do the migration manually that has worked for me in the past. The instructuctions are below and they are in the text file that I have attached to this note.
How to migrate history and preferences to from an older version of Matlab to a newer one.
In the following I refer to the old version as RoldV (e.g. R2017a) and the new version as
RnewV (e.g. R2018a).
1) Open the new version of matlab and then exit it.
2) Go to "C:\Users\<user name>\AppData\Roaming\MathWorks\MATLAB\RnewV"
and delete the file, "History.xml".
3) Copy the entire contents of "C:\Users\<user name>\AppData\Roaming\MathWorks\MATLAB\RoldV"
to the RnewV folder listed above. Permit overwriting of like-named files.
4) Go to "C:\Program Files\MATLAB\RoldV\toolbox\local" and open "pathdef.m" in a text editor.
5) Go to "C:\Program Files\MATLAB\RnewV\toolbox\local" and open its "pathdef.m" file in a text editor.
6) From the first file (the RoldV version) copy everything after "%%% BEGIN ENTRIES %%%'
but before "matlabroot,'\toolbox\matlab\testframework;', ...".
7) Paste that info after "%%% BEGIN ENTRIES %%%' in the second file (the RnewV version).
8) Save the second file.
9) Open matlab. It will give you an error about the path cache being corrupt.
10) Close matlab.
11) Open matlab.
As far as I can tell, everything has now been migrated from RoldV to RnewV.
Bruce Stirling
Bruce Stirling on 19 Feb 2020
Given the number of steps you'd think Mathworks would build a routine. And migrating to a new PC platform requires the same thing. Maybe a routine that puts all these files in a .zip and then you can copy that one over and unzip would be a good solution.

Sign in to comment.

James Brown
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!)
Restart matlab
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

IGNACIO on 9 Feb 2023
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:
void MainWindow::on_qGoPushButton_clicked()
MyProjectsListWidgetItem* selectedProject=GetSelectedProject();
QString env=QString("MATLAB_PREFDIR")+"="+selectedProject->preferencesPath;
QProcess proc;
proc.setProgram(matlabExe); // matlabExe is a QString parsed from command line option --exe=...
proc.setEnvironment(QProcess::systemEnvironment() << env);
qint64 pid;
if (proc.startDetached(&pid))
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.
  1 Comment
IGNACIO on 9 Feb 2023
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.

Sign in to comment.


Find more on System Commands 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!