Upgrading Joomla CMS version 3.x to Joomla CMS 5.x

Upgrading Joomla CMS version 3.x to Joomla CMS 5.x

What?
An article for me or for whoever dares to upgrade their Joomla CMS from version 3 to version 5.

Disclaimer: I'm used to doing this without any third-party extensions. I strongly recommend you do a backup beforehand of the database and of all your files

Why?
I keep getting complaints that my server wants to upgrade my PHP v7.x to PHP v8.x. I also get complaints (from my server not from humans) that my Joomla version needs updating...

I'm writing this in case I ever have to upgrade other people's Joomla CMS and if it helps anyone else out there.

How?
There aren't too many steps but this is what I went through and I might amend this if I see any new issues:

Preamble
Set up a new folder in my public_html\joellipman_site\ for my 2025 production joomla files & folders.
Set up a new database on the same server as my previous database. New db user and password added to the new database.
Downloaded and uploaded the latest Joomla (at time of print this is version 5.2.3) as a ZIP
Extracted this to the new 2025 production folder I created earlier
Pointed a test.joellipman.com domain to the 2025 folder.
Visited the test.joellipman.com to run through the Joomla installation wizard.

Data Migration using SQL files:
Import Categories: export SQL file and amend the insert(s) into the new table `#_categories` where `id` > 7
Add column in #_content just before note called `xreference` VARCHAR(50) allows NULL.
Import Content (articles): export SQL file and amend the insert(s) into the new table `#_content`
Import Users: export SQL file and amend the insert(s) into the new table `#_users`
Import User Group Maps: export SQL file and amend the insert(s) into the new table `#_user_usergroup_map`

Viewing Articles in the Administrator panel:
INSERT INTO `#_workflow_associations` (`item_id`, `stage_id`, `extension`)
SELECT `id`, 1, "com_content.article"
FROM `#_content`;

UPDATE `#_content` SET `checked_out`=NULL, `checked_out_time`=NULL;

Viewing Users in the Administrator panel:
UPDATE `#_users` SET `params`='{}' WHERE `params`='{"",""}';

Set User Group Mappings from old DB to new DB: Other than new admin (here new admin ID is 111, previous admin ID is 222, and general information desk account is 333), remove other super admins (optional) I also noted the previous admin's ID and returned their super admin status. Sorted by group_id desc and changed 8 to 2.

SELECT m.`user_id`, m.`group_id`, u.`username`, u.`email` FROM `#_user_usergroup_map` m 
JOIN `#_users` u ON u.id = m.user_id ORDER BY `group_id` DESC; 

UPDATE `#_user_usergroup_map` SET `group_id`=2 WHERE `user_id`<>111 AND `user_id`<>222 AND `user_id`<>333;

Akeeba Backup Install:
Warning
JInstaller: :Install: Error SQL Table 'newdb.#_akeebabackup_profiles' doesn't exist
Extension installation stopped.
Package Install: There was an error installing an extension: com_akeebabackup-core.zip

System > Extensions > Manage Extensions > com_akeebabackup > Uninstall:
Joomla\CMS\Filesystem\Folder::delete: Path is not a folder. Path: [ROOT]/administrator/components/com_akeebabackup
Joomla\CMS\Filesystem\Folder::delete: Path is not a folder. Path: [ROOT]/components/com_akeebabackup
Component Uninstall: Can't uninstall. Please remove manually.

Go to run Mysql directly:
delete from `#_extensions` where name='com_akeebabackup';

System > Extensions > Install from Web > Akeeba > Install > Install
Components > Akeeba Backup for Joomla > Control Panel > Configuration Wizard > Backup Now

Adding articles in Administrator interface:
Save failed with the following error: Invalid parent ID.
Asset ID is incorrect...
Categories > Clear Filter Options > Show All > Tick to select all > Rebuild [does not work]
Using the administrator panel, go into each category and hit save and close starting with the parent categories first

Copying article heading images from SP Page Builder to normal Joomla Articles
SELECT new.`id`, old.`id`, json_extract(old.`attribs`, '$.spfeatured_image') AS `image_src`, json_extract(old.`attribs`, '$.spfeatured_image_alt') AS `image_alt`
FROM `new_db`.`new_content` AS new
LEFT JOIN `old_db`.`old_content` AS old
ON new.`id` = old.`id`

UPDATE `new_db`.`new_content` AS new
LEFT JOIN `old_db`.`old_content` AS old
ON new.`id` = old.`id`
SET new.`images` = JSON_SET(
    COALESCE(new.`images`, '{}'),
    '$.image_intro', JSON_EXTRACT(
        CASE
            WHEN JSON_VALID(old.`attribs`) THEN old.`attribs`
            ELSE '{}'
        END,
        '$.spfeatured_image'
    ),
    '$.image_intro_alt', JSON_EXTRACT(
        CASE
            WHEN JSON_VALID(old.`attribs`) THEN old.`attribs`
            ELSE '{}'
        END,
        '$.spfeatured_image_alt'
    ),
    '$.image_fulltext', JSON_EXTRACT(
        CASE
            WHEN JSON_VALID(old.`attribs`) THEN old.`attribs`
            ELSE '{}'
        END,
        '$.spfeatured_image'
    ),
    '$.image_fulltext_alt', JSON_EXTRACT(
        CASE
            WHEN JSON_VALID(old.`attribs`) THEN old.`attribs`
            ELSE '{}'
        END,
        '$.spfeatured_image_alt'
    )
)
WHERE JSON_VALID(old.`attribs`)
AND (JSON_EXTRACT(old.`attribs`, '$.spfeatured_image') IS NOT NULL
     OR JSON_EXTRACT(old.`attribs`, '$.spfeatured_image_alt') IS NOT NULL);

Get Search to find ALL articles
I noticed that if I search for some of my articles, they weren't appearing in the smart search but I could see them in the category blogs.
  1. Login to Administrator > Components > Smart Search > Index
  2. Click on the "Index" button in the toolbar and this will popup a progress bar through all your content


Category: Joomla :: Article: 896

Add comment

Your rating:

Submit

Credit where Credit is Due:


Feel free to copy, redistribute and share this information. All that we ask is that you attribute credit and possibly even a link back to this website as it really helps in our search engine rankings.

Disclaimer: Please note that the information provided on this website is intended for informational purposes only and does not represent a warranty. The opinions expressed are those of the author only. We recommend testing any solutions in a development environment before implementing them in production. The articles are based on our good faith efforts and were current at the time of writing, reflecting our practical experience in a commercial setting.

Thank you for visiting and, as always, we hope this website was of some use to you!

Kind Regards,

Joel Lipman
www.joellipman.com

Please publish modules in offcanvas position.