MetaTrader 4 stores its data on the C: drive by default usually in a folder like C:\Users\USER\AppData\Roaming\MetaQuotes\Terminal\<some HASH>. MT4 portable mode lets you change your default data location. You can find your current data file location by clicking the File menu and selecting Open Data Folder.

The Data Folder contains all of your settings, account details, Scripts and Expert Advisors basically any customizations or additions to your MT4 program are stored here. In some cases this location may not be the best place to store this information. For example if you are using historical data for back testing you may run up against space or performance limitations on the C: drive, moving this data to a larger and or faster drive will be necessary. This is where Portable Mode comes in to play.
MT4 Portable Mode
MT4 portable mode gives you the flexibility to run your MT4 terminal from a custom folder on any drive including a USB stick if necessary. Your program files and data will be stored in one convenient place. This allows for moving the program as required and easier backup of your MT4 installation.
To Run MT4 In Portable Mode
Setting up portable mode is a three step process.
- Move your installation folder to the desired location.
- Configure the program shortcut with the /portable parameter.
- Restart or run MetaTrader
Step 1. Copy the installation folder to your preferred location.
In my example I have moved the program folder to E:\pepperstone-portable

Step 2. Update your shortcut and add the /portable switch.
This is where we tell MetaTrader to run in Portable Mode. First right click on your MT4 shortcut and select Properties. Next change your Target location to your new drive or folder and add /portable at the end. Finally change your Start in setting to your new data folder. It is important that your Target and Start in folders match to get the full advantages of portable mode.

Step 3. Restart MT4
If all has gone according to plan your terminal will run and your data folder will now be where you like it! Use File —> Open Data Fold to confirm. This method also works with MT5. If you have already added some data or made changes to your MT4 installation you can copy your old data folder to your new location to restore the settings. However it is recommended that you start portable mode on a fresh install if possible. To copy the old data open your original data location i.e. C:\Users\USER\AppData\Roaming\MetaQuotes\Terminal\<some HASH> data location

Select all files and folders and copy to the new Target / Start In Folder. If asked to replace files and folders choose Yes. Note that if you have a large amount of data from backtesting the copy could take some time.
Hope this helps!