Support

Site Restoration

#16243 Restore of jpa file failing - db restoration giving errors

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
n/a
CMS Type
Other
CMS Version
n/a
Backup Tool Version
n/a
Kickstart version
n/a

Latest post by nicholas on Friday, 07 June 2013 12:49 CDT

e-ware
Mandatory information about my setup:

Environment where I am restoring to:
Akeeba Kickstart Pro 3.5.1
ABI 3.6.12
Debian 6.0.7
Plesk 11.0.9
PHP 5.3.3-7
mysql 5.1.66-0


Have I read the related troubleshooter articles above before posting (which pages?)? Yes
Have I searched the tickets before posting? Yes
Have I read the documentation before posting (which pages?)? Yes
Joomla! version: 2.5.11
PHP version: 5.3.3-7
MySQL version: 5.1.66-0
Host: 94.198.160.68
Akeeba Backup version which took the backup: Akeeba Pro 3.7.7
Kickstart version used to extract the backup: Akeeba Pro Kickstart 3.5.1

Description of my issue:
Extract of the archve goes fine
connection to the db goes fine
extract of the db fails around 85%, with error MySQL: MySQL query failed with error 1146 (Table 'iticaorg.j25_toes_view_full_entry' doesn't exist).

This view is in the original database, this view has the same J25_ prefix as any other table view in the db.
Strange thing is, this same archive extracts without a problem on a shared host with the same provider (the one I am installing on here is a VPS)
No idea what is going on, and would like to prevent having to manually restore the db

Thank you in advance for any assistance you may provide

PS: if needed I can grant you access to the VPS for hands on test

nicholas
Akeeba Staff
Manager
Please try using a lowercase database table prefix, i.e. j25_ instead of J25_. This has to do with the way MySQL treats table names internally, how the database files are created and the way the operating system treats lower and upper case filenames.

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!

e-ware
Hello Nicolas,
It is already in lowercase now.
error MySQL: MySQL query failed with error 1146 (Table 'iticaorg.j25_toes_view_full_entry' doesn't exist).

nicholas
Akeeba Staff
Manager
You should be getting a SQL query in the error message. Can you please copy it to a text file, then ZIP and attach it with your reply?

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!

e-ware
Error at the line 24: CREATE OR REPLACE ALGORITHM=UNDEFINED VIEW `#__toes_view_cats_per_division` AS select `e`.`show_id` AS `show_id`,`e`.`show_day` AS `show_day`,`sc`.`show_class` AS `show_class`,`e`.`breed_name` AS `br ... MySQL: MySQL query failed with error 1146 (Table 'iticaorg.j25_toes_view_full_entry' doesn't exist). The query was:CREATE OR REPLACE ALGORITHM=UNDEFINED VIEW `j25_toes_view_cats_per_division` AS select `e`.`show_id` AS `show_id`,`e`.`show_day` AS `show_day`,`sc`.`show_class` AS `show_class`,`e`.`breed_name` AS `breed_name`,concat(`e`.`category`,' ',`e`.`division_name`,' Division') AS `catalog_division`,count(`e`.`entry_id`) AS `cats_in_this_division` from ((((`j25_toes_view_full_entry` `e` left join `j25_toes_show_class` `sc` on((`e`.`Show_Class` = `sc`.`show_class`))) left join `j25_comprofiler` `c` on((`c`.`user_id` = `e`.`summary_user`))) left join `j25_toes_club_organizes_show` `cos` on((`cos`.`show` = `e`.`show_id`))) left join `j25_toes_club` `club` on((`club`.`club_id` = `cos`.`club`))) where ((`sc`.`show_class_id` > 0) and (`sc`.`show_class_id` <= 17) and ((`e`.`entry_status` = 'Accepted') or (`e`.`entry_status` = 'Confirmed') or (`e`.`entry_status` = 'Confirmed & Paid')) and (`e`.`show_id` = 5)) group by `e`.`show_day`,`sc`.`show_class_id`,`e`.`breed_name`,`e`.`copy_cat_category`,`e`.`copy_cat_division` order by `e`.`show_day`,`sc`.`show_class_id`,`e`.`breed_name`,`e`.`copy_cat_category`,`e`.`copy_cat_division`,`e`.`cat`

nicholas
Akeeba Staff
Manager
The restoration halts when MySQL refuses to restore the #__toes_view_cats_per_division database view. The view definition is correct, but it references another view, #__toes_view_full_entry.

When you have VIEWs, FUNCTIONs, PROCEDUREs or TRIGGERs referencing other tables / views you need to enable an optional feature in Akeeba Backup. Go to the Configuration page for your Akeeba Backup profile and find the "Database backup engine" row. Click on the configure button next to it. Find the no dependency tracking checkbox and make sure it is not checked. Then proceeded to taking a new backup. The new backup should restore without an issue, as long as you're not excluding any of the tables referenced by the views.

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!

e-ware
I checked the settings, but that check box was already unchecked.
I took another backup and tried restoring again, but the problem remains. This is a backup of another version of the same site, but it seems restoring the views remains an issue.

Any other suggestions?

Database error processing line 99

Database server error reply:

SQL=CREATE OR REPLACE ALGORITHM=UNDEFINED VIEW `j25_toes_view_cats_per_division` AS select `e`.`show_id` AS `show_id`,`e`.`show_day` AS `show_day`,`sc`.`show_class` AS `show_class`,`e`.`breed_name` AS `breed_name`,concat(`e`.`category`,' ',`e`.`division_name`,' Division') AS `catalog_division`,count(`e`.`entry_id`) AS `cats_in_this_division` from ((((`j25_toes_view_full_entry` `e` left join `j25_toes_show_class` `sc` on((`e`.`Show_Class` = `sc`.`show_class`))) left join `j25_comprofiler` `c` on((`c`.`user_id` = `e`.`summary_user`))) left join `j25_toes_club_organizes_show` `cos` on((`cos`.`show` = `e`.`show_id`))) left join `j25_toes_club` `club` on((`club`.`club_id` = `cos`.`club`))) where ((`sc`.`show_class_id` > 0) and (`sc`.`show_class_id` <= 17) and ((`e`.`entry_status` = 'Accepted') or (`e`.`entry_status` = 'Confirmed') or (`e`.`entry_status` = 'Confirmed & Paid')) and (`e`.`show_id` = 5)) group by `e`.`show_day`,`sc`.`show_class_id`,`e`.`breed_name`,`e`.`copy_cat_category`,`e`.`copy_cat_division` order by `e`.`show_day`,`sc`.`show_class_id`,`e`.`breed_name`,`e`.`copy_cat_category`,`e`.`copy_cat_division`,`e`.`cat`

Raw query text:

CREATE OR REPLACE ALGORITHM=UNDEFINED VIEW `#__toes_view_cats_per_division` AS select `e`.`show_id` AS `show_id`,`e`.`show_day` AS `show_day`,`sc`.`show_class` AS `show_class`,`e`.`breed_name` AS `breed_name`,concat(`e`.`category`,' ',`e`.`division_name`,' Division') AS `catalog_division`,count(`e`.`entry_id`) AS `cats_in_this_division` from ((((`j25_toes_view_full_entry` `e` left join `#__toes_show_class` `sc` on((`e`.`Show_Class` = `sc`.`show_class`))) left join `#__comprofiler` `c` on((`c`.`user_id` = `e`.`summary_user`))) left join `#__toes_club_organizes_show` `cos` on((`cos`.`show` = `e`.`show_id`))) left join `#__toes_club` `club` on((`club`.`club_id` = `cos`.`club`))) where ((`sc`.`show_class_id` > 0) and (`sc`.`show_class_id` <= 17) and ((`e`.`entry_status` = 'Accepted') or (`e`.`entry_status` = 'Confirmed') or (`e`.`entry_status` = 'Confirmed & Paid')) and (`e`.`show_id` = 5)) group by `e`.`show_day`,`sc`.`show_class_id`,`e`.`breed_name`,`e`.`copy_cat_category`,`e`.`copy_cat_division` order by `e`.`show_day`,`sc`.`show_class_id`,`e`.`breed_name`,`e`.`copy_cat_category`,`e`.`copy_cat_division`,`e`.`cat`

nicholas
Akeeba Staff
Manager
Can you please try excluding the #__toes_view_cats_per_division from the backup using the Database Table Exclusion feature in Akeeba 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!

e-ware
Tried that, no succes either.

This is what I did now:
  • manually export import all TABLES from the source database

  • manually import all tables on target database

  • run scripts to create all the views again on the target database


once this was done, the site works on the target server.

Then, I tried running kickstart again, with the SAME jpa file that failed before.
This time it installs successfully.

So I see two possible explanations:
1 - there is something wrong in the backup or restore that makes the restore fail if the tables were not already on the target server to begin with
2 - not all tables are being restored before the views are being restored, causing erros like the ones encountered

Could you please advise on how to determine this? I need to be able to trust that the backup I am running is good, and can restore on a clean host


Thank you

nicholas
Akeeba Staff
Manager
I am sure there is a cyclic reference of views somewhere, e.g. View A referencing View B which references View C which references View A. This cannot be solved automatically (well, sometimes it can, but the computation is way to expensive to be practical).

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!

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!