Error while migration to new server

Summary

Migrate from dev to live server

Step to reproduce

1 install MODX on server B with fresh database BD2
2 export database BD1 from dev (A) to new server (B)
3 copy assets from A to B
4 install plugins on A also on B
5 Copy database from server A → DB1 and copy into new server B → database 3 DB3
6 on server B change database from BD2 to BD3
7 Run setup and upgrade existing install

Observed behavior

This should work according to this video.

Expected behavior

I get an error

/home/me/domains/domein.nl/public_html/setup/includes/drivers/modinstalldriver_mysql.class.php on line 192

Fatal error: Uncaught ArgumentCountError: Too few arguments to function modInstallDriver_mysql::addIndex(), 2 passed in 

/home/me/domains/domein.nl/public_html/setup/includes/upgrades/mysql/2.0.0-alpha-1.php on line 55 and exactly 3 expected in
/home/me/domains/domein.nl/public_html/setup/includes/drivers/modinstalldriver_mysql.class.php:192 Stack trace: #0 
/home/me/domains/domein.nl/public_html/setup/includes/upgrades/mysql/2.0.0-alpha-1.php(55): modInstallDriver_mysql->addIndex('`modx_membergro...', 'parent') #1 
/home/me/domains/domein.nl/public_html/setup/includes/modinstallversion.class.php(77): include_once('/home/me...') #2 
/home/me/domains/domein.nl/public_html/setup/includes/runner/modinstallrunnerweb.class.php(37): modInstallVersion->install() #3 
/home/me/domains/domein.nl/public_html/setup/includes/runner/modinstallrunner.class.php(40): modInstallRunnerWeb->execute(1) #4 /home in 
/home/me/domains/domein.nl/public_html/setup/includes/drivers/modinstalldriver_mysql.class.php on line 192

Environment

modx 2.7.1-pl | php 7.2 | phpmyadmin 10.2.13-MariaDB - MariaDB Server |

You have probably done all the things covered in this document, but there are a few you have not mentioned, like updating config file paths and clearing cache, checking file and folder permissions etc, so it might be worth having a quick look through and seeing if there is anything you could have missed.

https://docs.modx.com/revolution/2.x/administering-your-site/moving-your-site-to-a-new-server

Thanks Andy,

  • The fresh install on server B is working fine with an empty install. With empty I mean, no content, just MODX. So I’m assuming all folder permissions are set right.
  • I deleted the cache
  • Patch is set right since the clean install works

if (!defined(‘MODX_MANAGER_PATH’)) {
$modx_manager_path= ‘/home/me/domains/domein.nl/public_html/manager/’;
$modx_manager_url= ‘/manager/’;
define(‘MODX_MANAGER_PATH’, $modx_manager_path);
define(‘MODX_MANAGER_URL’, $modx_manager_url);
}

Also checked other config files and path all good.

/config.core.php
/connectors/config.core.php
/manager/config.core.php

I hope MODX community would make more simple HOW TO video’s.

To make myself clear; the MODX install on dev is on the same hostingserver as live.

1 Like

One possible issue is related to how you transferred the MODX files to the new server. Moving them individually with FTP often results in missing or corrupted files. If you zipped up the files and then unzipped them on the new server, this isn’t the issue, though it’s possible that there’s a hard-coded path somewhere that’s causing the problem.

Sometimes a leftover browser cache file or cookie causes trouble so it might be worth trying to run setup again after clearing the browser cache and cookies.

The only other thing I can think of is the possibility that one of your plugins is causing trouble for setup. I’ve seen this at least once. You can disable the plugins in the modx_plugins table in the DB. Manually delete all the files in the core/cache directory after making the change before you re-run setup.

1 Like

Maybe I’m misunderstanding but it does seem an odd way to move / copy a site. Surely if you reinstall plug-ins on the new version of the site, they will have a different index and that will cause problems when using the duplicated database?

1 Like

Tried all that. No succes. I tried another way to migrate using the “Context Export” plugin, that one doesn’t work on this install (Context Export does work on another modx install of mine)

I just wish one day, there would be a simple way to export the theme and export the content from one MODX install to another MODX install.

1 Like

I usually just zip up all the files on the server, download then download the database. I then upload to new location and copy the contents of the database to the new database. Yes, I get problems but usually it’s my fault for getting a path wrong. Occasionally I need to run set-up if in a completely new environment.

1 Like

The steps to move a site – as outlined in the doc that Andy linked to – are significantly different than the steps in that video you followed. I watched the video and it did not align with any way I’ve ever moved a site; I found it confusing. It seems you’re trying to populate an already installed site with your content and database rather than putting the assets and db in place prior to running setup…?
Anyway - I bet you’d have better luck starting over and following the docs rather than that video.

1 Like

Thanks Andy

  • I zipped all the files on dev and moved to live
  • Made a copy of the database and inserted on live
  • set /cache/ to 777

And the site is running. Now I run into another problem, my user is blocked :slight_smile:
In the database Tabel: modx_user_attributes I set blocked to 0 but this can’t login. I also set blockeduntil to 0.

UPDATE: 22:41 Site is running on the live install, and I got access to the manager. Thank you all!

1 Like

I’m glad you got it working. :slight_smile: I think Lucy is probably the person to thank.

FWIW, on most servers these days, 755 would be the correct permission for folders (and 644 for files). Depending on how the server is set up, it could balk at serving from 755 folders. You wouldn’t necessarily see the problem since MODX would probably serve from the DB if the cache weren’t available, but it would definitely slow down the site.

2 Likes

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.