GuideUpdated 27 November 202610 min read

The exact MT4 and MT5 folders to copy to a VPS (Experts, Indicators, Presets, profiles, templates), how to carry them over Remote Desktop and what to redo.

In short
  • Install the broker's terminal on the VPS first, then copy only your own files from File, Open Data Folder on the PC: the Experts, Indicators, Scripts, Presets, Libraries and Files folders inside MQL4 or MQL5, plus profiles and templates.
  • Do not copy the config, history or bases folders: log in again on the VPS and let the terminal download its history.
  • Carry the files in the Remote Desktop session: share a local drive, or turn on the clipboard and paste a zip file.
  • Redo by hand: the account login, automated trading, Allow DLL imports, Allow WebRequest URLs and the MQL5 account.
  • MQL5 Market products do not move as files: install them again from the Market tab, which uses one activation for the new computer.

To move MT4 or MT5 to a VPS, install your broker's terminal on the VPS, then copy only your own files from the PC's data folder (File, Open Data Folder): the program folders inside MQL4 or MQL5, your presets, and the profiles and templates folders. Carry them in the Remote Desktop session with a shared drive or the clipboard, paste them into the same places on the VPS, restart the terminal, and set by hand what does not travel as a file: the account login, automated trading, DLL permission and the licences of MQL5 Market products. On the PC, switch the EA off only when the VPS copy is ready.

Collect the folders on the PC, carry them in the Remote Desktop session, paste them into the VPS terminal's data folder, then redo login, automated trading, DLL and Market activations
Four steps: collect, carry, paste, redo by hand.

What to copy and what to leave behind

MetaTrader keeps your EAs, charts and settings in a data folder that is separate from the program itself (MT4 help). File, Open Data Folder opens it. The installation folder you see under Program Files holds almost nothing of yours.

Folder in the data folderMT4MT5What it holdsCopy it
Expert AdvisorsMQL4\ExpertsMQL5\ExpertsYour EAs (.ex4 / .ex5, and the source if you have it)Yes
IndicatorsMQL4\IndicatorsMQL5\IndicatorsCustom indicators, including those an EA callsYes
ScriptsMQL4\ScriptsMQL5\ScriptsScripts you run by handIf you use them
PresetsMQL4\PresetsMQL5\PresetsSaved EA input sets (.set files)Yes
LibrariesMQL4\LibrariesMQL5\LibrariesLibraries and DLL files some EAs needYes, if the folder has files in it
FilesMQL4\FilesMQL5\FilesFiles an EA reads or writes (state, lists, logs of its own)Yes, if your EA uses it
IncludeMQL4\IncludeMQL5\IncludeSource code pieces used for compilingOnly if you compile on the VPS
ProfilesprofilesProfiles\ChartsSets of open charts with their position and templatesYes
TemplatestemplatesProfiles\TemplatesChart templates, which can include an EA and its inputsYes
Config, history, basesconfig, historyConfig, BasesAccount and server files, price historyNo
Logslogs, MQL4\LogsLogs, MQL5\LogsJournal and Experts logsNo

The MT5 column follows MetaQuotes' description of the MT5 data folder. One MetaQuotes help page places Profiles at the top of the data folder and another inside MQL5: on your own PC, look where it is and put it in the same place on the VPS.

Why not copy everything: the Config folder holds the account and server files of the old install (accounts.dat, servers.dat in MT5), and the history is downloaded again from the broker once you log in. Logging in again takes a minute; a config carried over from another install can leave you guessing which settings came from where.

One more place to check: an EA that shares files between terminals uses a common folder, Terminal\Common\Files (MQL5 reference). In the default mode the data folder sits inside AppData\Roaming\MetaQuotes\Terminal\, and the common folder is Common\Files in that same Terminal folder. If your EA's manual mentions it and the folder has its files, copy that folder as well.

Step 1: collect the files on your PC

Leave the EA running for now.

  1. In the PC terminal, save the current profile under a name you will recognise (File menu, Profiles). The profile records the open charts and the templates on them, including the running EA and its inputs (MT5 help).
  2. For each chart that runs an EA, also save a template from the chart's right-click menu. A template is a second way to bring the EA back on the VPS with the same inputs, chart by chart.
  3. Open File, Open Data Folder.
  4. Create an empty folder on the desktop, for example mt4-move.
  5. Copy into it the profiles and templates folders (MT4) or the Profiles folder (MT5).
  6. Open MQL4 or MQL5 and copy into the same mt4-move folder the subfolders marked "Yes" in the table, keeping their names.
  7. Right-click mt4-move and compress it to a zip file. One file is simpler to carry than hundreds of small ones.

