Tricks and workarounds

Importing multilingual databases

CMigrator is perfectly capable of importing data that is not stored in the English(latin) language. However there are few things that you need to be aware of before proceeding with the import of such data.

To illustrate the complexity we will look at the Categories in Joomla. Each category has a title and an alias field. The alias field is used when Joomla creates SEF URLs. It has to always be unique. If you try to save a category with an alias that is already existing in the database - you'll get an error. The alias is generally automatically generated from the title field. So if you have a title: "My awesome article" the automatically generated alias would be "my-awesome-article". The next time you try to create an article that has the title "My awesome article" you'll get an error stating that there is already an article with the same alias. You could then just change the alias to "my-awesome-article-1" and everything will be fine.

That is all good, but what actually happens if you have an article in let us say Bulgarian with a title: "Супер статия". The automatically generated alias for this article would be "" -> yes that is right -> just empty space. Now this only happens if you don't have the Bulgarian language pack. If you have it installed and enabled, then the alias for the article will be "super-statia". Each language package comes with a file called lang.localise.php (where lang is the language in question for example bg-BG). This file contains a transliteration function. The transliteration function maps the non-latin characters to Latin characters. For example "п" => "p" . If you are trying to migrate data that is not in latin and you don't have the appropriate language pack, then most probably the import won't give the expected results. It can even fail, because we will try to save categories or articles that have the same aliases (empty spaces...).

To fix this always make sure that if you are importing data that is in Greek - you have the Greek language pack installed and enabled! The language pack should be enabled in the backend and the user making the migration should be using it.

[Important]Important

The fact that a language file is being installed on a website doesn't mean that it is also being used. Make sure that the language is enabled for the backend and that the current user making the migration is using it. Only then the transliteration function will be able to properly create the aliases.