This guide describes migration of Phoca components (Phoca Gallery, Phoca Download, Phoca Cart) from Joomla 3 to Joomla 4. Described migration steps can be used for all other Phoca extensions in similar way (except Phoca Guestbook, which has specific guide, see below).
 
Backup all your data (old and new database, old and new files and folders) before making migration.
 
There are two parts which should be migrated:
  • Files: in case of Phoca Gallery, these are images and thumbnails, in case of Phoca Download,  these are all downloadable files (preview and play files), in case of Phoca Cart,  these are images, thumbnails, downloadable files
  • Data in database: all information about Phoca Gallery, Phoca Download or Phoca Cart stored in database.

 

To export/import files you will need FTP manager (or you can use Phoca Commander - file manager).
To export/import data you will need phpMyAdmin application (runs on most webhosting servers).

 

Joomla 3 (exporting site)

Be sure you have installed latest Phoca Gallery (Phoca Download, Phoca Cart) version on your Joomla 3 site. If not, just upgrade to latest version on your obsolete website, in our example:
  • Phoca Gallery: 4.4.3
  • Phoca Download: 3.2.3
  • Phoca Cart 3.5.8.

 

Exporting files (Joomla! 3)

 

Connect to your server with FTP client and navigate to Joomla root folder. Copy the following folders (include all subfolders and files) to your PC (to some temporary backup folder) from your server:

Phoca Gallery:
[images/phocagallery] folder
Phoca Download:
[images/phocadownload] folder
[phocadownload] folder - in case you are using your own folder for Phoca Download files, then just copy your folder.
[phocadownloadpap]
Phoca Cart:
[images/phocacartcategories] folder
[images/phocacartproducts] folder
[phocacartdownload] folder
[phocacartdownloadpublic] folder
 
Now you have made backup all your files and folders from Phoca Gallery (Phoca Download, Phoca Cart).
 
 

Exporting data (Joomla 3)



Login to your phpMyAdmin application, select database where all data of your Joomla 3 site are stored.
 
Click on Export folder.
 
Migration - Export folder
 
Select tables you want to backup (all Phoca Gallery tables except jos_phocagallery_styles or all Phoca Download tables or Phoca Cart tables).
 
Migration - Export Phoca Gallery
 
Migration - Export Phoca Download
 
