Using a Cloned Sites to Test Your Joomla 4 Upgrade

So you have your client site cloned and are ready to see if its ready for Joomla 4. The next steps are as follows:

  1. Set the "Target Joomla Version For Compatibility Tests" on the first tab of the site config to 4.0.0
  2. Select the cloned client site(In YourSites 1.19 onwards there is a helpful filter in the search options to show only cloned sites) and from the top drop down select Joomla=>Check for Joomla Upgrade Compatibility (on YourSites server supporting WordPress this is Core Software=>Check for Joomla Upgrade Compatibility
  3. Check the results in the popup (or later via the special 'info' icon for this site identified by the Joomla icon.
  4. This tells you if your PHP and Database versions/settings are compatible and runs an Extensions pre-update check (which is what the pre-upgrade check in Joomla 3.10 was based on).
  5. Extensions Pre-Update Check tells you which extensions are compatible and flags upgrades you should apply.
  6. On your clone site (using YourSites) you can upgrade these extensions and then run the test again as many times as you want.
  7. Pay particular attention to entries under "No Compatible Version Information From Update Server" or "No Update Servers Specified" since these could break your upgraded site
  8. Ideally you should uninstall and replace with a compatible alternative or disable the extensions under these section headings. If this isn't possible then check the developers website for advice on Joomla 4 comptatibility·

So you've done this and everything should be compatible and you are ready to try the upgrade to Joomla 4. OR if you like living dangerously and want to see how bad things are without being sure of extension compatibility. The next step is to edit the site entry again and on the 'Advanced Settings' tab you should set the "Joomla! update server" to 'Joomla Next', click 'save and close' and run the core version check again (short cut is to click the green Joomla icon under the 'core' column heading - this should then offer Joomla 4.0.0 as the next upgrade.

BEFORE YOU DO ANYTHING ELSE - you MUST make sure that the YourSites system plugin is ordered first on the client site. If you don't do this then you may not be able to diagnose and fix any serious issues caused by other incompatible plugins.

MAKE SURE YOU ARE TESTING THE CLONE SITE and then click this icon again (or apply the Jooomla update from the top blue menu dropdown) and your client site should be upgraded to Joomla 4.

Did everything work??

Open the client site iself in another tab/window of your browser - hopefully everything works ok, perhaps with some styling issues you need to resolve. BUT it could be BAD - and by BAD we mean REALLY BAD. You could have a white screen, a partial webpage or a 500 error message. Even worse you may not be able to access the backend of the site to sort things out!. What can you do?

Thankfully YourSites has some tools that may be able to help diagnose and resolve these issues.

In these screenshots I have deliberately upgraded my test site without ensuring the compatibility of extensions and templates I have installed. After performing the Joomla upgrade to version 4.0.0 I am unable to access the frontend or backend of my site.

We can't even login to the backend of the site to resolve the situation. BUT all may not be lost. In the site list of YourSites select the broken clone and then 'Site Checks=>Diagnose Fatal Error (Backend)' (or Frontend if the problem doesn't affect the backend of the client site.

We can now see that it is the adminExile plugin causing the problem on this cloned upgrade - we should have upgraded it first!! BUT we can now go to the list of extensions for this site and find this plugin and then disable it.

Remember to clear the Joomla cache for this site in the list of sites (otherwise the system plugin cache will not be cleared and disabling the plugin will have no effect).

We can then repeat this exercise to disable all the problematic plugins on the upgraded site. REMEMBER to keep a note of the offending plugins so you can look for upgrades or replacements.

Migrating a clone site to a live site

Once you are happy with the clone site you can rename folders/move files so that the live site is loaded from the Joomla 4 site files - the exact process will depend on your hosting environment. You can ask in the support forum for suggestions for your specific setup.

Renaming your database tables is a little more complex

You can run a query like this in PhpMyAdmin to rename the prefix

Assuming
  1. 1. The database is called 'MyDatabase'
  2. 2. The clone prefix is 'ysts_y0e1d_'
  3. 3. Your new live prefix is 'j4y0e1d_'

SET @database = "MyDatabase";
SET @old_prefix = "ysts_y0e1d_";
SET @new_prefix = "j4y0e1d_";

select group_concat(v.SQL SEPARATOR ' ')
from (SELECT CONCAT(
                     "RENAME TABLE ",
                     TABLE_NAME,
                     " TO ",
                     replace(TABLE_NAME, @old_prefix, @new_prefix),
                     ';'
                 ) AS "SQL"
      FROM information_schema.TABLES
      WHERE TABLE_SCHEMA = @database
        AND TABLE_NAME LIKE CONCAT(@old_prefix, "%")) as v;

The output will be a long SQL script with rename table commands e.g.

RENAME TABLE ysts_y0e1d_action_log_config TO j4y0e1d_action_log_config; RENAME TABLE ysts_y0e1d_action_logs TO j4y0e1d_action_logs; RENAME ....

Check the script to make sure it looks ok and then execute it to rename your tables and remove the clone prefix.

Then change the dbprefix in the configuration.php file

a backup ahead of time is a good idea.

We love every single one of our users, without you YourSites simply couldn't happen! So we would love a review at the Joomla! JED so we can let others know about us too, please take a minute to write a review:

https://extensions.joomla.org/extension/yoursites-manager/

If you feel you have something negative to say, we would implore you to speak to us first, as we really really don't want anyone to be unhappy!

STAY CONNECTED