The same procedure is how FXCM describes backing up MT4 before a reinstall: profiles and templates from the data folder, Experts and Indicators from MQL4.

Step 2: get the files onto the VPS

Install the terminal on the VPS before you copy anything, with your broker's own installer, so the server list is already there. Start it once and close it: the first start creates its data folder. If you will run several accounts, install one copy per folder as explained in running multiple MT4 terminals.

Then carry the zip file over. Which way depends on how you connect.

You connect withHow to carry the files
Remote Desktop Connection on WindowsBefore connecting, click Show Options, open the Local Resources tab, click More under local devices and resources, and tick your drives (or only the one with the zip). In the VPS, the drive appears in File Explorer under This PC, with a name such as "C on YOURPC". Or tick Clipboard on the same tab and copy and paste the zip file between the two desktops.
Windows App on a MacShare a folder and the clipboard in the PC's settings in Windows App, as in connecting to a Windows VPS from a Mac.
A phoneNot practical for a zip file: Microsoft's Remote Desktop app copies only text and images through the clipboard on iOS, and only text on Android (Microsoft's client comparison). Do the move from a computer.

Microsoft lists drive and clipboard redirection as supported by the built-in Remote Desktop Connection client. Share only the drive you need: anything you share is readable from the VPS while you are connected. For the connection itself, see connecting to a Windows VPS with Remote Desktop.

Step 3: put the files in the VPS terminal

  1. On the VPS, copy the zip to the desktop and extract it.
  2. Start the terminal, open File, Open Data Folder, then close the terminal and leave the folder window open. Pasting while the terminal is closed avoids it rewriting the profiles on exit.
  3. Paste the profiles and templates folders (MT4) or Profiles (MT5) into the data folder. When Windows asks about files with the same name, replace them.
  4. Open MQL4 or MQL5 and paste your subfolders there. This merges them with the folders the installer created; your own files are added next to the standard ones.
  5. Start the terminal again. Your EAs and indicators appear in the Navigator. If one is missing, right-click the Navigator and refresh.
  6. Switch to your saved profile from the File menu, Profiles. The charts come back with their templates.

If you copied only an .mq4 or .mq5 source without the compiled file, open it in MetaEditor on the VPS and compile it.

Step 4: redo what does not travel as a file

SettingWhereWhy it must be redone
Account loginFile, Login to Trade Account, with the password savedYou did not copy the account files. Without the saved password the terminal will not log in by itself after a restart.
Automated tradingTools, Options, Expert Advisors, the option that allows automated trading; plus the toolbar button (AutoTrading in MT4, Algo Trading in MT5)A fresh terminal may start with it off. With the option to disable automated trading on an account change ticked, logging in can switch it off again: check the button after you log in.
DLL importsTools, Options, Expert Advisors, Allow DLL imports; and in the EA's own settings when you attach it, if it asksAn EA that needs a DLL will not work without it. MetaQuotes advises keeping it off for EAs you do not know: turn it on only for EAs you trust.
WebRequest URLsTools, Options, Expert Advisors, Allow WebRequest for listed URLOff by default. EAs that call a web service (news filters, licence checks, signals) need their addresses listed again.
MQL5 accountTools, Options, CommunityNeeded to run and install Market products on this terminal.
Each EA on its chartThe EA's properties when you attach it, or the saved templateInputs come back with the template or a .set file from Presets; check them before you let the EA trade.

The option names are those of the MT4 help and the MT5 help. If the EA still does not trade, the guide on an EA not trading on a VPS goes through the causes.

EAs bought on the MQL5 Market

A Market product does not move as a file. MetaQuotes binds it to the computer it is activated on: it runs only on the same hardware and operating system (MT5 help). The copy in your PC's Experts folder will not start on the VPS.

FactWhat it means for the move
Each product comes with at least 5 activations, one used at purchase; the seller can set up to 20 (Market rules)Installing on the VPS uses one. Check how many you have left before you start.
Activations are not restored when you remove a product from a computerMoving back and forth between machines uses them up. Decide where the EA will live.
The product must be installed from the terminalOn the VPS: log in with your MQL5 account in Tools, Options, Community, then open the Market tab, go to Purchased and click Install next to the product.
The product is not tied to an account or a terminal on that computerSeveral terminals on the same VPS can run it with any account.

