Page 1 of 1

Guesbook upgrade from Joomla 3 to Joomla 4 fails

Posted: 20 Jan 2023, 16:44
by 01Kuzma
Hello!
I am having trouble upgrading component from Joomla 3 to 4.
The described upgrade process https://www.phoca.cz/documents/50-jooml ... o-joomla-4 was successful for the gallery, but no for the guestbook.
I had two guestbooks on Joomla 3, exported SQL
The Joomla 3 website was directly upgraded to Joomla 4 (not a fresh install)
Then I create two guestbooks with the same name and alias on Joomla 4 website. Go to phpMyAdmin to import the `sql`, but I get this mySql error:
#1050 - Table 'prefix_phocaguestbook_items' already exists

How could it be solved?
Thank you!

Re: Guesbook upgrade from Joomla 3 to Joomla 4 fails

Posted: 21 Jan 2023, 20:13
by Jan
Hi, you should add only data not the structure when importing :idea:

Jan

Re: Guesbook upgrade from Joomla 3 to Joomla 4 fails

Posted: 22 Jan 2023, 14:39
by 01Kuzma
Hi!
Yes, the previous export was with structure, probably in the migration guide there is a typo:

Export Method: Custom
Tables: select only one table - jos_phocaguestbook_items, jos_phocaguestbook_logging
Output: Save output to a file
Format: SQL
Format-specific options: structure and data
Data dump options: both of the above


But, once I try to import only data, I receive this error:
`#1062 - Duplicate entry '1' for key 'prefix_phocaguestbook_items.PRIMARY'`

Re: Guesbook upgrade from Joomla 3 to Joomla 4 fails

Posted: 22 Jan 2023, 18:09
by 01Kuzma
UPDATE. I've exported old data with
Data creation options
Truncate table before insert
option enabled. And imported it back to J4. Have I done it right?
But I have two old guestbooks with `11` and `14` IDs. With which query do I have to update imported data? New empty guestbooks have `17` and `18` ids

Re: Guesbook upgrade from Joomla 3 to Joomla 4 fails

Posted: 25 Jan 2023, 18:49
by Jan
Hi, guestbooks are part of Joomla core com_categories table.

Guestbooks and entries are related through the ID of guestbook. So there are two possible way:

- you will truncate categories table and start to add new entries with new IDs and you will do this until you get the right IDs for guestbooks (not recommended)
- or you just correct the IDs in entries table - so they are related to new active guestbooks

E.g. from 11 tp 17 amd 14 to 18 in entries (phoca guestbook post table)

table - jos_phocaguestbook_items
column - catid

Image

Jan

Re: Guesbook upgrade from Joomla 3 to Joomla 4 fails

Posted: 25 Jan 2023, 21:09
by 01Kuzma
Thanks!
Resolved

Re: Guesbook upgrade from Joomla 3 to Joomla 4 fails

Posted: 01 Feb 2023, 01:43
by Jan
Ok