JoomGalleryfriends / JG4-dev

Development repository for JoomGallery v4.x
GNU General Public License v3.0
10 stars 6 forks source link

Update from JG3 #114

Closed Elfangor93 closed 1 year ago

Elfangor93 commented 1 year ago

This PR expands the script.php such that it prepares a Joomla 4 installation containing an old JoomGallery in such a way that it behaves like a new installed JoomGallery 4. The old JoomGallery data is preserved in order to start a migration afterwards.

Database

Filesystem

Extensions

How to test this PR

  1. Install the lastest Joomla 3.10.x together with the latest JoomGallery 3.6.x
  2. Create some categories and images
  3. Deactivate all JoomGallery 3.x extensions if any installed
  4. Update Joomla the usual way --> You have now a Joomla 4.x with a JoomGallery 3.x installed
  5. Install the zip file of this PR the usual way

Expected result

You will have now a Joomla 4.x with a JoomGallery 4.0.0 which looks and behaves like a fresh installed JoomGallery 4.0.0. But you will still find in the database all tables from the old JoomGallery 3.x installation: grafik

And even if can not see them in the category/image manager, the folderstructure including all images from the JoomGallery 3.x installation are still there.

All old php code files from the JoomGallery 3.x installation are removed.

AlexanderSupp commented 1 year ago

My first test results: I used an Akeeba-Backup from Fotofreunde-Much.de, Joomla 3.10.11 and transferred this to my WampServer. The restore works fine after a learning phase for me. I deactivated all JG extensions. I deleted some other extensions. Then I migrated to Joomla 4.3.2. The installation tokes 3 minutes. The installation of the update-script runs quickly without any problems. The result was 3.154 images in 153 directories. It seems that .jpeg files were not accepted. .jpg, .gif and .png are fine. I will continue further checks. Screenshot 2023-06-26 221339 Screenshot 2023-06-26 224133

AlexanderSupp commented 1 year ago

Correction: In the Joomla image options, jpeg is mentioned under allowed extensions. But this entry is missing in valid image file extensions. After correction, Joomla can also display these images in media.

MrMusic commented 1 year ago

Deactivate all JoomGallery 3.x extensions if any installed

AlexanderSupp commented 1 year ago

From my point of view, it works as designed. All images remain as in JG 3.6.x. The directory “Uncategorized” is new, and that's OK. The old database tables have been renamed. JG4-db-all-Screenshot 2023-06-29 191037

I am very excited about the next steps. Keep it up.

reni68 commented 1 year ago
- Joomla installed and latest JoomGallery
- Categories and images created
- no extra extensions installed except JG itself => nothing disabled
- Update from Joomla 3.10.12 to 4.3.3 successful
- Script ran successfully => see screenshot1
- Database tables now see screenshot2

PR114_1

PR114_2

PHP-Version: 8.0.15 auf XAMMP

Elfangor93 commented 1 year ago

I will merge this PR as oon as PR #113 is merged. Otherwise I will have a hard time merging the access service.

MrMusic commented 1 year ago

The update script renames all JoomGallery tables in the whole database. However, it may only rename the tables that have the correct prefix

@Elfangor93 Do you want to fix this problem in this PR or should there be a new afterwards?

Elfangor93 commented 1 year ago

The update script renames all JoomGallery tables in the whole database. However, it may only rename the tables that have the correct prefix.

I would suggest to do this automatically in the upgrade script. Only then is it ensured that there are no problems due to extensions that have not been deactivated. In a test this is exactly what happened. If necessary i could create a list of possible extensions of the JoomGallery for the search in the database.

@MrMusic Added your inputs. Can you please check.

MrMusic commented 1 year ago

Thanks for the improvement. The table prefix is now taken into account ->ok.

However, not all extensions are deactivated yet. This is probably because not all extensions are in the 'joomgallery' folder and 'name' and 'element' are different in the extension table. Here is a list of most extensions with 'element' name and 'folder' and which are outside the 'joomgallery' folder. jg-extensions.xlsx I would suggest to include the 'folder' column in the where query.

Elfangor93 commented 1 year ago

@MrMusic I improved the sql query such that all extensions from your xlsx file should be taken into account and getting deactivated. Please check and merge this PR afterwards if you are happy with the changes.

MrMusic commented 1 year ago

@Elfangor93 Thanks for the improvements. Apart from the one warning message with Folder::delete, there seems to be no problems. I think the PR can be merged.