vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   change database from latin1 to UTF8 (https://vborg.vbsupport.ru/showthread.php?t=252336)

emath 10-20-2010 11:18 AM

change database from latin1 to UTF8
 
i want to change my database from latin1 to UTF8 , the ALL COLLATION .

i tried the latest version of vCharset and few other stuff like using this code :

PHP Code:

<?php
// Don't forget to enter your db infos.

define('THIS_SCRIPT''convert');
require 
'./global.php';

//---------------

header('Content-type: text/plain');

$dbconn mysql_connect('localhost''name, '********' or die( mysql_error() );
mysql_select_db("emath_arielutf");

$sql = "ALTER DATABASE `name` DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci";
$result = mysql_query($sql) or die( mysql_error() );
print "Database changed to UTF-8.\n";

$sql = '
SHOW TABLES';
$result = mysql_query($sql) or die( mysql_error() );

while ( $row = mysql_fetch_row($result) )
{
$table = mysql_real_escape_string($row[0]);
$sql = "ALTER TABLE $table DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci, CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci";
mysql_query($sql) or die( mysql_error() );
print "$table changed to UTF-8.\n";
}

mysql_close($dbconn);
?>

tried also : http://en.gentoo-wiki.com/wiki/Conve...UTF-8_in_MySQL

any one have an idea how to do it perfectly?

im using vb3.8.6

thanks.

Konstantinos 10-23-2010 08:24 AM

i did this and it was the most diffucult thing i ever did in my life. this vcharset is junk. i have a big db so in some tables the encoding process returned errors. i had to manually fix some ,

anyway i dont know how big is your db but u should check this out.

http://www.vbulletin.com/forum/showt...=1#post1816873

it will give u an idea on how to start, get a test forum and a dump and start testing importing etc. if any tables return errors try to exclude them from the dump, then encode the db with the excluded tables, and then if this happens i ll tell u what i did.

emath 10-26-2010 06:29 AM

it didnt worked for me !
(i had many problems, after solveing them , i had a collation mix problem, so i converted all the collation also, and then after i successfully logged in my admin cp i didnt see hebrew , only english and gibbreish - although i used UTF8 encoded.. )

my db size is about 220MB .

anyone can make it clear once and for all how to do the convert?

so many people are looking for this .....

Konstantinos 10-26-2010 11:33 AM

what was the problems u encountered ?

emath 10-26-2010 11:40 AM

as i said, ive seen only english and gibbresh , no hebrew ...

Konstantinos 10-26-2010 11:53 AM

u need to convert it 3 times then - from english to utf-8, from gibbresh to utf-8 and from hebrew to utf-8

3 times this command iconv -c -f windows-1252 -t utf-8 your-database.sql > your-database_utf8.sql

replacing windiws-1252 with the appropriate encoding for gibbresh and hebrew


All times are GMT. The time now is 01:01 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01772 seconds
  • Memory Usage 1,724KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete