Guesbook upgrade from Joomla 3 to Joomla 4 fails

Phoca Guestbook - creating guestbooks in Joomla! CMS
01Kuzma
Phoca Enthusiast
Phoca Enthusiast
Posts: 50
Joined: 01 Sep 2012, 10:27

Guesbook upgrade from Joomla 3 to Joomla 4 fails

Post 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!
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47794
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Guesbook upgrade from Joomla 3 to Joomla 4 fails

Post by Jan »

Hi, you should add only data not the structure when importing :idea:

Jan
If you find Phoca extensions useful, please support the project
01Kuzma
Phoca Enthusiast
Phoca Enthusiast
Posts: 50
Joined: 01 Sep 2012, 10:27

Re: Guesbook upgrade from Joomla 3 to Joomla 4 fails

Post 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'`
01Kuzma
Phoca Enthusiast
Phoca Enthusiast
Posts: 50
Joined: 01 Sep 2012, 10:27

Re: Guesbook upgrade from Joomla 3 to Joomla 4 fails

Post 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
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47794
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Guesbook upgrade from Joomla 3 to Joomla 4 fails

Post 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
If you find Phoca extensions useful, please support the project
01Kuzma
Phoca Enthusiast
Phoca Enthusiast
Posts: 50
Joined: 01 Sep 2012, 10:27

Re: Guesbook upgrade from Joomla 3 to Joomla 4 fails

Post by 01Kuzma »

Thanks!
Resolved
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47794
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Guesbook upgrade from Joomla 3 to Joomla 4 fails

Post by Jan »

Ok
If you find Phoca extensions useful, please support the project
Post Reply