Installing Modx 2.5.0

I have a client that let there hosting expire and her account went offline and the account was deleted completely. She’s asked me to restore the site, but the most recent version of her site that I can find is built with Modx 2.5.0

So I’m installing 2.5.0. Installation completes with no errors, but the site and the manager are giving 503 errors. After checking all the config files, paths, etc. I finally found errors in the cache error logs that indicate three tables do not exist in the db or have no content.

I’ve rerun the setup multiple times. Deleted the database and started over completely, yet these same tables are missing: modx_access_policies, modx_session, modx_content_type.

I also changed the php version back to 5.4 which about what 2.5.0 might have expected.

I downloaded the modx install package from the modx previous versions page. Is it possible this is corrupted somehow?

I’m stumped.

Please post full errors. “that indicate three tables do not exist in the db or have no content” sounds of interest but is hard to interpret without any details.

For (server-generated) 50x errors, also check your server/PHP error logs, typically available from a server control panel or an error_log file somewhere on the filesystem.

When installing, make sure to check the errors in the final step. There may also be a copy of the installation log in core/cache/logs; look for the timestamp in the file name.

My guess is the tables that are missing have a structure incompatible with the database version. Since MODX 2.5, database servers have become more strict by default and while MODX has adapted to that, you are installing an old version of MODX that doesn’t have those changes, so that might be why it fails to create them.

Could try installing the latest 2.8.3 nightly (as 2.8.2 has some issues and 2.8.3 hasn’t yet been released), and importing the database into that. Make sure to only import data, not structure. Might need some manual tweaking for incompatible data rows.

Mark

Thanks for the fast response.

I’m not sure how to import just the data in to a current version of Modx or any manual tweaking . . .

Here’s the server error log and the modx/core/cache/error.log.

I replaced the account name and database name with xxx’s

    [Wed May 12 11:16:01.721304 2021] [include:error] [pid 32124:tid 47900017854208] [client 72.50.194.68:56522] unable to include "cp_errordocument.shtml" in parsed file /home/xxxxxxx/public_html/404.shtml, subrequest returned 404, referer: http://xxxxxxx.org/
    [Wed May 12 11:13:01.889665 2021] [include:error] [pid 32124:tid 47900100933376] [client 72.50.194.68:55400] unable to include "cp_errordocument.shtml" in parsed file /home/xxxxxxx/public_html/404.shtml, subrequest returned 404, referer: http://xxxxxxx.org/
    [Tue May 11 14:16:11.416084 2021] [include:error] [pid 5586:tid 47954729649920] [client 72.50.194.68:59956] unable to include "cp_errordocument.shtml" in parsed file /home/xxxxxxx/public_html/403.shtml, subrequest returned 404
    [Tue May 11 14:16:11.413809 2021] [autoindex:error] [pid 5586:tid 47954729649920] [client 72.50.194.68:59956] AH01276: Cannot serve directory /home/xxxxxxx/public_html/core/: No matching DirectoryIndex (index.php,index.php8,index.php7,index.php5,index.perl,index.pl,index.plx,index.ppl,index.cgi,index.jsp,index.jp,index.phtml,index.shtml,index.xhtml,index.html,index.htm,index.js) found, and server-generated directory index forbidden by Options directive
    [Tue May 11 13:42:08.808389 2021] [include:error] [pid 2733:tid 47954765371136] [client 72.50.194.68:52019] unable to include "cp_errordocument.shtml" in parsed file /home/xxxxxxx/public_html/404.shtml, subrequest returned 404, referer: http://xxxxxxx.wwwmi3-ss60.a2hosted.com/manager/
    [Tue May 11 13:38:12.891061 2021] [include:error] [pid 11484:tid 47954733852416] [client 72.50.194.68:51166] unable to include "cp_errordocument.shtml" in parsed file /home/xxxxxxx/public_html/404.shtml, subrequest returned 404, referer: http://xxxxxxx.wwwmi3-ss60.a2hosted.com/manager/index.php
    [Tue May 11 13:36:33.889072 2021] [include:error] [pid 18161:tid 47954744358656] [client 72.50.194.68:50945] unable to include "cp_errordocument.shtml" in parsed file /home/xxxxxxx/public_html/404.shtml, subrequest returned 404, referer: http://xxxxxxx.wwwmi3-ss60.a2hosted.com/manager/index.php               


