Community

Upgrading with renamed paths

Hi. I have an outdated site with the core, manager, connectors and assets paths renamed. I’m trying to update it, but the installation interface doesn’t let me to choose the upgrade option. Only the new installation option can be selected. I have tried with the traditional and the advanced installation, and the same issue happens with both.

I guess that this problem happens because the folder paths are changed, but I dont know how to proceed.

How can I upgrade my site with renamed paths?
Thanks a lot for your help!

What version of MODX are you running?

Back up the site completely (both files and DB) before trying any of the suggestions here!

When you can’t choose the upgrade option, it usually means that MODX can’t find the core/config/config.inc.php file (or it can find it and it’s empty). Normally, it will ask you where the core directory is at that point. I don’t know why it isn’t doing that.

In the setup/includes directory, there should be a file called config.core.php. By default, it contains a relative path to the traditional core location. It’s possible that correcting that path (and the config key you’ve change it) will let you select the update checkbox.

If your version if not too old (I think 2.6.0 or newer), you may be able to install and use the UpgradeMODX extra. It will use the config.core.php file from your MODX root directory, which should tell it where your core directory is (assuming that your site works).

Thanks for your reply, Bob.
After changing the config.core.php file in setup/includes, I could choose to upgrade but the installer showed this error:

There was an error updating the table for the class modResource
Array
(
[0] => 42S21
[1] => 1060
[2] => Duplicate column name ‘alias_visible’
)
I could log in, but all the manager menus won’t load (they are stuck with the ‘loading’ symbol) and somehow the version keeps being 2.7.0.

Let me clarify something. I upgraded PHP to the latest version in my localhost, and after that my Modx site showed this error:

Warning : “continue” targeting switch is equivalent to “break”. Did you mean to use “continue 2”? in C:\xampp\htdocs\medicina-antroposofica-2\8p465o\model\modx\modcachemanager.class.php on line 605
So I thought that upgrading Modx would fix these errors, but after updating PHP the menus won’t load (as I said before). I already know about the Upgrade MODX extra, but since the menus aren’t loading, I can’t use it and I have to update manually.

What can I do?

The resource error is normal. It just means that that field is already there.

The Warning is just about a questionable bit of coding style (that’s fine), but it suggests that you may have a permission or ownership problem with one or more MODX directories. Otherwise, I think that warning would have been corrected by the upgrade. So you may have some old versions of files that didn’t get overwritten.

Another possibility is a plugin or snippet that doesn’t play nice with the newer version of MODX. Upgrading all your packages to the current version before doing the upgrade could solve that (or not).

Try visiting the site with your browser in private or incognito mode. Sometimes a leftover cookie or browser cache item will mess with the Manager.

Browsing with incognito mode didn’t work, but I will try to give you more details to make it easier for you to help me.

All my Modx sites were working fine, but I decided to update PHP and all of my sites showed this error

Warning : “continue” targeting switch is equivalent to “break”. Did you mean to use “continue 2”? in C:\xampp\htdocs\medicina-antroposofica-2\8p465o\model\modx\modcachemanager.class.php on line 605

I could fix this error in all of my sites by upgrading Modx, except in this particular site, because when i Log in the menus get stuck loading and I can’t run the Upgrade MODX extra. I tried to upgrade manually using the installation package, but after upgrading, the version keeps being 2.7.0 and the Warning message didn’t disappear.

Here is a screenshot with the Warning message and the menus stuck with the ‘loading’ symbol. Notice that after upgrading, the version is still 2.7.0

I have the core, manager, connectors and assets paths changed, but now that doesn’t seem to be causing the problem.

Finally, when I updated PHP, I had to install Xampp again in my localhost, so I had to export my databases and import them into the new Mysql installation. I don’t know if that could cause some issues.

I don’t want to be annoying; I just can’t find the solution by myself.

Please help me.

Try turning off the News and Security feeds in System (gear icon) -> System Settings (type feed in the search box at the upper right). The keys are feed_modx_news_enabled and feed_modx_security_enabled. While you’re there, check the settings_version System Setting.

If you can’t access the System Settings, you can do it in the modx_system_settings table in the DB (change the value field from 1 to 0). After the change, manually delete all the files in the core/cache directory.

If that fixes the Dashboard, you can run UpgradeMODX again (after setting back the settings_version if it’s set to the current version).

Another thing to check is the four config files: config.core.php in the root, manager, and connectors directories. They should all be the same and should have the correct, full path to the core, and the correct config key. Also check the core/config/config.inc.php file to make sure all the paths and URLs are correct. IIRC, on a localhost install, I’ve sometimes had to hard-code the full paths.

Thanks for all your help, Bob.
I turned off the feed_modx_news_enabled and feed_modx_security_enabled fields through the data base and deleted the files in the core/cache folder. The manager is still getting stuck.

The config.core.php files in the root, manager and connectors folders have the same paths and look like this (‘8p465o’ is my core folder):

define(‘MODX_CORE_PATH’, ‘C:/xampp/htdocs/medicina-antroposofica-2/8p465o/’);
define(‘MODX_CONFIG_KEY’, ‘config’);

I also checked the config.inc.php file at the core folder and seems to be ok.

What should I try now?