Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
  #1  
Old 10-20-2010, 11:18 AM
emath emath is offline
 
Join Date: Sep 2008
Posts: 252
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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.
Reply With Quote
  #2  
Old 10-23-2010, 08:24 AM
Konstantinos Konstantinos is offline
 
Join Date: Apr 2006
Posts: 443
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #3  
Old 10-26-2010, 06:29 AM
emath emath is offline
 
Join Date: Sep 2008
Posts: 252
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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 .....
Reply With Quote
  #4  
Old 10-26-2010, 11:33 AM
Konstantinos Konstantinos is offline
 
Join Date: Apr 2006
Posts: 443
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

what was the problems u encountered ?
Reply With Quote
  #5  
Old 10-26-2010, 11:40 AM
emath emath is offline
 
Join Date: Sep 2008
Posts: 252
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

as i said, ive seen only english and gibbresh , no hebrew ...
Reply With Quote
  #6  
Old 10-26-2010, 11:53 AM
Konstantinos Konstantinos is offline
 
Join Date: Apr 2006
Posts: 443
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 02:59 PM.


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.03935 seconds
  • Memory Usage 2,198KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (6)post_thanks_box
  • (6)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (6)post_thanks_postbit_info
  • (6)postbit
  • (6)postbit_onlinestatus
  • (6)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete