First, you have to make sure that the template is J5 native (meaning not needing the J5 compatibility plugin). To do so, you have to exchange any appearance of a deprecated class with the new J5 class:
- Prepare a (local) dev site.
- You find the complete list in the developer documentation of Joomla
here
- Visual Studio Code is very helpful to find and replace all occurences.
Example:
- You find an occurrence of JFactory like this
$user = JFactory::getUser();
- You can replace this either with:
$user = Joomla\CMS\Factory::getUser();
- Or you can put a use-statement right at the beginning of the file (after the defined('_JEXEC') or die; ) like this:
use Joomla\CMS\Factory;
with this, you can shorten the statement to:
$user = Factory::getUser();
Repeat that for all old classes in all php files of the template. VSC helps you by showing the class names in a different color like that:
It's a tedious task, but it took me only about one day including testing for one template (Skylar).
Be aware that this is not a real refactoring of the code, but just the minimum task to get things going.
And the good news: After that activity, the modified template works under J6 with the J6 compatibility plugin disabled.