Migrating Settings in Eclipse

By Sol in Know

Eclipse is a highly customizable IDE and over time, I’ve tweaked the workspace settings quite a bit so that I can work as smoothly as possible.  Fortunately, migrating those settings to a new workspace is pretty straightforward.

The Built-in Method

Now, you could just use the built-in method of exporting/importing your preferences by using the option provided at File > Export > General > Preferences.  This will save your preferences to an .epf file that can be imported in Eclipse using the File > Import command.  However, this method is fairly limited in regards to exporting just a subset of settings, so if you just want to migrate your syntax highlighting settings for a particular plugin, you won’t have much luck with this method.

The Modular Method

All of a workspace’s settings are stored in {Workspace Directory}\.metadata\.plugins\org.eclipse.core.runtime\.settings.  In this directory you’ll find a bunch of .prefs files– each of which contain settings for specific parts of an Eclipse workspace.  This allows you to migrate settings from one workspace to another modularly.

For example, if I want to copy the UI settings for PHP Developer Tools from one workspace to another (which includes syntax highlighting settings for the PHP editor), I just copy org.eclipse.php.ui.prefs into the respective directory in the new workspace and we’re good to go.

It would be nice if there were a more integrated way to migrate specific settings from one workspace to another, but at least now you (I) won’t have to wait so long to update Eclipse next time because you (I) know that migrating customized settings is a quick and painless process.