RU Русская версия

Moving a MODX website to new hosting: step-by-step guide

Steps for MODX Revolution 2.x and MODX 3: database, files, paths in config.inc.php and config.core.php, the core path in the database, the installer, media sources, and common errors.

  • 10 stepsguide
  • 2.x and 3MODX versions
  • 4 minread

Published by Sergey Polyakov

Was your site hit by the Beget outage?

Where to get a copy of your site, what is happening with domains and email, and what to do without a backup: see OpenCart or MODX site down after the Beget outage.

A MODX website can be moved to new hosting in a few hours if you have the files and the database. This guide covers MODX Revolution 2.x and MODX 3. The main difference from other systems: the path to the core is stored in several files and in the database, and an old cache can break the site completely.

What you need

  • An archive of the site files, including the core folder. If it was moved outside the site root or renamed for security, keep the same folder structure.
  • A MySQL database dump: it holds pages, templates, chunks, and all settings.
  • The PHP version the site ran on before. MODX 2.x with older extras often does not run on PHP 8 without changes.
  • Access to the new hosting: control panel, FTP or SSH, phpMyAdmin.

If you do not have a copy, start with Step 1. Get the site files and a database dump.

Step by step

  1. Create a database and import the dump in phpMyAdmin or over SSH with mysql -u USER -p DBNAME < dump.sql. Keep the same character set as before.
  2. Upload the files, including the core folder, with the same folder structure as on the old server.
  3. Clear core/cache completely before the first launch. The old cache holds paths and settings from the old server.
  4. Edit core/config/config.inc.php. Replace:
    • the database credentials: $database_server, $dbase, $database_user, $database_password, $table_prefix, and $database_dsn, which also contains the host and database name;
    • the paths and URLs: $modx_core_path, $modx_processors_path, $modx_connectors_path, $modx_manager_path, $modx_base_path, $modx_assets_path, and, if the domain changes, $http_host and the $modx_*_url variables. The MODX_CORE_PATH, MODX_BASE_PATH, and other constants are built from these variables.
  5. Edit the three config.core.php files: in the site root, in the manager folder, and in the connectors folder. Set the new path to the core folder in each.
  6. Fix the core path in the database. The old path is also stored in the path field of the modx_workspaces table (with your table prefix). If it holds a full path from the old server rather than {core_path}, replace it. Otherwise extras cannot be installed or updated.
  7. Or use the installer instead of steps 4⁠–⁠6. Upload the setup folder for the same MODX version and run the installer and choose “Advanced Upgrade Install”. It rewrites the paths and credentials in the files and in the database, including the modx_workspaces table. Delete the setup folder afterwards.
  8. Check system settings and media sources in the manager: they may contain absolute paths from the old server. Then use Manage → Clear Cache.
  9. Recreate scheduled tasks. Cron jobs do not move with the files: sync with your ERP and back-office systems, newsletters, and catalog updates need to be added again in the new host’s control panel.
  10. Test the site: clean URLs (Friendly URLs in MODX settings; rename ht.access to .htaccess if that was never done), contact forms and their emails, and the cart if there is one.

If the site runs on MODX Evolution, credentials and paths are in manager/includes/config.inc.php, or in the core/config folder in Evolution CMS 2.x.

Common errors after the move

What you seeLikely cause
“MODX not installed” or a blank pageOld paths in config.core.php or config.inc.php
The manager has no styles, the resource tree is emptycore/cache was not cleared or the connectors path is wrong
Every page except the home page returns 404No .htaccess or no rewrite rules for nginx
Images do not load in the managerA media source with an old absolute path
Extras cannot be installed or updatedAn old core path in the modx_workspaces table
Form emails do not arriveEmail sending is not set up on the new server, or the domain’s SMTP server is needed
Catalog and back-office data do not updateScheduled tasks were not recreated

After the move

  • Change admin, database, FTP, and SSH passwords.
  • Check the basic technical SEO: www and non-www merged, canonical tags, the sitemap. See our guide to MODX SEO setup.
  • Check crawl errors in Yandex Webmaster and submit key pages for recrawling.
  • Set up daily database backups stored with another provider and uptime monitoring. Both are part of our website support.
From our work

A company website on MODX was on Beget shared hosting and was down for three days. Once Beget restored the site and access, at the client’s request we updated the site, changed all passwords, and set up backups stored outside the hosting provider.

We build, improve, and move MODX websites: see MODX development and support. For OpenCart, see our separate guide to moving OpenCart.

More articles

Step-by-step guides: domain, hosting, email, maps, and MODX setup.

All articles

Let’s talk

Want us to move your MODX website? Send us the site address, and we will reply within one business day with a plan and a price.

  • Emailinfo@studiops.ru
  • Messaging app
  • OfficeBalashikha, Moscow Region, Russia
    Mon–Fri, 8 a.m.–5 p.m. Moscow time (UTC+3)
What can we help with?