9.2. Compatibility Issues
As of version 2.1.0, Campsite uses UTF-8 encoding the older database
and templates must be converted; the database conversion is more
complex and error prone while the templates conversion requires only
the issuing of one shell command.
Conversion from any character set to UTF-8 can be achieved by using standard iconv tool; for usage type “man iconv”.
Converting the database can be done in three steps:
dumping the old database into different files
converting the files from their character sets to UTF-8
reconstructing the database from the files
Important!!!
The database upgrade must take place before Campsite application
upgrade. If the application upgrade already took place, “ArticleTopics”
and “Topics” tables must be added to the list of tables that need not
be converted to UTF.
Open a shell session and type all the following commands described below at the command prompt. Shell commands are written in italic style.
Dumping the old database into different files
where [database] should be replaced by the name of the Campsite
database and “...” with other needed parameters (user, host etc.)
Don't forget to add “ArticleTopics” and “Topics” to the list of tables if Campsite upgrade took place already.
Dump data for tables that should be converted to UTF
Group languages having the same character set (see Languages in admin
interface and read the following note below). For every character set
used repeat the following steps:
select all the languages in the character set and compose the where clause:
"IdLanguage = [l1] or IdLanguage = [l2] ..."
where [l1], [l2] are the language identifiers. In order to read the
language identifiers and character sets log in to Campsite database and
run the following sql: “select Name, Id, CodePage from Languages”.
mysqldump ... -t --tables --where="IdLanguage = [l1] or IdLanguage = [l2]..." \
[database] Articles Classes Countries Dictionary Errors Issues \
KeywordClasses Sections TimeUnits > data_[charsetn]_1.sql
mysqldump ... [database] -t --tables \
--where="IdDefaultLanguage = [l1] or IdDefaultLanguage = [l2]..." \
Publications > data_[charsetn]_2.sql
mysqldump ... -t --tables --where="Id = [l1] or Id = [l2]..." [database] \
Languages > data_[charsetn]_3.sql
make a list of all X tables (tables whose names start with X) and dump their data:
mysqldump ... -t --tables --where="IdLanguage = [l1] or IdLanguage = [l2]..." \
[database] [list_of_X_tables] > data_[charsetn]_4.sql
Replace [l1], [l2] with language identifiers, [database] with Campsite
database name, “...” in mysqldump command with other needed parameters
(user, host etc.), [charsetn] with the name of the character set
(ISO-8859-1, ISO-8859-2 etc.), [list_of_X_tables] with the list of
tables whose names start with X; these are article content tables.
Note:
In order to simplify the conversion all not used languages except
English may be deleted. If only one language is used and it's character
set is ISO-8859-1 there is no need to group languages by character set:
just delete unused languages and perform the steps b through d
described above and remove “--where” clause from commands.
Select the character set for Log and dump Log table data:
mysqldump ... -t --tables [database] Log > data_log.sql
Selecting the character set for Log table data: decide which language
you use most often when logging in to Campsite admin interface and read
the character set of the language from Languages.
Convert files to UTF:
Convert tables.sql:
iconv -f ISO_8859-1 -t UTF8 tables.sql > tables_utf.sql
Warning!!! data_nolang.sql must not be converted to UTF8.
For every character set used repeat the following steps:
iconv -f [charsetn] -t UTF8 data_[charsetn]_1.sql > data_[charsetn]_1_utf.sql
iconv -f [charsetn] -t UTF8 data_[charsetn]_2.sql > data_[charsetn]_2_utf.sql
iconv -f [charsetn] -t UTF8 data_[charsetn]_3.sql > data_[charsetn]_3_utf.sql
iconv -f [charsetn] -t UTF8 data_[charsetn]_4.sql > data_[charsetn]_4_utf.sql
Convert Log table data:
iconv -f [log_charset] -t UTF8 data_log.sql > data_log_utf.sql
where [log_charset] is the character set selected for Log table.
Restore the database:
mysql ... [database] < tables_utf.sql
mysql ... [database] < data_nolang.sql
For every character set used repeat the following steps:
mysql ... [database] < data_[charsetn]_1_utf.sql
mysql ... [database] < data_[charsetn]_2_utf.sql
mysql ... [database] < data_[charsetn]_3_utf.sql
mysql ... [database] < data_[charsetn]_4_utf.sql
Restore Log table data:
mysql ... [database] < data_log_utf.sql
Converting the templates to UTF-8: issue the following commands for every template in the /look/ directory:
iconv -f [charset] -t UTF-8 [template_name] > [template_name].utf8
mv -f [template_name].utf8 [template_name]
where [charset] must be replaced by the template character set and [template_name] by the template being processed.
Updating templates structure: Some attributes of List Article statement are no longer supported in version 2.1, so all templates using those attributes must be updated.
Attributes no longer supported:
- IsOn|IsNotOn FrontPage
- IsOn|IsNotOn Section
Replacing unsupported attributes:
- "IsOn FrontPage" replaced by: "OnFrontPage is on"
- "IsNotOn FrontPage" replaced by: "OnFrontPage is off"
- "IsOn Section" replaced by: "OnSection is on"
- "IsNotOn Section" replaced by: "OnSection is off"
For details see List of Articles.
add a note
User Contributed Notes
9.2. Compatibility Issues
There are no user contributed notes for this page.