Skip to content
Code on GitHub (opens in a new tab)

Documentation · Guides

Migrating from Joomla

How to rebuild a site made with Joomla using Ehundu, keeping its addresses, and what to redirect in the .htaccess.

Version 0.16

You do not migrate from Joomla: you rebuild. The content lives in a database, the look in a template that hardly anyone sees whole, and there is nothing resembling a source file. What you have is the site as a visitor sees it, and that is your reference. That is how Vía de Bayona Bureba (in Spanish) was made, with 188 pages and a blog from 2010 to 2016, and Kerizara (in Spanish), in Spanish and in Basque.

Save the site before touching it

Start by downloading the live site, with all its pages and its resources. A crawler does it; wget will do:

wget --mirror --page-requisites --adjust-extension https://www.example.com/

That copy is the reference you will compare with, and the only thing that will remain of the previous site the day you switch it off. Keep it with the project.

There are things the crawler does not see and that are downloaded separately. Listings with pagination, such as a blog's (?start=5), and listings by tag: Joomla cuts them at 20 articles without showing the pagination, and with ?limit=0 it gives them whole. And images that only the JavaScript names, such as the ones in a carousel.

Text to Markdown, design from scratch

With the HTML saved, a script of a few lines takes the text of each page into a Markdown file. It is a first draft: you go over it by hand, because Joomla's HTML carries all sorts of things. The templates and the CSS are written again, with the values of the original (colours, measurements, spacing), and checked side by side in the browser, on desktop and on mobile.

Reproduce the typography you see, not the one the template asks for. It can happen that a Joomla template asked for a serif font that no visitor ever saw, because the visitor saw another one.

It is a good moment to remove what is not needed. If the fonts are served by the site itself, the icons are SVG and the share buttons are ordinary links, the site needs nobody's cookies, and you can remove the notice, as long as the cookie policy says so.

Keep the addresses

If the addresses do not change, there is nothing to redirect and no ranking to lose. Keep the paths of the pages, with the reference for addresses (in Spanish) at hand, and those of the images: what was in images/ stays in publico/images/.

What does change is redirected in the .htaccess in publico/. Joomla's RSS and Atom feeds (/blog?format=feed&type=rss) move to the new feed:

RewriteCond %{QUERY_STRING} (^|&)format=feed(&|$) [NC]
RewriteRule ^ /feed.xml? [R=301,L]

The ? at the end of the rule removes the query from the new address. If the default language used to be under /es/ and now goes at the root, and if there are addresses left with index.php:

RewriteRule ^es/?$ https://%{HTTP_HOST}/ [R=301,L]
RewriteRule ^es/(.+?)/?$ https://%{HTTP_HOST}/$1/ [R=301,L]
RewriteRule ^index\.php$ https://%{HTTP_HOST}/ [R=301,L]

Joomla pages used to go without the trailing slash. Ehundu writes them with it, and this rule makes the jump in one step, with HTTPS:

RewriteCond %{REQUEST_FILENAME} -d
RewriteCond %{REQUEST_URI} !/$
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1/ [R=301,L]

Complete addresses, with https:// and the domain, stop Apache from completing a path with http and the visit taking one jump too many. And if the site has several languages, Several languages explains how it is organised: the default one without a prefix and the others under /eu/, for example.

Forms and what is left on the server

A Joomla form processes the submission with PHP, and a static site has no PHP. You need a form service that receives the submission and emails it; Ehundu does not include one.

And remember that Joomla is still on the server. When you deploy, its files stay where they were, because Ehundu only deletes what it uploaded itself. When you have checked that the new site works, make a copy and remove the old Joomla, with its index.php and its administration folder: a Joomla that nobody updates is a risk. If some is left loose, a DirectoryIndex index.html in the .htaccess makes sure the home page is the new one.

Deploy first to a test address, go through the pages with the reference beside you and, when everything matches, change the domain. The guide Deploying the site explains how.