Support

Akeeba Backup for Joomla!

#20179 Add specific wrapper to mysql backup dump

Posted in ‘Akeeba Backup for Joomla! 4 & 5’
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

Joomla! version
n/a
PHP version
n/a
Akeeba Backup version
n/a

Latest post by on Thursday, 10 July 2014 18:00 CDT

trendup
Description of my issue:
I’m developing a Joomla! site with a Magento are bridged by MageBridge.
I’d like to use Akeeba backup to manage Joomla! and Magento backups, but I have a problem restoring Magento backups related to missing "code-containing comments" in the dump.
If I make a backup from Magento backup tool I get this code:

-- Magento DB backup
--
-- Host: localhost    Database: mydbname
-- ------------------------------------------------------
-- Server version: 5.5.35-33.0-log

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

--
-- Table structure for table `admin_assert`
--

and then the dump content.
At the end of the dump file i get:

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; 
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

-- Dump completed on 2014-06-04 07:22:43 GMT


Is it possible to add custom code like this as “wrapper” for database during backup from AkeebaBackup Pro?

nicholas
Akeeba Staff
Manager
There is a problem with your ticket. You are telling us how you failed to solve a problem, but you are not telling us what the problem is! All you are telling us is that it's a problem trying to restore Magento. What kind of problem? We have to guess. I will guess and I will give you a solution based on the problem I guess you have which might not necessarily be the problem you really have.

All of those commands you pasted are irrelevant to the restoration of your tables. You can go through the MySQL manual if you want to and see why.

If you read the article you linked very carefully you will see that the real problem is that Magento violates MySQL rules by having records with their auto-number column set to 0. The only thing you need is
SET SQL_MODE=”NO_AUTO_VALUE_ON_ZERO”

during restoration. Right now ANGIE does not support that. I will add this feature for the next stable version of Akeeba Backup, but only if you can verify that this is what your problem is all about, zero values in auto-indexed columns not being restored.

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!

trendup
You are right, the mai problem is that I don’t know database so it’s hard for me to describe the problem :-)
Restoring the Magento database with ANGIE from a database created from Akeeba backup, the database is restored but I get an error from Magento:
2014-06-04T16:06:20+00:00 ERR (3): Recoverable Error: Argument 1 passed to Mage_Core_Model_Store_Group::setWebsite() must be an instance of Mage_Core_Model_Website, null given, called in /Applications/MAMP/htdocs/magento19/app/code/core/Mage/Core/Model/App.php on line 654 and defined in /Applications/MAMP/htdocs/magento19/app/code/core/Mage/Core/Model/Store/Group.php on line 275

I get the same problem if before restoring (after Kickstart decompression) I add
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";

as first line.
If I try to import the Magento database created with Akeeba backup in phpMyAdmin, I get this error:
CREATE TABLE `downloadable_link_price` (   `price_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Price ID',   `link_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Link ID',   `website_id` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Website ID',   `price` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT 'Price',   PRIMARY KEY (`price_id`),   KEY `IDX_DOWNLOADABLE_LINK_PRICE_LINK_ID` (`link_id`),   KEY `IDX_DOWNLOADABLE_LINK_PRICE_WEBSITE_ID` (`website_id`),   CONSTRAINT `FK_DOWNLOADABLE_LINK_PRICE_LINK_ID_DOWNLOADABLE_LINK_LINK_ID` FOREIGN KEY (`link_id`) REFERENCES `downloadable_link` (`link_id`) ON DELETE CASCADE ON UPDATE CASCADE,   CONSTRAINT `FK_DOWNLOADABLE_LINK_PRICE_WEBSITE_ID_CORE_WEBSITE_WEBSITE_ID` FOREIGN KEY (`website_id`) REFERENCES `core_website` (`website_id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB AUTO_INCREMENT=23 DEFAULT CHARSET=utf8 COMMENT='Downloadable Link Price Table';

So I can’t restore a backup of Magento DB created from Akeeba Backup, but if it not a standard approach, don’t worry: I’ll set the backup from Magento.
Attached you can find the backup of sample data installation created from Magento and from Akeeba Backup if you want to study in deep.

trendup
If it can help to understand the problem, selecting "Disable foreign key checks" during a phpMyAdmin dump of Magento DB, seems to work when restored.

nicholas
Akeeba Staff
Manager
I get the same problem if before restoring (after Kickstart decompression) I add

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";

as first line.

Of course you are. ANGIE doesn't try to load the entire SQL script in memory and restore it at once on the server. That would only work for tiny sites (less than 1Mb database data) and fail on anything bigger. How do I know? That's exactly what JoomlaPack 1.0 was doing back in 2006 and that's exactly the problem we had with bigger sites ;) Right now ANGIE loads one line at a time and only executes create, insert, update, alter and drop statements. SET statements (among other things) are ignored.

However I do see the cause of the problem and it does seem to be what I guessed. I have attempted to create an (untested) fix. Please install the dev release from https://www.akeebabackup.com/download/developer-releases/akeebapro.html take a new backup of your Magento installation and try restoring it. In the database restoration page, to the right of the connection information, you will see a new option called "No auto value on zero". It should be already checked. If it's not, please check it. Then proceed with the database restoration. It should now work.

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!

trendup
I’ve tried the alpha release. I can dump and restore the database with ANGIE without errors, but the restored database don’t work.
At a first view, some tables are missing (like catalog_category_flat_store_1, catalog_product_entity_int, catalog_product_entity_varchar) and some tables are empty (like catalog_product_enabled_index).

nicholas
Akeeba Staff
Manager
The modifier we added can't prevent entire tables or their contents from being restored. Most likely you have excluded tables from your backup. You can check that by inspecting the files under installation/sql in the extracted backup archive.

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!

trendup
I see some tables exluded (the ones with _tmp suffix) but in installation/sql file, searching for "_product_entity_varchar" I can’t find occurences.

nicholas
Akeeba Staff
Manager
I found that a quick solution is to disable the dependency checks. Go to Akeeba Backup, Configuration, find the Database Backup Engine row and click on the Configure button. In the pane below check the "No dependency tracking" box, then click on Save & Close. The next backup will include all tables.

I am still investigating why this happens with Magento.

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!

System Task
system
This ticket has been automatically closed. All tickets which have been inactive for a long time are automatically closed. If you believe that this ticket was closed in error, please contact us.

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!