Sometimes when Joomla is updated, database schemas change. Occasionally, this doesn’t happen properly during the update.
Here’s how to use the database fix functionality to resolve those schemas that need to be updated to match the version running.
Database Fix is a handy section of your website that fixes any issues in the database structure (also called “schema”). If you performed a Joomla update manually or some part of the automatic update process failed, then the database schema might not match the version, which can create errors.
Here’s what a perfectly working schema looks like:
Examples of Errors
The errors could be content errors, user errors, or other types of errors. Normally the error will refer to a table or SQL which should tip you off to check the database fix page.
Here’s an example of one:
JInstaller: :Install: Error SQL Can’t DROP ‘username’; check that column/key exists
Files Update: SQL error file DB function failed with error number 1091
Can’t DROP ‘username’; check that column/key exists
SQL = ALTER TABLE `#__users` DROP INDEX `username`;
Here are some other examples. (Your sql files may have different numbers and dates)
Table ‘xxx_content_types’ does not have column ‘content_history_options’. (From file 3.2.0.sql.)
Table ‘xxx_modules’ does not have column ‘asset_id’. (From file 3.2.0.sql.)
Table ‘xxx_postinstall_messages’ does not exist. (From file 3.2.0.sql.)
Table ‘xxx_ucm_history’ does not exist. (From file 3.2.0.sql.)
Table ‘xxx_users’ does not have column ‘otpKey’. (From file 3.2.0.sql.)
Table ‘xxx_users’ does not have column ‘otep’. (From file 3.2.0.sql.)
Table ‘xxx_user_keys’ does not exist. (From file 3.2.0.sql.)
Table ‘xxx_update_sites’ does not have column ‘extra_query’. (From file 3.2.2-2013-12-22.sql.)
Table ‘xxx_updates’ does not have column ‘extra_query’. (From file 3.2.2-2013-12-22.sql.)
Table ‘xxx_updates’ does not have column ‘version’ with type ‘varchar(32)’. (From file 3.2.2-2014-01-18.sql.)
Table ‘xxx_users’ does not have column ‘requireReset’. (From file 3.3.0-2014-02-16.sql.)
Table ‘xxx_user_profiles’ does not have column ‘profile_value’ with type ‘TEXT’. (From file 3.3.4-2014-08-03.sql.)
These are all easily resolved, try the following fix.
- Go to the Database Fix page, by navigating to Extensions -> Manage -> Database in the backend of Joomla.
- Click the Fix button.
Nine times out of ten that will resolve your issue and you’re good to go! You will know it’s all good if you get back the all thing normal screen like pictured in the first screenshot of this article.
How to get to Database Fix without an Admin Menu
If for some odd reason you don’t have an admin menu displaying on the backend of your website, you can do the following to get to the Database Fix page. Note your User must be in the Administrator or Super Administrator User Group to access this Menu Item regardless of whether it appears in the Admin Menu or you use the link below.
- Go to [replacewithyourdomainname]/administrator/index.php?option=com_installer&task=database.fix (being sure to use your own domain name)
Interested in learning more about Joomla? Check out OSTraining’s variety of courses about Joomla today.