I have empty pages after migrating a website to another domain. Only header and footer are visible. Menu options all go to Homepage.
I did the normal procedure:
Empty cache
Copying entire website to new domain (also tried once with new MODX installation and copying only necessary folders)
Exporting-importing database
Updating all the paths and db settings
Rerun setup
Manager is working fine. I can see also the Homepage when I’m logged in in the Manager, but other pages are not accessible.
I did, all paths are correct. The site is functioning, except for the content that is not shown and only Homepage that is working.
Yes, cache is flushed as well.
There are dozens of errors like:
(ERROR @ /var/www/vhosts/site.nl/httpdocs/core/src/Revolution/modX.php : 783) PHP warning: foreach() argument must be of type array|object, null given
(ERROR in resource 1 @ /var/www/vhosts/ (ERROR @ /var/www/vhosts/site.nl/httpdocs/core/src/Revolution/modX.php : 783) PHP warning: foreach() argument must be of type array|object, null given
(ERROR in resource 1 @ /var/www/vhosts/site.nl/httpdocs/core/src/Revolution/modLinkTag.php : 108) Bad link tag [[~11]] encountered.nl/httpdocs/core/src/Revolution/modLinkTag.php : 108) Bad link tag [[~11]] encountered
htaccess is same as in development site, PHP versions same as well.
The site itself is working; it’s just that the content is not loading. Header and footer are visible. Menu is not working as well. Pages except for Homepage are not accessible. Feels like a setting.
Assuming that we have the same modX.php file (and I think we do), the problem is in a call to getParentIds() in the modX class. The error is thrown when trying to display the home page.
I’d guess that the MODX resource map ($this->resourcemap) has not been initialized properly at the time getParentIds() is called.
Do you have any plugins connected to front-end events like OnWebPagePrerender or OnLoadWebDocument?
Since the header and footer are rendering, I’d also take a look at the section of code in home page’s Template that contains the [[*content]] tag.
I did find something peculiar: on re-enabling the extra’s one refused and gave the following error, which may be related:
Bezig met installeren van pakket: clientconfig-2.4.0-pl
PHP warning: Undefined array key “host”
PHP warning: fsockopen(): php_network_getaddresses: getaddrinfo for failed: Naam of dienst is niet bekend
PHP warning: fsockopen(): Unable to connect to :80 (php_network_getaddresses: getaddrinfo for failed: Naam of dienst is niet bekend)
Could not retrieve from clientconfig-2.4.0-pl.transport.zip?revolution_version=Revolution-3.0.4-pl
MODX could not download the file. You must enable allow_url_fopen, cURL or fsockopen to use remote transport packaging.
After doing some debugging on this site for Gerben, it appears to be an issue where the database wasn’t migrated fully. Somehow all indices and table metadata are missing.
I’ve asked Gerben to migrate the database again which will hopefully sort it all out as I did find other oddities related to it besides the issue here.
–
The thing that broke the context cache generation (no aliasMap or resourceMap) was the missing refresh_cache_idx index on the modx_site_content table. The resource cache generation forces mysql to use that index, which causes an error that did not get logged.
As a temp workaround, disabling the use_context_resource_table system setting avoids the index being forced. However, the lack of indices is causing all sorts of other issues too (like new database records being assigned ID 0, because the auto_increment primary key/index is missing) so the DB migration definitely needs to be redone.
The issue after migrating a website to another domain, with empty pages and menu options redirecting to the homepage, might be due to incorrect paths. Ensure you’ve updated all paths and database settings correctly during migration. Check if there are any absolute paths in the content that need adjustment