Support

Site Restoration

#38090 Mysql problem when restoring a backup

Posted in ‘Site restoration’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Environment Information

PHP version
8.0.8
CMS Type
Joomla!
CMS Version
4.2.5
Backup Tool Version
9.4.3
Kickstart version
7.1.2

Latest post by LaurentR2D2 on Friday, 23 December 2022 05:03 CST

LaurentR2D2

Hello,

When restoring my Joomla website, I've faced a 500 error message. When enabling the debug mode, I've seen that the error was :

Unknown column 'm.oublish up' in 'where clause'

I've made a dump of the mysql database of my original Joomla website, deleted the database restored on my computer with Akeeba, and replaced it with the dump. Joomla is working fine after that. I don't know what has happened, I've restored another site on my computer without problem. I wanted to let you know in case it could be related to Akeeba backup script.

Best regards 

Laurent Rathle

nicholas
Akeeba Staff
Manager

Are you sure the column read “oublish up”, not “publish_up”? If so, someone screwed up and used an invalid column name. This is the first time I've seen that in 16 years. Find that developer and flog them have a friendly discussion with them about how database tables are supposed to be built.

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

LaurentR2D2

It's publish_up, sorry, wrong copy/paste. I've joined a screenshot of the messages I've seen running Forum Post Assistant (https://forumpostassistant.github.io/docs/), and you have the right message at the bottom.

nicholas
Akeeba Staff
Manager

Have you tried restoring your Joomla 4 site on top of an older site made with Joomla 3?

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

LaurentR2D2

Sorry for the late answer. I've restored a Joomla 3 version of the site on my computer with MAMP, then I've restored the Joomla 4 version of the site on top of the 3 version, and it works fine.

nicholas
Akeeba Staff
Manager

It does not work fine. Your site is subtly broken. When you do an upgrade from Joomla 3 to 4 some files are removed. By restoring a backup of a Joomla 4 site on top of a Joomla 3 file these files are not removed and cause subtle but important issues.

You need to DELETE all files and folders of the Joomla 3 site, then REMOVE the Joomla 3 tables from the database. Only then should you try to restore the Joomla 4 backup.

You can choose to ignore my warning at your own risk and peril. If you ignore my advice your site WILL be broken and I will NOT be able to help you fix it. That's why I have been warning people about that since 2007, when Joomla 1.5 was released and we had the first run-in with this problem. This is also documented in https://www.akeeba.com/documentation/akeeba-backup-joomla/restoring-backups.html#general-guidelines:

Do not try to overwrite one Joomla! version family with a different one. Overwriting a major version with another (e.g. restoring a backup taken on Joomla! 3.7 on top of a site running Joomla! 2.5 or vice versa) or between different minor versions (e.g. restoring a backup taken on Joomla! 3.7 on top of a site running Joomla! 3.6 or vice versa) will NOT work. Joomla! moves files around between minor and major versions. Since the backup does not delete files not present in the backup archive this will end up with Joomla! being "confused" and malfunctioning. In these cases you should delete the existing files and folders (except, perhaps, user generated content) before restoring the backup. You can safely restore a sub-minor (path-level) version on top of another. For example, you can safely restore a Joomla! 3.7.5 site on top of a Joomla! 3.7.3 site or vice versa.

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

LaurentR2D2

It seems that I haven't understood your question. I thought that you were asking me to test the process of restoring a Joomla 4 backup over a Joomla 3 website. The error message I'm talking about is after restoring a Joomla 4 backup in an empty website folder and an empty database on my computer with MAMP.

nicholas
Akeeba Staff
Manager

OK, now we're getting somewhere.

On that restored site I want you to set Debug Site to Yes, reproduce the issue, and take a screenshot of it including the debug trace (VERY IMPORTANT!). Upload the screenshot here so I can see exactly what the error is and where it is coming from.

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

LaurentR2D2

I've done a new website on MAMP, and restored the backup from scratch. I didn't know how to reproduce the issue with the restored site. I've activated all the debug settings in the configuration.php file. I join the screenshots the messages I get after that.

nicholas
Akeeba Staff
Manager

