The system database must be in UNICODE (UTF-8).
To convert your database to Unicode:
Log in as root and stop the control panel:
For Linux:
/etc/rc.d/init.d/httpdcp stop
killall -9 java
For FreeBSD:
/usr/local/etc/rc.d/apachecp.sh stop
killall -9 java
Type:
su -l cpanel -c 'psql hsphere'
hsphere# \encoding
If the encoding is UNICODE (UTP-8), you have found what you need. If not, the next step is to dump Parallels H-Sphere system database.
mkdir pg_backup
cd pg_backup
wwwuser. You'll need it to query the database:cat ~cpanel/shiva/psoft_config/hsphere.properties | grep PASS
Export schema:
pg_dump -u -s -f schema.db hsphere
chmod 600 schema.db
cp -p schema.db schema_backup.db
Export data:
pg_dump -u -a -f data.db hsphere
chmod 600 data.db
cp -p data.db data_backup.db
Notes:
fsync=off
in postgresql.conf. When you are done, unset this option back for safety reasons.
chmod 700
Convert the dump into Unicode with the iconv utility.
Linux:
iconv --from-code=<REGIONAL_ENCODING> --to-code=UTF-8 -o utf_data.db data.db
mv utf_data.db data.db
FreeBSD:
iconv -f <REGIONAL_ENCODING> -t UTF-8 data.db > utf_data.db
mv utf_data.db data.db
If your dump file exceeds 2GB:
split -b 1024m data.db data_db
iconvfor for each of these files to convert them to UNICODE: iconv --from-code=<REGIONAL_ENCODING>--to-code=UTF-8 -o utf_data_db.aa data_db.aa
iconv --from-code=<REGIONAL_ENCODING>--to-code=UTF-8 -o utf_data_db.ab data_db.ab
...
cat utf_data_db.aa utf_data_db.ab utf_data_db.ac ... > data.db
Here, <REGIONAL_ENCODING> is the source encoding. For example, for native US English encoding:
Linux:
iconv --from-code=ISO-8859-1 --to-code=UTF-8 -o utf_data.db data.db
FreeBSD:
iconv -f ISO-8859-1 -t UTF-8 data.db > utf_data.db
The resulting data.db file will contain the data converted to Unicode.
For better security, run the following command:
chmod 600 data.db
postgres directory in a backup location.For Linux:
/etc/rc.d/init.d/postgresql stop
For FreeBSD:
/usr/local/etc/rc.d/010.pgsql.sh stop
For Linux:
cp -pR ~postgres/data ./
For FreeBSD:
cp -pR ~pgsql/data ./
For Linux:
/etc/rc.d/init.d/postgresql start
For FreeBSD:
/usr/local/etc/rc.d/010.pgsql.sh start
# su -l cpanel
$ dropdb hsphere
createdb -E UNICODE -U wwwuser hsphere
psql -q -U wwwuser -f schema.db hsphere
psql -q -U wwwuser -f data.db hsphere
Note: If you face problems with importing data, please see the Troubleshooting section in CP Acceleration guide.
fsync=off
to postgresql.conf, don't forget to delete it.