[![](https://mi3-ss60.a2hosting.com:2083/cpsess7848146953/frontend/paper_lantern/filemanager/close.jpg)](javascript:top.window.close())

# ![text/x-log](https://mi3-ss60.a2hosting.com:2083/cpsess7848146953/frontend/paper_lantern/mimeicons/text-x-log.png) error.log ( ASCII text )


text/x-log error.log ( ASCII text )
[2021-05-12 11:16:00] (ERROR @ /home/xxxxxxxxx/public_html/core/xpdo/om/xpdoobject.class.php : 240) Error 42S02 executing statement: 
Array
(
    [0] => 42S02
    [1] => 1146
    [2] => Table 'xxxxxxxxx_modx.modx_context_setting' doesn't exist
)

[2021-05-12 11:16:00] (ERROR @ /home/xxxxxxxxx/public_html/core/xpdo/om/xpdoobject.class.php : 240) Error 42S02 executing statement: 
Array
(
    [0] => 42S02
    [1] => 1146
    [2] => Table 'xxxxxxxxx_modx.modx_access_policies' doesn't exist
)

[2021-05-12 11:16:00] (ERROR @ /home/xxxxxxxxx/public_html/core/xpdo/om/xpdoobject.class.php : 240) Error 42S02 executing statement: 
Array
(
    [0] => 42S02
    [1] => 1146
    [2] => Table 'xxxxxxxxx_modx.modx_session' doesn't exist
)

[2021-05-12 11:16:00] (ERROR @ /home/xxxxxxxxx/public_html/core/xpdo/om/xpdoobject.class.php : 240) Error 42S02 executing statement: 
Array
(
    [0] => 42S02
    [1] => 1146
    [2] => Table 'xxxxxxxxx_modx.modx_access_policies' doesn't exist
)

[2021-05-12 11:16:00] (ERROR @ /home/xxxxxxxxx/public_html/core/xpdo/om/xpdoobject.class.php : 240) Error 42S02 executing statement: 
Array
(
    [0] => 42S02
    [1] => 1146
    [2] => Table 'xxxxxxxxx_modx.modx_content_type' doesn't exist
)

[2021-05-12 11:16:00] (FATAL) The requested resource has no valid content type specified.
[2021-05-12 11:16:00] (ERROR @ /home/xxxxxxxxx/public_html/core/xpdo/om/xpdoobject.class.php : 240) Error 42S02 executing statement: 
Array
(
    [0] => 42S02
    [1] => 1146
    [2] => Table 'xxxxxxxxx_modx.modx_session' doesn't exist
)

[2021-05-12 11:16:00] (ERROR @ /home/xxxxxxxxx/public_html/core/xpdo/om/xpdoobject.class.php : 1452) Error 42S02 executing statement:
INSERT INTO `modx_session` (`id`, `access`, `data`) VALUES ('c2b76813e50be1c82fc37a8378ca67b9', 1620832560, '')
Array
(
    [0] => 42S02
    [1] => 1146
    [2] => Table 'xxxxxxxxx_modx.modx_session' doesn't exist
)

[2021-05-12 13:30:37] (ERROR @ /home/xxxxxxxxx/public_html/core/xpdo/om/xpdoobject.class.php : 240) Error 42S02 executing statement: 
Array
(
    [0] => 42S02
    [1] => 1146
    [2] => Table 'xxxxxxxxx_modx.modx_context_setting' doesn't exist
)

[2021-05-12 13:30:37] (ERROR @ /home/xxxxxxxxx/public_html/core/xpdo/om/xpdoobject.class.php : 240) Error 42S02 executing statement: 
Array
(
    [0] => 42S02
    [1] => 1146
    [2] => Table 'xxxxxxxxx_modx.modx_access_policies' doesn't exist
)

[2021-05-12 13:30:37] (ERROR @ /home/xxxxxxxxx/public_html/core/xpdo/om/xpdoobject.class.php : 240) Error 42S02 executing statement: 
Array
(
    [0] => 42S02
    [1] => 1146
    [2] => Table 'xxxxxxxxx_modx.modx_session' doesn't exist
)

[2021-05-12 13:30:37] (ERROR @ /home/xxxxxxxxx/public_html/core/xpdo/om/xpdoobject.class.php : 240) Error 42S02 executing statement: 
Array
(
    [0] => 42S02
    [1] => 1146
    [2] => Table 'xxxxxxxxx_modx.modx_access_policies' doesn't exist
)

[2021-05-12 13:30:37] (ERROR @ /home/xxxxxxxxx/public_html/core/xpdo/om/xpdoobject.class.php : 240) Error 42S02 executing statement: 
Array
(
    [0] => 42S02
    [1] => 1146
    [2] => Table 'xxxxxxxxx_modx.modx_session' doesn't exist
)

[2021-05-12 13:30:37] (ERROR @ /home/xxxxxxxxx/public_html/core/xpdo/om/xpdoobject.class.php : 1452) Error 42S02 executing statement:
INSERT INTO `modx_session` (`id`, `access`, `data`) VALUES ('2c29baa3376cc2e4a7213f23b135ffb3', 1620840637, '')
Array
(
    [0] => 42S02
    [1] => 1146
    [2] => Table 'xxxxxxxxx_modx.modx_session' doesn't exist
)


[2021-05-12 13:30:37] (ERROR @ /home/xxxxxxxxx/public_html/core/xpdo/om/xpdoobject.class.php : 240) Error 42S02 executing statement: 
Array
(
    [0] => 42S02
    [1] => 1146
    [2] => Table 'xxxxxxxxx_modx.modx_session' doesn't exist
)

[2021-05-12 13:30:37] (ERROR @ /home/xxxxxxxxx/public_html/core/xpdo/om/xpdoobject.class.php : 240) Error 42S02 executing statement: 
Array
(
    [0] => 42S02
    [1] => 1146
    [2] => Table 'xxxxxxxxx_modx.modx_access_policies' doesn't exist
)

[2021-05-12 13:30:37] (ERROR @ /home/xxxxxxxxx/public_html/core/xpdo/om/xpdoobject.class.php : 240) Error 42S02 executing statement: 
Array
(
    [0] => 42S02
    [1] => 1146
    [2] => Table 'xxxxxxxxx_modx.modx_session' doesn't exist
)

[2021-05-12 13:30:37] (ERROR @ /home/xxxxxxxxx/public_html/core/xpdo/om/xpdoobject.class.php : 1452) Error 42S02 executing statement:
INSERT INTO `modx_session` (`id`, `access`, `data`) VALUES ('3a0954f2b18d9339c046d87354ab4d0d', 1620840637, '')
Array
(
    [0] => 42S02
    [1] => 1146
    [2] => Table 'xxxxxxxxx_modx.modx_session' doesn't exist
)

Export the database to SQL, import the exported SQL into a clean 2.8 installation. Shouldn’t be too hard to do with a database admin tool like phpmyadmin or sequal ace or any other.

The manual tweaking is to deal with any conflicts. If it tells you it can’t import row X because field Y is invalid, you’ll need to change row X to allow it to be imported.

[2021-05-12 11:16:00] (FATAL) The requested resource has no valid content type specified.

This ^ looks like what’s probably the cause for the 503 (caused by the inability to create the tables), so once you install 2.8 and import your data that should be resolved.

Mark

So import the entire database. That I can do. I thought you meant something more selective. I’ll give it a try later today (hopefully).

Finally got back to this.

I installed 2.8.2 with no errors, the manager came up and I could log in.

Next I uploaded the assets folder from the 2.5.0 site, manually cleared the core/cache folder, imported the database from the 2.5.0 site and reran the setup. No errors during the install process. Front-end comes up, mostly. The manager produces a 500 error.

Here are the two logs from the server:

Error Log

[2021-05-16 14:00:35] (ERROR @ /home/xxxxxxxxx/public_html/core/xpdo/xpdo.class.php : 644) Could not load class: Ace from ace.

[2021-05-16 14:00:35] (ERROR @ /home/xxxxxxxxx/public_html/core/xpdo/xpdo.class.php : 1248) Problem getting service ace, instance of class Ace, from path /home/xxxxxxxxx/public_html/core/components/ace/model/ace/

[2021-05-16 14:01:52] (ERROR @ /home/xxxxxxxxx/public_html/core/cache/includes/elements/modsnippet/28.include.cache.php : 39) PHP warning: include_once(/home/xxxxxxxxx/public_html/core/components/wayfinder/wayfinder.class.php): failed to open stream: No such file or directory

[2021-05-16 14:01:52] (ERROR @ /home/xxxxxxxxx/public_html/core/cache/includes/elements/modsnippet/28.include.cache.php : 39) PHP warning: include_once(): Failed opening ‘/home/xxxxxxxxx/public_html/core/components/wayfinder/wayfinder.class.php’ for inclusion (include_path=’.:/opt/alt/php73/usr/share/pear’)

[2021-05-16 14:01:52] (ERROR @ /home/xxxxxxxxx/public_html/core/xpdo/xpdo.class.php : 644) Could not load class: Wayfinder from wayfinder.

[2021-05-16 14:01:52] (ERROR @ /home/xxxxxxxxx/public_html/core/cache/includes/elements/modsnippet/28.include.cache.php : 39) PHP warning: include_once(/home/xxxxxxxxx/public_html/core/components/wayfinder/wayfinder.class.php): failed to open stream: No such file or directory

[2021-05-16 14:01:52] (ERROR @ /home/xxxxxxxxx/public_html/core/cache/includes/elements/modsnippet/28.include.cache.php : 39) PHP warning: include_once(): Failed opening ‘/home/xxxxxxxxx/public_html/core/components/wayfinder/wayfinder.class.php’ for inclusion (include_path=’.:/opt/alt/php73/usr/share/pear’)

[2021-05-16 14:01:52] (ERROR @ /home/xxxxxxxxx/public_html/core/xpdo/xpdo.class.php : 644) Could not load class: Wayfinder from wayfinder.

[2021-05-16 14:02:07] (ERROR @ /home/xxxxxxxxx/public_html/core/xpdo/xpdo.class.php : 644) Could not load class: Ace from ace.

[2021-05-16 14:02:07] (ERROR @ /home/xxxxxxxxx/public_html/core/xpdo/xpdo.class.php : 1248) Problem getting service ace, instance of class Ace, from path /home/xxxxxxxxx/public_html/core/components/ace/model/ace/

Install Log

[2021-05-16 14:00:24] (ERROR @ /home/xxxxxxxxx/public_html/core/xpdo/transport/xpdovehicle.class.php : 182) Could not copy /home/xxxxxxxxx/public_html/core/packages/core/modContext/3f98f496e2400ccc4a58f556d84c9ed7/0/ to /home/xxxxxxxxx/public_html/index.php

[2021-05-16 14:00:24] (ERROR @ /home/xxxxxxxxx/public_html/core/xpdo/transport/xpdovehicle.class.php : 182) Could not copy /home/xxxxxxxxx/public_html/core/packages/core/modContext/3f98f496e2400ccc4a58f556d84c9ed7/1/ to /home/xxxxxxxxx/public_html/ht.access

[2021-05-16 14:00:24] (ERROR @ /home/xxxxxxxxx/public_html/core/xpdo/transport/xpdovehicle.class.php : 182) Could not copy /home/xxxxxxxxx/public_html/core/packages/core/modContext/5830943cddc46de5db5c0ab6294f8520/0/ to /home/xxxxxxxxx/public_html/manager/assets

[2021-05-16 14:00:24] (ERROR @ /home/xxxxxxxxx/public_html/core/xpdo/transport/xpdovehicle.class.php : 182) Could not copy /home/xxxxxxxxx/public_html/core/packages/core/modContext/5830943cddc46de5db5c0ab6294f8520/1/ to /home/xxxxxxxxx/public_html/manager/controllers

[2021-05-16 14:00:24] (ERROR @ /home/xxxxxxxxx/public_html/core/xpdo/transport/xpdovehicle.class.php : 182) Could not copy /home/xxxxxxxxx/public_html/core/packages/core/modContext/5830943cddc46de5db5c0ab6294f8520/2/ to /home/xxxxxxxxx/public_html/manager/templates

[2021-05-16 14:00:24] (ERROR @ /home/xxxxxxxxx/public_html/core/xpdo/transport/xpdovehicle.class.php : 182) Could not copy /home/xxxxxxxxx/public_html/core/packages/core/modContext/5830943cddc46de5db5c0ab6294f8520/3/ to /home/xxxxxxxxx/public_html/manager/min

[2021-05-16 14:00:24] (ERROR @ /home/xxxxxxxxx/public_html/core/xpdo/transport/xpdovehicle.class.php : 182) Could not copy /home/xxxxxxxxx/public_html/core/packages/core/modContext/5830943cddc46de5db5c0ab6294f8520/4/ to /home/xxxxxxxxx/public_html/manager/ht.access

[2021-05-16 14:00:24] (ERROR @ /home/xxxxxxxxx/public_html/core/xpdo/transport/xpdovehicle.class.php : 182) Could not copy /home/xxxxxxxxx/public_html/core/packages/core/modContext/5830943cddc46de5db5c0ab6294f8520/5/ to /home/xxxxxxxxx/public_html/manager/index.php

[2021-05-16 14:00:24] (ERROR @ /home/xxxxxxxxx/public_html/core/xpdo/transport/xpdofilevehicle.class.php : 104) Could not install files from /home/xxxxxxxxx/public_html/core/packages/core/xPDOFileVehicle/3e0c6aeb6d0f68186afe20d6e293b3e6/ to /home/xxxxxxxxx/public_html/connectors/

[2021-05-16 14:00:24] (ERROR @ /home/xxxxxxxxx/public_html/core/xpdo/transport/xpdofilevehicle.class.php : 104) Could not install files from /home/xxxxxxxxx/public_html/core/packages/core/xPDOFileVehicle/79d72b80fb743f09bd36baeffb814923/ to /home/xxxxxxxxx/public_html/connectors/

[2021-05-16 14:00:24] (ERROR @ /home/xxxxxxxxx/public_html/core/xpdo/transport/xpdofilevehicle.class.php : 104) Could not install files from /home/xxxxxxxxx/public_html/core/packages/core/xPDOFileVehicle/c9de21b807e7754527c659be1e6b2ddd/ to /home/xxxxxxxxx/public_html/connectors/

[2021-05-16 14:00:24] (ERROR @ /home/xxxxxxxxx/public_html/core/xpdo/transport/xpdofilevehicle.class.php : 104) Could not install files from /home/xxxxxxxxx/public_html/core/packages/core/xPDOFileVehicle/433ea1821a2a94e2fcc367c7784a3d0e/ to /home/xxxxxxxxx/public_html/connectors/

this doesn’t work.
If it was 2.5.0, you need to install 2.5.0 and import your old files into that installation.
Then upgrade this installation to 2.6.0 → 2.7.0 → 2.8.0 → 2.8.1, don’t skip any version!

2.8.2 has some issues. So better to wait for 2.8.3 before upgrading to the newest.

Bruno

That was my first approach, as described early in this thread. That failed, so Mark suggested this.

Did you import only the data, but not the table - structures?
And did you import the core/components directory?
Seems, they are missing.
Also try to deactivate all plugins from within the database directly.

As you didn’t mention it, did you also copy over core/components? Those files seem to be missing.

Ok, I don’t know what I don’t know. . . :slight_smile:

I imported the entire database, I didn’t know about that, but now I see the option to deselect the structure in the advanced choices on import.

I also didn’t realize I needed the core/components from the old site.

I’ll take another swing at this. Thanks for your help guys!

1 Like

I know this isn’t technically a Modx question, but now that I try to import data only from the old db, I see the option to select data only is only available for export. So I’m wondering if I could upload the old DB to a new DB using phpmyadmin, exporting data only from that, then importing that data only file into the new 2.8.2 db.

As you can tell I don’t know my way around this stuff very well. Any help would be appreciated.

I just tried the approach I described in my previous post. When I import the data only file, I get this error message.

SQL query:

``

--
-- Database: `xxxxxx_modx-250`
--

--
-- Dumping data for table `modx_access_context`
--

INSERT INTO `modx_access_context` (`id`, `target`, `principal_class`, `principal`, `authority`, `policy`) VALUES
(1, 'web', 'modUserGroup', 0, 9999, 3),
(2, 'mgr', 'modUserGroup', 1, 0, 2),
(3, 'web', 'modUserGroup', 1, 0, 2)

MySQL said:

#1062 - Duplicate entry '1' for key 'PRIMARY'

How do I proceed?

you need to empty the tables before you import the data.

I really think, it would be easier to install 2.5 and import you datas into this version.
Then upgrade step by step.

It this doesn’t work on your current environment, try to install an older environment localy, which is compatible with 2.5