Version Migration Assistant


The migration assistant allows you to migrate your code from one version of Mathematica to another. This helps to pick up new improvements in functionality in a new release.

For example, in Mathematica 5.2 the function to generate a random number was Random[]. In Mathematica 6 a new function RandomReal[] was introduced. The migration assistant uses pattern searching/replacing technology to make changes to your code.

To apply the migration assistant select a file, folder, or project in a view such as the Package Explorer view. Right-click and choose Refactor > Migrate to 6.0...; a view of the menu is shown below.

Migration

When the assistant opens, it shows all the patterns that are available. If you do not want to run them all, you can deselect some. A sample view of the assistant is shown below.

Migration

When you click Preview this lets you see what changes are suggested for each source file. You can accept or reject changes to source files. When they are accepted the changes are made, though, of course, you can always use the undo or restore from local history to regain your original files.

Before migration some of the code might look as follows.

Migration

After migration it has been changed to the following.

Migration