It looks like you have excluded your site's #__menu table from the backup.

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

LaurentR2D2

I've never touched the database exclusion option. I've made a video while I've made a new backup today showing the options I have in Akeeba, and downloaded the backup log. This backup leads to the same error message.

LaurentR2D2

I add the screenshots of the debug info, in case they are different of the previous ones.

nicholas
Akeeba Staff
Manager

The screenshots are useless to me. I need two different pieces of information.

First, I need the backup log file. This will tell me what went into the backup. I am looking to see if the #__menu table is included in the backup.

Actionable item: Please ZIP and attach the backup log file from when you took that backup.

The next thing I need, is you to tell me if there are any errors during restoration. If so, I need a screenshot.

Actionable item: Screenshots of errors during the site's restoration, if any.

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

LaurentR2D2

I've sent you the backup log in the previous message with a video of the backup. You haven't received them? It was just before the message with the screenshots. I have no error message during the backup process. 

LaurentR2D2

I send them again in case I made a mistake sending them yesterday.

LaurentR2D2

I don't see the attachments. Perhaps a problem with the extension of my video ?

nicholas
Akeeba Staff
Manager

I only have screenshots, I do not have the log file.

I do not need screenshots or a video, I need the backup log file. You need to go to the Manage Backups page and click on View Log on the backup record which corresponds to the backup you are trying to restore. In the new page click on the Download Backup Log File button. It downloads a .txt file. Put this txt file in a ZIP archive. Attach the ZIP archive to your next reply.

If the ZIP archive is over 10MiB please let me know, we'll need to do something a little bit different.

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

LaurentR2D2

Here it is.

Normally you should see the zip file attached, but I don't see it. As .txt it is 9,9 Mb, but as .zip file 376 kb. Here is an url to download it :

 

https://nuage.madonie.org/index.php/s/iYbtwW6F2k2g8gb

nicholas
Akeeba Staff
Manager

THANK YOU! I can now see the problem.

You have two sets of tables using the prefixes q31H4_ and q31h4_. Note that they are not the same. The are ALMOST the same, but the first one has a capital H and the second one has a lowercase h.

The tables with the q31H4_ prefix are from an old installation, presumably a Joomla 3 or older site which was upgraded at some point.

The tables with the q31h4_ prefix are the ones from your current Joomla 4.2.5 site.

Depending on the configuration of both your Linux server and your local server this CAN cause problems because of the way MySQL works with uppercase letters in table names. Please see https://www.akeeba.com/documentation/warnings/q106.html

The solution in your case is to exclude all tables with the UPPERCASE letter (q31H4_) prefix before backing up your site. You can do that in Akeeba Backup, RegEx Database Exclusion. Create a new row of the type Exclude a table and with the Filter Item set to !/^#__/   This excludes all tables which do not have the prefix configured in your site. Take a new backup and restore it.

Please note that depending on how your Linux host is configured this may not work. If that's the case, you will need to delete all tables which have the the UPPERCASE letter (q31H4_) prefix from your site.

Also note that this problem only happens when restoring your site on a target server which stores the MySQL data in a case-sensitive filesystem. This is every Windows machine (all Windows filesystems are case-insensitive), most macOS machines (HFS+ and APFS are case-insensitive by default, both as they come out of the factory and when you format an HDD/SSD), and extremely rarely on Linux machines (e.g. when they are using a Samba share to a case-insensitive Windows machine, a disk formatted in NTFS or FAT32, etc). In short, you will practically only see this problem when restoring on Windows or macOS but not when restoring to a live site which runs on a Linux server.

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

LaurentR2D2

Hello,

I've forgotten to answer to your last message. Thank you for all your help, and have a nice end of the year.

Laurent Rathle

Support Information

Working hours: We are open Monday to Friday, 9am to 7pm Cyprus timezone (EET / EEST). Support is provided by the same developers writing the software, all of which live in Europe. You can still file tickets outside of our working hours, but we cannot respond to them until we're back at the office.

Support policy: We would like to kindly inform you that when using our support you have already agreed to the Support Policy which is part of our Terms of Service. Thank you for your understanding and for helping us help you!