Migrate from Joomla to PagibleAI CMS

The Joomla importer moves the articles, categories and menu items of a Joomla 3.10 or newer site into PagibleAI. Article texts are converted like Joomla renders them, including content plugins, module shortcodes and custom fields, and the redirects and translations are imported as well.

This guide covers the Joomla-specific parts. Read Migrate to PagibleAI first for installing the importer, the options all importers share and the checklist after the import.

Connect the Joomla database

Add the Joomla database to the connections array in config/database.php:

'joomla' => [
    'driver' => 'mysql',
    'host' => env('JOOMLA_DB_HOST', '127.0.0.1'),
    'database' => env('JOOMLA_DB_DATABASE', 'joomla'),
    'username' => env('JOOMLA_DB_USERNAME', 'root'),
    'password' => env('JOOMLA_DB_PASSWORD', ''),
],

Pass the table prefix of the Joomla site ($dbprefix in its configuration.php) with --prefix, e.g. --prefix=jos_. Without it, the tables are read without prefix. If the connection has a prefix setting, it's added in front of the --prefix value.

Run the import

Check what would be imported first:

php artisan cms:joomla-import --domain=example.com --prefix=jos_ --file-base=https://example.com --dry-run

Then run the import without --dry-run. Always pass the URL of the Joomla site with --file-base. Without it, images and files keep relative URLs that browsers can't load from the PagibleAI site.

The pages are imported as English pages by default. If the default language of the Joomla site is another one, pass its language code with --lang, e.g. --lang=de. Otherwise, the pages get the wrong language, and with the language filter plugin, the content of the default language isn't imported as pages.

If the Joomla site isn't in UTC, pass its time zone (the offset setting in the global configuration) with --timezone, e.g. --timezone=Europe/Berlin. It's used for the dates of calendar fields and for --since. If Joomla adds .html to the URLs (the sef_suffix setting), pass --suffix, so the suffix is removed from the URLs of the redirects.

Page hierarchy

The page tree comes from the menu items of one menu, mainmenu by default. Pass another menu type with --menu. You find the menu type of each menu in the Joomla administrator under Menus → Manage, in the "Menu type" column.

  • The home menu item becomes the root page.
  • The other menu items of the menu become pages.
  • Categories without a menu item become folder pages.
  • Articles are placed below the pages of their categories.

Content

Article texts and category descriptions become content elements like Joomla renders them, including:

  • content plugins and module shortcodes
  • custom fields and tags
  • the intro and full text images and the links of the "Images and Links" tab
  • embedded iframes like videos or maps

Links to Joomla pages point to the imported pages. The SEO settings of articles, categories and menu items become the meta data. The redirects of the Joomla "Redirect" component become hidden link pages below the root page.

Not imported: Users, menu items of other components like contacts or search, and modules other than custom modules in module shortcodes. Skipped menu items and modules are reported in the output, and the child items of skipped menu items are imported below the parent page.

Access and publishing dates

Articles, categories and menu items that guests can't see because of their access level or their publishing dates are imported as disabled pages. PagibleAI can't restrict them to the Joomla user groups or publish them at that time. Review these pages after the import and enable them or set their frontend access.

Translations

Associated articles, categories and menu items become translations of the imported pages. The languages are taken from the content languages of the Joomla site, and the language code is the first part of the language tag, e.g. de for de-DE. Use --language to import a language with another code or on a separate domain. The value is the Joomla language tag, the language code in PagibleAI and an optional URL:

php artisan cms:joomla-import --domain=example.com --prefix=jos_ --file-base=https://example.com --language=de-DE:de --language=fr-FR:fr:https://example.fr/
  • Translations in content languages that are unpublished or not available to guests are skipped with a warning, unless you pass the language with --language.
  • If an association contains several translations with the same language code, e.g. for de-AT and de-CH, only the first one becomes a translation. The others are imported as pages of their own and reported.
  • Links in translated articles use the menu items of their language, like in Joomla.

How language variants work in PagibleAI is described in Multilingual websites.

SQL custom fields

Custom fields of the "SQL" type show their stored values by default. With --sql-fields, the importer runs the queries of these fields on the Joomla database to show the option texts instead.

The queries are written by Joomla administrators and run as they are. Use a separate read-only database user for the Joomla connection, e.g. without the FILE privilege on MySQL. If a query can't be run safely, the stored values are shown with a warning.

Options

Besides the common options like --domain, --lang, --editor and --since, the Joomla importer accepts:

Option
Default
Description
--file-base
Base URL of the Joomla site, e.g. https://example.com
--prefix
No prefix
Joomla table prefix, e.g. jos_
--menu
mainmenu
Menu type used for the page hierarchy, see Menus → Manage
--language
Content languages
Language tag imported with another code or domain, e.g. de-DE:de or fr-FR:fr:https://example.fr/; repeatable
--suffix
Joomla adds .html to the URLs; the suffix is removed from the redirect URLs
--timezone
UTC
Time zone of the Joomla site, e.g. Europe/Berlin
--sql-fields
Run the queries of SQL custom fields to show their option texts

Run the import again

Run the same command again to update the pages while editors still work in Joomla. Pages whose articles, categories or menu items aren't imported any more, e.g. because they were deleted, trashed or unpublished, are disabled.

With --since, only the articles changed since the date are imported again, including their translations. The date is in the --timezone of the Joomla site. Changes of menu item options or modules and articles whose import failed before need an import without --since. See Migrate to PagibleAI for the details.

Troubleshooting

The import fails with a missing table error

The table prefix is wrong. Pass the $dbprefix value from the configuration.php of the Joomla site with --prefix, e.g. --prefix=jos_, and check that the connection has no additional prefix setting.

Images and files don't load

The import ran without --file-base, so the files have relative URLs. Import again with the URL of the Joomla site. The Joomla server must keep serving the files.

Pages are missing from the hierarchy

Only the menu items of one menu are imported. Pass the menu type that contains the site navigation with --menu. It's listed in the "Menu type" column under Menus → Manage. Articles without a menu item are placed below the pages of their categories.

Pages have the wrong language or are missing on a multilingual site

The default language of the Joomla site isn't English. Import again with --lang and the language code of the default language, e.g. --lang=de.

Restricted or scheduled articles are disabled

PagibleAI can't restrict pages to Joomla user groups or publish them at the Joomla dates. Enable the pages or set their frontend access after the import.

Translations of a language are missing

The content language is unpublished or not available to guests, so Joomla doesn't show it. Pass the language with --language, e.g. --language=de-DE:de, and import again.

A changed menu item wasn't updated

--since only checks the articles. Run an import without --since after changing menu items, modules or after failed imports.