The full procedure is in installing an EA from the MQL5 Market on a VPS. An EA bought outside the Market may have a licence of its own, locked to an account number or to a computer: ask the vendor before the move, not after.

Switch over without trading twice

Two copies of the same EA on the same account, both with automated trading on, can both act on the same signal. Do the change in this order:

  1. On the VPS, check that the account is connected and each EA is on its chart with the right inputs, automated trading still off.
  2. On the PC, turn automated trading off (or close the terminal).
  3. On the VPS, turn automated trading on and watch the Experts tab until the EA prints its first normal messages.
  4. Leave the PC terminal off, or keep it only for watching, logged in with the investor (read-only) password.

Then make sure the terminal comes back by itself after a VPS restart: see autostarting MT4 and MT5 after a reboot.

When this is not the right choice

  • You run one account and do not need your old charts. Moving a whole profile is more work than uploading the EA file and setting it up on a fresh chart. Metatrader In Cloud is built for that case: one MetaTrader 4 or 5, one trading account and as many EAs as you want, uploaded with its file manager.
  • Your EA depends on other software on your PC (a spreadsheet link, a trade copier, a Windows-only tool). That software has to move too, so you need a Windows machine: a Trading VPS, not the Ubuntu-based Metatrader VPS.
  • Your EA needs a DLL. On a Windows VPS such as Trading VPS you allow it as on your Windows PC. Dipgate does not state whether DLL-based EAs run on Metatrader In Cloud or Metatrader VPS: ask support before ordering one of those for such an EA.
  • The EA is licensed to your PC and the vendor will not move it. No folder copy solves that. Settle it with the vendor first.

How this works on Dipgate

  • Trading VPS (Windows). You connect with Remote Desktop using the IP, username (usually "Administrator") and password from the welcome email, so the drive and clipboard method above applies as written. Install your broker's platforms there; for several terminals of the same broker use a different folder each time, as in Dipgate's knowledge-base article. Dipgate sets up autologin; move each platform's shortcut into the "My Platforms Autostart" folder so it starts after a reboot. Plans take up to 3, 6 or 10 trading platforms (Bronze, Silver, Gold), from $20.75/mo, billed annually, on the Trading VPS page.
  • Metatrader VPS (Linux). An Ubuntu desktop with MetaTrader preinstalled, opened with Chrome Remote Desktop instead of Remote Desktop, so Step 2 is different there. Dipgate recorded the upload of an Expert Advisor on this product:
How to Upload and Install an Expert Advisor on Your Dipgate Linux VPS
Video: How to Upload and Install an Expert Advisor on Your Dipgate Linux VPS
  • Metatrader In Cloud. One MetaTrader already running in the browser. You log in to the broker account in the terminal, then upload the EA with the file manager in the side menu (Dipgate's tutorial puts it in MQL5 / Experts / Advisors), refresh the Navigator and drag the EA onto a chart. It holds one trading account, so it fits a move of one account, not of several terminals.

FAQ

Can I copy the whole MetaTrader folder from my PC to the VPS?

The installation folder alone usually does not carry your EAs or charts: in the normal mode they live in a separate data folder. Copying the data folder wholesale also carries the account, server and history files of the old install. Installing the broker's terminal on the VPS and copying only your own files is cleaner.

My EA appears in the Navigator but shows a grey icon or does nothing. What did I miss?

Usually automated trading is off, either the toolbar button or the option in Tools, Options, Expert Advisors. Logging into a different account can also switch it off if the option to disable automated trading on an account change is ticked.

Do I need the .mq4 or .mq5 source file on the VPS?

No. The compiled .ex4 or .ex5 file is what runs. The source and the Include folder only matter if you want to edit and compile on the VPS.

Can I keep the EA running on my PC as a backup?

Not on the same account with automated trading on in both places. Two copies of an EA on one account can each act on the same signal. Keep the PC terminal with automated trading off, or closed.

Does moving to a VPS use up an activation of an EA bought on the MQL5 Market?

Yes. A Market product is bound to the computer it is activated on, and installing it on the VPS uses one activation. Activations are not given back when you remove the product from a computer.