1

I was given the a copy of the folder "httpdocs" and a .sql of the Joomla database from a fully operational site on plesk, and was asked to mount the website locally.

The version of Joomla is 3.6.5, I checked it on the en-GB.xml. The PHP version on the original server was 5.4.45, and now I am using Xampp 1.8.2 with PHP 5.4.31.

After changing the configuration.php to connect to the database, and then accessing the site I get this error:

1054 - Unknown column 'c.version' in 'field list'

SQL=

SELECT c.id, c.asset_id, c.access, c.alias, c.checked_out, c.checked_out_time,
       c.created_time, c.created_user_id, c.description, c.extension,
       c.hits, c.language, c.level, c.lft, c.metadata, c.metadesc,
       c.metakey, c.modified_time, c.note, c.params, c.parent_id,
       c.path, c.published, c.rgt, c.title, c.modified_user_id, c.version,
       CASE
           WHEN CHAR_LENGTH(c.alias) != 0 THEN CONCAT_WS(':', c.id, c.alias)
           ELSE c.id
       END as slug,
       COUNT(i.`id`) AS numitems
FROM #__categories as c
LEFT JOIN (
    SELECT cat.id as id
    FROM #__categories AS cat
    JOIN #__categories AS parent ON cat.lft BETWEEN parent.lft AND parent.rgt
    WHERE parent.extension = 'com_content'
        AND parent.published != 1 GROUP BY cat.id
) AS badcats ON badcats.id = c.id
LEFT JOIN #__categories AS s ON 
    (s.lft < c.lft AND s.rgt > c.rgt AND c.language in ('en-GB','*'))
     OR (s.lft >= c.lft AND s.rgt <= c.rgt)
LEFT JOIN `#__content` AS i ON
     i.`catid` = c.id AND i.state = 1 AND (i.language = '*' OR i.language = 'en-GB')
WHERE (c.extension='com_content' OR c.extension='system')
    AND c.access IN (1,1)
    AND c.published = 1
    AND badcats.id is null
    AND s.id=10
GROUP BY c.id, c.asset_id, c.access, c.alias, c.checked_out,
    c.checked_out_time, c.created_time, c.created_user_id,
    c.description, c.extension, c.hits, c.language, c.level,
    c.lft, c.metadata, c.metadesc, c.metakey, c.modified_time,
    c.note, c.params, c.parent_id, c.path, c.published, c.rgt,
    c.title, c.modified_user_id, c.version
ORDER BY c.lft

From what I have seen, this error is common in websites that are being updated from Joomla! 2.5 to 3.x, this one is not.

I am not very familiar with Joomla!, but I will update this question with any requested information.

2
  • Thank you for porting your question from Stack Overflow. Please take our tour. PHP5.4 is super-mega-dead. Is there something stopping you from using a current version of php? Please tell us what your #__categories table looks like -- does it have the version column? Apr 25, 2021 at 12:58
  • I see that you have accepted your own answer at Stack Overflow. Please see that this page is marked as resolved as well. You can either accept Patrick's answer, or post your own educational answer and accept that. May 3, 2021 at 22:06

1 Answer 1

3

Welcome to the Joomla Stack Exchange @Bisectriz.

Where you say you don't know much about Joomla, I'm going to assume you know enough about xampp and phpmyadmin for the following to make sense. If not, reply and I'll come back with more detail on what to do in those steps.

Edit the Categories table via phpMyAdmin

You need to fix your #__categories table on xampp via phpMyAdmin first.

Go to http://localhost/phpmyadmin

Find the #__categories table in your database and click on Structure tab. (Replace the #_ with the prefix for your database to find the table).

You'll then need to add a column to the #__categories table that is named version. This is what the SQL Statement looks like, but you need to replace the #_ with your database table prefix:

ALTER TABLE `#__categories` ADD `version` INT(10) UNSIGNED NOT NULL DEFAULT '1'  

Once you've run that command, try accessing the site again and ideally you're past the initial problem as your categories table now has a version field that is missing and causing the SQL error you're getting.

I'd then go to the next part of my answer and run the Database Fix tool to have the entire database checked for changes.

Joomla Database Check Tool

Joomla has a function built in to check the database structure and allow you to fix it if there's something missing.

  • Go to Extensions > Manage > Database
  • The function will run as the page load to tell you what needs to be fixed in the database
  • Click on the Fix button at the top of the page to run the SQL that will modify the structure of the database.

In your case, version control was introduced at some stage before 3.6.5, but 3.6.5 is the "jump" version for updating to later versions of Joomla where there's changes before 3.6.5 that need to be applied before later versions can be applied.

enter image description here

2
  • Hello Patrick, sorry for the delays. Aparently I was given a database for Joomla! 2.5 instead of the current version, now it works fine. Still thank you for your effort.
    – Bisectriz
    May 3, 2021 at 14:55
  • That would be a significant issue :) May 3, 2021 at 23:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.