These are all tables starting with:
 
  • Phoca Gallery: jos_phocagallery (#__phocagallery) (except jos_phocagallery_styles - there are completely new styles in Joomla 4 so old will be not compatible)
  • Phoca Download: jos_phocadownload (#__phocadownload)
  • Phoca Cart: jos_phocacart (#__phocacart).


In Output settings select: Set output to a file (to store the SQL queries in file).
 
Migration - Save output to a file


In Dump table option set data (only data will be backed up, not table structure - this is important as in Joomla 4 new columns were added. Such columns will be automatically added during installation and they will be not in conflict with exported data).
 
 
In newer version of phpMyAdmin, Dump table feature looks different. In the beginning of export process, you can select the tables to export. Right there you can set if Structure and/or Data will be exported. Select only Data to export. See image:
 


Dump tables
 
 
As Syntax to use when inserting data set both of the above.
 
 
Migration - Syntax to use when inserting data


Save the backup (SQL queries) as e.g. phocagallery.sql (phocadownload.sql, phocacart.sql). Now all Phoca Gallery or Phoca Download or Phoca Cart data of old Joomla 3 site are backed up.



Joomla! 4 (importing site)


Be sure you have installed the latest Phoca Gallery (Phoca Download, Phoca Cart) version on your Joomla 4 site. If not, just upgrade to latest version:
  • Phoca Gallery: 4.5.0 (the latest version when this guide was written)
  • Phoca Download: 4.0.0 (the latest version when this guide was written)
  • Phoca Cart 4.0.0 (the latest version when this guide was written).

 

BE AWARE, PHOCA GALLERY JOOMLA 3 VERSION IS 4.4.x AND PHOCA GALLERY JOOMLA 4 VERSION IS 4.5.x (it is not the same like by other Phoca extensions where the version number is equal to Joomla version number, example: Phoca Cart 3 = Joomla 3, Phoca Cart 4 = Joomla 4, in case of Phoca Gallery: Phoca Gallery 4.4.x = Joomla 3, Phoca Gallery 4.5 = Joomla 4).

 

Installing newest version in your newly created Joomla! 4 website is necessary, so Phoca Gallery (Phoca Download, Phoca Cart or another Phoca extension) gets all the necessary database tables installed.
If you get for example this error: Table '#__phocagallery_styles' doesn't exist, this mostly means that the newest version was not installed.



Importing files (Joomla 4)

 
Connect to your server with FTP client and navigate to Joomla! root folder and copy the following folders (include all subfolders and files) from your PC (from the temporary folder created to backup files from old Joomla! site) to your server:
 
Phoca Gallery:
[images/phocagallery] folder
Phoca Download:
[images/phocadownload] folder
[phocadownload] folder - in case you are using your own folder for Phoca Download files, then just copy your folder.
[phocadownloadpap]
Phoca Cart:
[images/phocacartcategories] folder
[images/phocacartproducts] folder
[phocacartdownload] folder
[phocacartdownloadpublic] folder


Now Phoca Gallery (Phoca Download, Phoca Cart) should include all images (files) from your old Joomla site.



Importing data (Joomla 4)

 
You need to set your own database prefix. In our examples, the jos_ is used but you should use your own database prefix (be aware, it can be different for both sites, in such case you need to overwrite prefix from backed up old site to prefix used on your new site).

Example - if the prefixes are different (jos3 or jos4 are only examples):
Joomla! 3 used for example jos3_ prefix
Joomla! 4 will use for example jos4_ prefix
After backup and before importing SQL queries you need to replace all jos3_ strings to jos4_ strings in stored backup file. Just open the phocagallery.sql or phocadownload.sql or phocacart.sql file in your text editor and replace the prefix by the table names.
 
All import actions must be done directly after installation of Phoca Gallery (Phoca Download, Phoca Cart) in Joomla 4.
 
All Phoca Gallery (Phoca Download, Phoca Cart) database tables must be empty before importing data from backup file (except jos_phocagallery_styles).
 
There are some tables which get data directly after installation and such data need to be removed because it will be imported from your current instance.
 
Login to your phpMyAdmin application, select Joomla 4 database.
 
Phoca Gallery: there is only one table with default data (jos_phocagallery_styles) but it was not recommended to export/import it in previous steps, so this table should include default data and should not be truncated.
 
Phoca Download: If you are exporting/importing Phoca Download data, before importing, you need to empty two tables (to avoid conflict). Run this SQL query in your phpMyAdmin:
 
TRUNCATE TABLE `jos_phocadownload_layout`;
TRUNCATE TABLE `jos_phocadownload_styles`;
 
 
Migration - Truncate Phoca Download Layout table
 
Phoca Cart: following tables need to be truncated (as they are not empty after installation):
 
TRUNCATE TABLE `jos_phocacart_order_statuses`
TRUNCATE TABLE `jos_phocacart_stock_statuses`
TRUNCATE TABLE `jos_phocacart_currencies`
TRUNCATE TABLE `jos_phocacart_form_fields`
TRUNCATE TABLE `jos_phocacart_groups`
 
 
Now, click on Import folder.
 
Migration - Import folder
 


Select file with backup from your disc (phocagallery.sql or phocadownload.sql, or phocacart.sql).
Click on Import (Go) button.
Now all data are imported to your new Joomla! site.
 
If you find this article not complete, please inform about this in Phoca Forum. Thank you.
 

Phoca Maps Migration

See guide above, the database tables to export are:
  • jos_phocamaps_map
  • jos_phocamaps_marker
  • jos_phocamaps_icon

Files from following folder should be copied:

[phocamapskml] folder

 

Phoca Restaurant Menu Migration

See guide above, the database tables to export are:
  • jos_phocamenu_config
  • jos_phocamenu_day
  • jos_phocamenu_email
  • jos_phocamenu_group
  • jos_phocamenu_item
  • jos_phocamenu_list

There are no files to be copied.

 

Phoca Guestbook Migration

Migration of Phoca Guestbook from Joomla 3 to Joomla 4 is different in comparison with other Phoca extensions. Because Phoca Guestbook guestbooks are not stored in own table but in Joomla! categories table.
 
Before making any changes to database, make the backup. Please be aware of your prefix. In our example, we will use standard prefix:
  • jos_ (this can be different to yours, so just change jos_ to your own prefix: yourprefix_)
1) There are no files to be copied
2) Export only items and logging table, there are two tables in Phoca Guestbook (Joomla 3):
  • jos_phocaguestbook_items
  • jos_phocaguestbook_logging

Go to your phpMyAdmin, to your Joomla 3 database, click on Export (see screenshots above to locate the parts which are described here):

  • 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

and click Go to store (backup) file with guestbook items. Now you have exported (made backup) guestbook items. For example, its name is phocaguestbook.sql

4) Open this file (phocaguestbook.sql) and edit it, change jos_ prefix to your new prefix in case it changed.

3) Go to administration of your new site (Joomla 4) and install Phoca Guestbook 4

4) Create new guestbook in Joomla 4. When you save the guestbook, you can see list of guestbooks - there you can see ID of your guestbook. Remember or note this ID.

Migration - Phoca Guestbook ID

5) Go to phpMyAdmin, to your Joomla 4 database, click on Import (see screenshots above to locate the parts which are described here):

  • File to Import: browse and select phocaguestbook.sql
  • Click on Go

Items will be imported to your Joomla 4 database.

6) Update category ID (set the ID which you have noted as guestbook ID):

UPDATE `jos_phocaguestbook_items` SET `catid` = '8';
UPDATE `jos_phocaguestbook_items` SET `catid` = '0' WHERE `id` = '1';