Blog Home arrow Latest News From Phil Taylor

What to do if you lose your AUTO_INCREMENT properties on your Joomla Database Tables.

December 27th, 2006

It has been reported to us twice over Christmas that a certain backup and restore component for Joomla is “cloning” Joomla databases without reinstating all the properties of the databases’ primary keys correctly.

You will know when you have this problem as you will not be able to add any NEW content to your Joomla site and you may get error messages about duplicate primary keys.

If you take a look at your jos_content table, check the ID field and see if auto_increment is a property of the field - if not then you have lost all your auto_increments.

I have compiled a short list of SQL commands to reinstate the correct primary keys and properties based on joomla.sql, the default joomla installation SQL. This will NOT fix 3rd party components tables which must be done manually.

The following SQL Commands are applicable to Joomla 1.0.x only. Read the rest of this entry »