Hey there! So I'm attempting to transfer a client's MODX website over to our servers but am having some odd difficulties.
The client sent me the website in a zip file along with an export of the database.
Here's a few details of the site:
MODX:
Revolution v2.2.14-pl
Plugins:
FormIt v2.2.0-pl
Gallery v1.7.0-pl
getResources v1.6.1-pl
googlesitemap v2.0.2-rc1
MIGX v2.8.1-pl
TinyMCE v4.3.3-pl
Wayfinder v2.3.3-pl
Here are the first steps I took:
- Unpackaged the website.
- Imported the MySQL database.
- Deleted all files and folders inside the core/cache folder.
- Did a search and replace to the files to replace the "MODX core path" with the correct one. (Which resulted in 9 changes across 4 files: config.core.php, connectors/config.core.php, core/config/config.inc.php, and manager/config.core.php)
- Copied the setup folder from the official Rev v2.2.14-pl download.
- Ran the setup with the "Advanced Upgrade Install" option and the "Core package has been manually unpacked" and "Files are already in place" options checked.
and that's where the first problem occurs. After I put in my new database credentials (which I know for sure are correct), and click "Test database server connection and view collations.", nothing happens. Upon checking out my browser console log, I notice there's a 500 (Internal Server Error) for setup/processors/connector.php.
So next, I merge the following folders/files from the official Rev v2.2.14-pl download into the website:
ht.access
connectors/
core/
manager/
setup/
index.php
I ran the setup again and got the same error. Upon looking at the files inside core/cache/logs I found this:
[2016-12-12 09:31:55] (ERROR in xPDOConnection::connect @ /www/sites/athomedsm/core/xpdo/xpdo.class.php : 3054) SQLSTATE[HY000] [2002] No such file or directory
[2016-12-12 09:31:55] (ERROR in xPDOConnection::connect @ /www/sites/athomedsm/core/xpdo/xpdo.class.php : 3054) SQLSTATE[HY000] [2002] No such file or directory
[2016-12-12 09:31:55] (ERROR @ /setup/processors/connector.php) Error preparing statement for query: SELECT `modSystemSetting`.`key` AS `modSystemSetting_key`, `modSystemSetting`.`value` AS `modSystemSetting_value`, `modSystemSetting`.`xtype` AS `modSystemSetting_xtype`, `modSystemSetting`.`namespace` AS `modSystemSetting_namespace`, `modSystemSetting`.`area` AS `modSystemSetting_area`, `modSystemSetting`.`editedon` AS `modSystemSetting_editedon` FROM `modx_system_settings` AS `modSystemSetting` -
[2016-12-12 09:31:55] (ERROR in xPDOConnection::connect @ /www/sites/athomedsm/core/xpdo/xpdo.class.php : 3054) SQLSTATE[HY000] [2002] No such file or directory
[2016-12-12 09:31:55] (ERROR in xPDOConnection::connect @ /www/sites/athomedsm/core/xpdo/xpdo.class.php : 3054) SQLSTATE[HY000] [2002] No such file or directory
[2016-12-12 09:31:55] (ERROR @ /setup/processors/connector.php) Error preparing statement for query: SELECT `modSystemSetting`.`key` AS `modSystemSetting_key`, `modSystemSetting`.`value` AS `modSystemSetting_value`, `modSystemSetting`.`xtype` AS `modSystemSetting_xtype`, `modSystemSetting`.`namespace` AS `modSystemSetting_namespace`, `modSystemSetting`.`area` AS `modSystemSetting_area`, `modSystemSetting`.`editedon` AS `modSystemSetting_editedon` FROM `modx_system_settings` AS `modSystemSetting` -
[2016-12-12 09:31:55] (FATAL) Could not load core MODX configuration!
So then I decided to go ahead and manually update the database credentials inside of core/config/config.inc.php and ran the setup again except for this time I used the "Upgrade Existing Install" option and it worked! I was presented with the following success message:
Config file successfully written.
Config file permissions successfully updated.
So at this point I'm like "Sweet, I'm pretty much done", but then I visit the website in the browser and everything looks good besides that there are missing images. I log into the manager and notice that all of the missing images are used in the Gallery plugin. I checked to see if there was an update available for the plugin but find out that it's already on the latest version.
There's no 404 errors in the console or anything, the URL strings are just missing from the code completely.
So then I decide to go ahead and update the MODX Revolution version to 2.2.15-pl just to see if that fixes it. I clear the cache, merge the files and run the setup again with no problems and still have missing images.
So I go ahead and upgrade to MODX Revolution v2.3.0-pl with the newly added "Disable CSS/JS Compression" option checked. Except this time I receive two errors:
Error creating table for class modUserGroupSetting
Error updating table for class modResource
Array
(
[0] => 42000
[1] => 1061
[2] => Duplicate key name 'cache_refresh_idx'
)
Upon clicking the Retry button, I'm presented with the following errors:
Notice: Trying to get property of non-object in /www/sites/athomedsm/core/xpdo/xpdo.class.php on line 340
Warning: array_merge(): Argument #2 is not an array in /www/sites/athomedsm/core/xpdo/xpdo.class.php on line 340
Fatal error: Class 'xPDODriver_' not found in /www/sites/athomedsm/core/xpdo/xpdo.class.php on line 1867
I tried running the setup again, only to get a blank screen after clicking the Next button, so I take a look at the logs and find this:
[2016-12-12 10:12:02] (ERROR @ /setup/index.php) Could not create table `modx_user_group_settings`
SQL: CREATE TABLE `modx_user_group_settings` (`group` INTEGER unsigned NOT NULL DEFAULT '0', `key` VARCHAR(50) NOT NULL, `value` TEXT NULL, `xtype` VARCHAR(75) NOT NULL DEFAULT 'textfield', `namespace` VARCHAR(40) NOT NULL DEFAULT 'core', `area` VARCHAR(255) NOT NULL DEFAULT '', `editedon` TIMESTAMP NOT NULL ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (`group`,`key`)) ENGINE=MyISAM
ERROR: Array
(
[0] => 42000
[1] => 1067
[2] => Invalid default value for 'editedon'
)
[2016-12-12 10:12:02] (ERROR in xPDOManager_mysql::addIndex @ /www/sites/athomedsm/core/xpdo/om/mysql/xpdomanager.class.php : 329) Error adding index cache_refresh_idx to modResource: Array
(
[0] => 42000
[1] => 1061
[2] => Duplicate key name 'cache_refresh_idx'
)
So from what I gather from that error log is that the MySQL command failed for some reason, so I try running it myself manually:
CREATE TABLE `modx_user_group_settings` (`group` INTEGER unsigned NOT NULL DEFAULT '0', `key` VARCHAR(50) NOT NULL, `value` TEXT NULL, `xtype` VARCHAR(75) NOT NULL DEFAULT 'textfield', `namespace` VARCHAR(40) NOT NULL DEFAULT 'core', `area` VARCHAR(255) NOT NULL DEFAULT '', `editedon` TIMESTAMP NOT NULL ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (`group`,`key`))
and the table 'modx_user_group_settings' is created!
I clear the cache and try to run the setup again and get the blank screen. So I go and checkout core/config/config.inc.php and notice that all of my variables have been replaced with placekeepers:
$database_type = '{database_type}';
$database_server = '{database_server}';
$database_user = '{database_user}';
$database_password = '{database_password}';
$database_connection_charset = '{database_connection_charset}';
$dbase = '{dbase}';
$table_prefix = '{table_prefix}';
$database_dsn = '{database_dsn}';
$config_options = {config_options};
$driver_options = {driver_options};
So that's weird. I replace the file with one I had backed up in version control, clear the cache, and run the setup again...Success! The setup ran without any errors or warnings.
Now this time, the login for the manager looks a little funny to me:
In fact, the whole manager looks funny:
and the images are all still missing.
So I'm not really sure what to do at this point...Any help would be greatly appreciated!