[SQL] Mangos to Trinity Char Converter

Hello there,

I’m searching for an Character Konverter from Mangos to Trinity…

I’ve tried it on my own, but my chars are always naked… I think the problem is the item_instance table… But I have no idea whats wrong… /emoticons/default_sad.png

Someone own an actual converter?

Thanks for you’re help…

greetz

Byte

I’ve updated an older, outdated converter a couple of months ago to use on my own server (at clientversion 3.3.3)… i’ll see what i can do about that one, but it’ll take some time to update to current version…

If you are the same person as in the mmonderds board, I have you post my converter !

Syoss

Hi everyone,

I need this converter too, I was searching for a way to copy my Mangos Characters and I found that there is some converters existing.

Does anybody knows how to do ?

i have an old 3.3.3 mangos → 3.3.5 trinity(96**) db converter. writed by me just of curious, it is not full but i believe it contain all you need(i mean examples) to add missing tables/data convertations on your own needs.

so if u really need it i can post it here.

p.s. i’m new to trinity and english is not my first language (:

This can be useful, can you post it please ?

Moved to utilities.

there you can see converter from 107** mangos to Trinity 104** (i can’t remember accurate revisions)

DO NOT USE THIS QUERY’S IF YOU EVEN DON’T KNOW HOW TO APPLY IT ON CORRECT DB’S AND BACKUP YOUR DATA AT FIRST!

part1

[SPOILER]USE trinity_auth;

– REALM TRANSFER QUERIES

INSERT INTO account (id,username,sha_pass_hash,email,joindate,last_ip,failed_logins,locked,last_login,expansion,mutetime,locale) SELECT id,username,sha_pass_hash,email,joindate,last_ip,failed_logins,locked,last_login,expansion,mutetime,locale FROM realmd.account;

INSERT INTO realmcharacters SELECT * FROM realmd.realmcharacters;

INSERT INTO account_access (id, gmlevel, RealmID) SELECT id,gmlevel, active_realm_id FROM realmd.account;

UPDATE account_access SET RealmID = -1;

INSERT INTO account_banned SELECT * FROM realmd.account_banned;

DELETE FROM realmlist;

INSERT INTO realmlist (id, name, address, port, icon, timezone, allowedSecurityLevel, population, gamebuild) SELECT id, name, address, port, icon, timezone, allowedSecurityLevel, population, realmbuilds FROM realmd.realmlist;

INSERT INTO ip_banned SELECT * FROM realmd.ip_banned;

INSERT INTO uptime (realmid, starttime, startstring, uptime, maxplayers) SELECT realmid, starttime, startstring, uptime, maxplayers FROM realmd.uptime;

[/SPOILER]
part2

[SPOILER]USE trinity_characters;

– CHARACTERS TRANSFER QUERIES

INSERT INTO account_data SELECT * FROM characters.account_data;

– addons – TC specific table, will be filled by TC

INSERT INTO arena_team SELECT * FROM characters.arena_team;

INSERT INTO arena_team_member (arenateamid, guid, played_week, wons_week, played_season, wons_season) SELECT arenateamid, guid, played_week, wons_week, played_season, wons_season FROM characters.arena_team_member;

INSERT INTO arena_team_stats SELECT * FROM characters.arena_team_stats;

INSERT INTO auctionhouse SELECT * FROM characters.auction;

– bugreport – skip

– channels – skip

INSERT INTO character_account_data SELECT * FROM characters.character_account_data;

INSERT INTO character_achievement SELECT * FROM characters.character_achievement;

INSERT INTO character_achievement_progress SELECT * FROM characters.character_achievement_progress;

INSERT INTO character_action SELECT * FROM characters.character_action;

INSERT INTO character_arena_stats (guid, slot, personal_rating) SELECT guid, (select type from arena_team where arenateamid), personal_rating FROM characters.arena_team_member;

– character_aura – this table is filled with buffs and similar spells, it can be dropped

– character_banned – better to skip it coz mangos doesn’t have this feature

INSERT INTO character_battleground_data SELECT * FROM characters.character_battleground_data;

– INSERT INTO character_battleground_random SELECT * FROM characters.character_battleground_random; – if you used RandomBG mod for you Mangos

INSERT INTO character_declinedname SELECT * FROM characters.character_declinedname;

INSERT INTO character_equipmentsets SELECT * FROM characters.character_equipmentsets;

INSERT INTO character_gifts SELECT * FROM characters.character_gifts;

– glyphs – you should use additional SQL file

INSERT INTO character_homebind SELECT * FROM characters.character_homebind;

INSERT INTO character_instance SELECT * FROM characters.character_instance;

INSERT INTO character_inventory SELECT * FROM characters.character_inventory;

INSERT INTO character_pet SELECT * FROM characters.character_pet;

INSERT INTO character_pet_declinedname SELECT * FROM characters.character_pet_declinedname;

INSERT INTO character_queststatus SELECT * FROM characters.character_queststatus;

INSERT INTO character_queststatus_daily (guid,quest) SELECT * FROM characters.character_queststatus_daily; – ?

INSERT INTO character_queststatus_weekly SELECT * FROM characters.character_queststatus_weekly;

INSERT INTO character_reputation SELECT * FROM characters.character_reputation;

INSERT INTO character_skills SELECT * FROM characters.character_skills;

INSERT INTO character_social SELECT * FROM characters.character_social;

INSERT INTO character_spell SELECT * FROM characters.character_spell;

– character_spell_cooldown – skip

INSERT INTO character_stats SELECT * FROM characters.character_stats;

– character_talent – talents will be reseted, sry

– character_tutorial – skip coz of structure difference

– characters – will be done at final phase

– corpse – skip

INSERT INTO creature_respawn SELECT * FROM characters.creature_respawn;

– game_event_condition_save – skip coz mangos doesn’t have this feature

– game_event_save – skip coz mangos doesn’t have this feature

INSERT INTO gameobject_respawn SELECT * FROM characters.gameobject_respawn;

– gm_subsurveys – skip coz mangos doesn’t have this feature

– gm_surveys – skip coz mangos doesn’t have this feature

– gm_tickets – skip coz of structure difference

– group_instance – skip

– group_member – skip coz of structure difference

– group_member – skip

– groups – skip

INSERT INTO guild SELECT * FROM characters.guild;

INSERT INTO guild_bank_eventlog SELECT * FROM characters.guild_bank_eventlog;

INSERT INTO guild_bank_item SELECT * FROM characters.guild_bank_item;

INSERT INTO guild_bank_right SELECT * FROM characters.guild_bank_right;

INSERT INTO guild_bank_tab SELECT * FROM characters.guild_bank_tab;

INSERT INTO guild_eventlog SELECT * FROM characters.guild_eventlog;

INSERT INTO guild_member SELECT * FROM characters.guild_member;

INSERT INTO guild_rank SELECT * FROM characters.guild_rank;

INSERT INTO instance SELECT * FROM characters.instance;

INSERT INTO instance_reset SELECT * FROM characters.instance_reset;

– item_instance – will be done at final phase

– item_refund_instance – skip coz of structure difference

– item_soulbound_trade_data – skip coz mangos doesn’t have this feature

– lag_reports – skip coz mangos doesn’t have this feature

INSERT INTO mail SELECT * FROM characters.mail;

INSERT INTO mail_items SELECT * FROM characters.mail_items;

– pet_aura – skip

INSERT INTO pet_spell SELECT * FROM characters.pet_spell;

– pet_spell_cooldown – skip

INSERT INTO petition SELECT * FROM characters.petition;

INSERT INTO petition_sign SELECT * FROM characters.petition_sign;

– pool_quest_save – skip coz mangos doesn’t have this feature

INSERT INTO reserved_name SELECT * FROM mangos.reserved_name;

UPDATE worldstates set value=(SELECT NextArenaPointDistributionTime from characters.saved_variables) where entry=20001;

UPDATE worldstates set value=(SELECT NextWeeklyQuestResetTime from characters.saved_variables) where entry=20002;

– UPDATE worldstates set value=(SELECT NextRandomBGResetTime from characters.saved_variables) where entry=20003; – if you used RandomBG mod for you Mangos

INSERT INTO characters (guid, account, name, race, class, gender, level, xp, money, playerBytes, playerBytes2, playerFlags, position_x, position_y, position_z, map, orientation, taximask, online, cinematic, totaltime, leveltime, logout_time, is_logout_resting, rest_bonus, resettalents_cost, resettalents_time, trans_x, trans_y, trans_z, trans_o, transguid, extra_flags, stable_slots, at_login, zone, death_expire_time, taxi_path, arenaPoints, totalHonorPoints, todayHonorPoints, yesterdayHonorPoints, totalKills, todayKills, yesterdayKills, chosenTitle, knownCurrencies, watchedFaction, drunk, health, power1, power2, power3, power4, power5, power6, power7, specCount, activeSpec, exploredZones, equipmentCache, ammoId, knownTitles, actionBars) SELECT guid, account, name, race, class, gender, level, xp, money, playerBytes, playerBytes2, playerFlags, position_x, position_y, position_z, map, orientation, taximask, online, cinematic, totaltime, leveltime, logout_time, is_logout_resting, rest_bonus, resettalents_cost, resettalents_time, trans_x, trans_y, trans_z, trans_o, transguid, extra_flags, stable_slots, at_login, zone, death_expire_time, taxi_path, arenaPoints, totalHonorPoints, todayHonorPoints, yesterdayHonorPoints, totalKills, todayKills, yesterdayKills, chosenTitle, knownCurrencies, watchedFaction, drunk, health, power1, power2, power3, power4, power5, power6, power7, specCount, activeSpec, exploredZones, equipmentCache, ammoId, knownTitles, actionBars FROM characters.characters;

[/SPOILER]
part3

[SPOILER]USE trinity_characters;

INSERT INTO character_glyphs (guid, spec) SELECT DISTINCT guid, spec FROM test_chars.character_glyphs;

UPDATE character_glyphs a SET glyph1 = (SELECT glyph FROM test_chars.character_glyphs WHERE guid = a.guid AND spec = a.spec AND slot = ‘0’);

UPDATE character_glyphs a SET glyph2 = (SELECT glyph FROM test_chars.character_glyphs WHERE guid = a.guid AND spec = a.spec AND slot = ‘1’);

UPDATE character_glyphs a SET glyph3 = (SELECT glyph FROM test_chars.character_glyphs WHERE guid = a.guid AND spec = a.spec AND slot = ‘2’);

UPDATE character_glyphs a SET glyph4 = (SELECT glyph FROM test_chars.character_glyphs WHERE guid = a.guid AND spec = a.spec AND slot = ‘3’);

UPDATE character_glyphs a SET glyph5 = (SELECT glyph FROM test_chars.character_glyphs WHERE guid = a.guid AND spec = a.spec AND slot = ‘4’);

UPDATE character_glyphs a SET glyph6 = (SELECT glyph FROM test_chars.character_glyphs WHERE guid = a.guid AND spec = a.spec AND slot = ‘5’);

[/SPOILER]
part4

[SPOILER]USE trinity_characters;

/* DROP Trinity table and use Mangos one */

DROP TABLE IF EXISTS item_instance;

CREATE TABLE item_instance (

guid int(11) unsigned NOT NULL default ‘0’,

owner_guid int(11) unsigned NOT NULL default ‘0’,

data longtext,

text longtext,

PRIMARY KEY (guid),

KEY idx_owner_guid (owner_guid)

) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT=‘Item System’;

/* Copy Mangos data */

INSERT INTO item_instance SELECT * FROM characters.item_instance;

/* Execute 07893_characters_item_instance.sql */

UPDATE item_instance SET data = REPLACE(data,’ ‘,’ ');

UPDATE item_instance SET data = CONCAT(TRIM(data),’ ');

UPDATE item_instance SET data = CONCAT(

SUBSTRING_INDEX(data, ’ ', 59 + 1), ’ ',

SUBSTRING_INDEX(data, ’ ', -3 -1), '0 ')

WHERE length(SUBSTRING_INDEX(data, ’ ', 64)) < length(data) and length(SUBSTRING_INDEX(data, ’ ', 64+1)) >= length(data);

UPDATE item_instance SET data = REPLACE(data,’ ‘,’ ');

UPDATE item_instance SET data = CONCAT(TRIM(data),’ ');

/* Don’t Execute 07904_characters_item_instance.sql coz mangos already has this field */

/* Execute 09090_characters_item_instance.sql */

– Add new fields

ALTER TABLE item_instance

ADD creatorGuid int(10) unsigned NOT NULL default ‘0’ AFTER owner_guid,

ADD giftCreatorGuid int(10) unsigned NOT NULL default ‘0’ AFTER creatorGuid,

ADD count int(10) unsigned NOT NULL default ‘1’ AFTER giftCreatorGuid,

ADD duration int(10) unsigned NOT NULL AFTER count,

ADD charges text NOT NULL AFTER duration,

ADD flags int(10) unsigned NOT NULL default ‘0’ AFTER charges,

ADD enchantments text NOT NULL AFTER flags,

ADD randomPropertyId int(11) NOT NULL default ‘0’ AFTER enchantments,

ADD durability int(10) unsigned NOT NULL default ‘0’ AFTER randomPropertyId,

ADD playedTime int(10) unsigned NOT NULL default ‘0’ AFTER durability;

– Temporarily change delimiter to prevent SQL syntax errors

DELIMITER ||

– Function to convert ints from unsigned to signed

DROP FUNCTION IF EXISTS uint32toint32||

CREATE FUNCTION uint32toint32(input INT(10) UNSIGNED) RETURNS INT(11) SIGNED DETERMINISTIC

BEGIN

RETURN input;

END||

– Restore original delimiter

DELIMITER ;

– Move data to new fields

UPDATE item_instance SET

creatorGuid = SUBSTRING(data,

length(SUBSTRING_INDEX(data,’ ',10))+2,

length(SUBSTRING_INDEX(data,’ ‘,10+1))-length(SUBSTRING_INDEX(data,’ ',10))-1),

giftCreatorGuid = SUBSTRING(data,

length(SUBSTRING_INDEX(data,’ ',12))+2,

length(SUBSTRING_INDEX(data,’ ‘,12+1))-length(SUBSTRING_INDEX(data,’ ',12))-1),

count = SUBSTRING(data,

length(SUBSTRING_INDEX(data,’ ',14))+2,

length(SUBSTRING_INDEX(data,’ ‘,14+1))-length(SUBSTRING_INDEX(data,’ ',14))-1),

duration = SUBSTRING(data,

length(SUBSTRING_INDEX(data,’ ',15))+2,

length(SUBSTRING_INDEX(data,’ ‘,15+1))-length(SUBSTRING_INDEX(data,’ ',15))-1),

charges = CONCAT_WS(’ ',

uint32toint32(SUBSTRING(data,

length(SUBSTRING_INDEX(data,’ ',16))+2,

length(SUBSTRING_INDEX(data,’ ‘,16+1))-length(SUBSTRING_INDEX(data,’ ',16))-1)),

uint32toint32(SUBSTRING(data,

length(SUBSTRING_INDEX(data,’ ',17))+2,

length(SUBSTRING_INDEX(data,’ ‘,17+1))-length(SUBSTRING_INDEX(data,’ ',17))-1)),

uint32toint32(SUBSTRING(data,

length(SUBSTRING_INDEX(data,’ ',18))+2,

length(SUBSTRING_INDEX(data,’ ‘,18+1))-length(SUBSTRING_INDEX(data,’ ',18))-1)),

uint32toint32(SUBSTRING(data,

length(SUBSTRING_INDEX(data,’ ',19))+2,

length(SUBSTRING_INDEX(data,’ ‘,19+1))-length(SUBSTRING_INDEX(data,’ ',19))-1)),

uint32toint32(SUBSTRING(data,

length(SUBSTRING_INDEX(data,’ ',20))+2,

length(SUBSTRING_INDEX(data,’ ‘,20+1))-length(SUBSTRING_INDEX(data,’ ',20))-1))),

flags = SUBSTRING(data,

length(SUBSTRING_INDEX(data,’ ',21))+2,

length(SUBSTRING_INDEX(data,’ ‘,21+1))-length(SUBSTRING_INDEX(data,’ ',21))-1),

enchantments = SUBSTRING(data,

length(SUBSTRING_INDEX(data,’ ',22))+2,

length(SUBSTRING_INDEX(data,’ ‘,57+1))-length(SUBSTRING_INDEX(data,’ ',22))-1),

randomPropertyId = uint32toint32(SUBSTRING(data,

length(SUBSTRING_INDEX(data,’ ',59))+2,

length(SUBSTRING_INDEX(data,’ ‘,59+1))-length(SUBSTRING_INDEX(data,’ ',59))-1)),

durability = SUBSTRING(data,

length(SUBSTRING_INDEX(data,’ ',60))+2,

length(SUBSTRING_INDEX(data,’ ‘,60+1))-length(SUBSTRING_INDEX(data,’ ',60))-1),

playedTime = SUBSTRING(data,

length(SUBSTRING_INDEX(data,’ ',62))+2,

length(SUBSTRING_INDEX(data,’ ‘,62+1))-length(SUBSTRING_INDEX(data,’ ',62))-1);

– Drop function

DROP FUNCTION IF EXISTS uint32toint32;

– Fix heroic item flag

UPDATE item_instance SET flags=flags&~0x8 WHERE

SUBSTRING(data,

length(SUBSTRING_INDEX(data,’ ',3))+2,

length(SUBSTRING_INDEX(data,’ ‘,3+1))-length(SUBSTRING_INDEX(data,’ ',3))-1)

NOT IN (5043,5044,17302,17305,17308,21831);

– Drop old field

ALTER TABLE item_instance DROP data;

/* Execute 09160_characters_item_instance.sql */

SET @allowedFlags := 0x00000001 | 0x00000008 | 0x00000200 | 0x00001000 | 0x00008000 | 0x00010000;

UPDATE item_instance SET flags = (flags & @allowedFlags);

[/SPOILER]
I was used this query’s four weeks ago. As you can see it will wipe all talents and some other things

part2

USE trinity_characters;

– CHARACTERS TRANSFER QUERIES

INSERT INTO account_data SELECT * FROM characters.account_data;

– addons – TC specific table, will be filled by TC

INSERT INTO arena_team SELECT * FROM characters.arena_team;

INSERT INTO arena_team_member (arenateamid, guid, played_week, wons_week, played_season, wons_season) SELECT arenateamid, guid, played_week, wons_week, played_season, wons_season FROM characters.arena_team_member;

INSERT INTO arena_team_stats SELECT * FROM characters.arena_team_stats;

INSERT INTO auctionhouse SELECT * FROM characters.auction;

– bugreport – skip

– channels – skip

INSERT INTO character_account_data SELECT * FROM characters.character_account_data;

INSERT INTO character_achievement SELECT * FROM characters.character_achievement;

INSERT INTO character_achievement_progress SELECT * FROM characters.character_achievement_progress;

INSERT INTO character_action SELECT * FROM characters.character_action;

INSERT INTO character_arena_stats (guid, slot, personal_rating) SELECT guid, (select type from arena_team where arenateamid), personal_rating FROM characters.arena_team_member;

– character_aura – this table is filled with buffs and similar spells, it can be dropped

– character_banned – better to skip it coz mangos doesn’t have this feature

INSERT INTO character_battleground_data SELECT * FROM characters.character_battleground_data;

– INSERT INTO character_battleground_random SELECT * FROM characters.character_battleground_random; – if you used RandomBG mod for you Mangos

INSERT INTO character_declinedname SELECT * FROM characters.character_declinedname;

INSERT INTO character_equipmentsets SELECT * FROM characters.character_equipmentsets;

INSERT INTO character_gifts SELECT * FROM characters.character_gifts;

– glyphs – you should use additional SQL file

INSERT INTO character_homebind SELECT * FROM characters.character_homebind;

INSERT INTO character_instance SELECT * FROM characters.character_instance;

INSERT INTO character_inventory SELECT * FROM characters.character_inventory;

INSERT INTO character_pet SELECT * FROM characters.character_pet;

INSERT INTO character_pet_declinedname SELECT * FROM characters.character_pet_declinedname;

INSERT INTO character_queststatus SELECT * FROM characters.character_queststatus;

INSERT INTO character_queststatus_daily (guid,quest) SELECT * FROM characters.character_queststatus_daily; – ?

INSERT INTO character_queststatus_weekly SELECT * FROM characters.character_queststatus_weekly;

INSERT INTO character_reputation SELECT * FROM characters.character_reputation;

INSERT INTO character_skills SELECT * FROM characters.character_skills;

INSERT INTO character_social SELECT * FROM characters.character_social;

INSERT INTO character_spell SELECT * FROM characters.character_spell;

– character_spell_cooldown – skip

INSERT INTO character_stats SELECT * FROM characters.character_stats;

– character_talent – talents will be reseted, sry

– character_tutorial – skip coz of structure difference

– characters – will be done at final phase

– corpse – skip

INSERT INTO creature_respawn SELECT * FROM characters.creature_respawn;

– game_event_condition_save – skip coz mangos doesn’t have this feature

– game_event_save – skip coz mangos doesn’t have this feature

INSERT INTO gameobject_respawn SELECT * FROM characters.gameobject_respawn;

– gm_subsurveys – skip coz mangos doesn’t have this feature

– gm_surveys – skip coz mangos doesn’t have this feature

– gm_tickets – skip coz of structure difference

– group_instance – skip

– group_member – skip coz of structure difference

– group_member – skip

– groups – skip

INSERT INTO guild SELECT * FROM characters.guild;

INSERT INTO guild_bank_eventlog SELECT * FROM characters.guild_bank_eventlog;

INSERT INTO guild_bank_item SELECT * FROM characters.guild_bank_item;

INSERT INTO guild_bank_right SELECT * FROM characters.guild_bank_right;

INSERT INTO guild_bank_tab SELECT * FROM characters.guild_bank_tab;

INSERT INTO guild_eventlog SELECT * FROM characters.guild_eventlog;

INSERT INTO guild_member SELECT * FROM characters.guild_member;

INSERT INTO guild_rank SELECT * FROM characters.guild_rank;

INSERT INTO instance SELECT * FROM characters.instance;

INSERT INTO instance_reset SELECT * FROM characters.instance_reset;

– item_instance – will be done at final phase

– item_refund_instance – skip coz of structure difference

– item_soulbound_trade_data – skip coz mangos doesn’t have this feature

– lag_reports – skip coz mangos doesn’t have this feature

INSERT INTO mail SELECT * FROM characters.mail;

INSERT INTO mail_items SELECT * FROM characters.mail_items;

– pet_aura – skip

INSERT INTO pet_spell SELECT * FROM characters.pet_spell;

– pet_spell_cooldown – skip

INSERT INTO petition SELECT * FROM characters.petition;

INSERT INTO petition_sign SELECT * FROM characters.petition_sign;

– pool_quest_save – skip coz mangos doesn’t have this feature

INSERT INTO reserved_name SELECT * FROM mangos.reserved_name;

UPDATE worldstates set value=(SELECT NextArenaPointDistributionTime from characters.saved_variables) where entry=20001;

UPDATE worldstates set value=(SELECT NextWeeklyQuestResetTime from characters.saved_variables) where entry=20002;

– UPDATE worldstates set value=(SELECT NextRandomBGResetTime from characters.saved_variables) where entry=20003; – if you used RandomBG mod for you Mangos

INSERT INTO characters (guid, account, name, race, class, gender, level, xp, money, playerBytes, playerBytes2, playerFlags, position_x, position_y, position_z, map, orientation, taximask, online, cinematic, totaltime, leveltime, logout_time, is_logout_resting, rest_bonus, resettalents_cost, resettalents_time, trans_x, trans_y, trans_z, trans_o, transguid, extra_flags, stable_slots, at_login, zone, death_expire_time, taxi_path, arenaPoints, totalHonorPoints, todayHonorPoints, yesterdayHonorPoints, totalKills, todayKills, yesterdayKills, chosenTitle, knownCurrencies, watchedFaction, drunk, health, power1, power2, power3, power4, power5, power6, power7, specCount, activeSpec, exploredZones, equipmentCache, ammoId, knownTitles, actionBars) SELECT guid, account, name, race, class, gender, level, xp, money, playerBytes, playerBytes2, playerFlags, position_x, position_y, position_z, map, orientation, taximask, online, cinematic, totaltime, leveltime, logout_time, is_logout_resting, rest_bonus, resettalents_cost, resettalents_time, trans_x, trans_y, trans_z, trans_o, transguid, extra_flags, stable_slots, at_login, zone, death_expire_time, taxi_path, arenaPoints, totalHonorPoints, todayHonorPoints, yesterdayHonorPoints, totalKills, todayKills, yesterdayKills, chosenTitle, knownCurrencies, watchedFaction, drunk, health, power1, power2, power3, power4, power5, power6, power7, specCount, activeSpec, exploredZones, equipmentCache, ammoId, knownTitles, actionBars FROM characters.characters;

[/SPOILER]
part3

[SPOILER]USE trinity_characters;

INSERT INTO character_glyphs (guid, spec) SELECT DISTINCT guid, spec FROM test_chars.character_glyphs;

UPDATE character_glyphs a SET glyph1 = (SELECT glyph FROM test_chars.character_glyphs WHERE guid = a.guid AND spec = a.spec AND slot = ‘0’);

UPDATE character_glyphs a SET glyph2 = (SELECT glyph FROM test_chars.character_glyphs WHERE guid = a.guid AND spec = a.spec AND slot = ‘1’);

UPDATE character_glyphs a SET glyph3 = (SELECT glyph FROM test_chars.character_glyphs WHERE guid = a.guid AND spec = a.spec AND slot = ‘2’);

UPDATE character_glyphs a SET glyph4 = (SELECT glyph FROM test_chars.character_glyphs WHERE guid = a.guid AND spec = a.spec AND slot = ‘3’);

UPDATE character_glyphs a SET glyph5 = (SELECT glyph FROM test_chars.character_glyphs WHERE guid = a.guid AND spec = a.spec AND slot = ‘4’);

UPDATE character_glyphs a SET glyph6 = (SELECT glyph FROM test_chars.character_glyphs WHERE guid = a.guid AND spec = a.spec AND slot = ‘5’);

[/SPOILER]
part4

[SPOILER]USE trinity_characters;

/* DROP Trinity table and use Mangos one */

DROP TABLE IF EXISTS item_instance;

CREATE TABLE item_instance (

guid int(11) unsigned NOT NULL default ‘0’,

owner_guid int(11) unsigned NOT NULL default ‘0’,

data longtext,

text longtext,

PRIMARY KEY (guid),

KEY idx_owner_guid (owner_guid)

) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT=‘Item System’;

/* Copy Mangos data */

INSERT INTO item_instance SELECT * FROM characters.item_instance;

/* Execute 07893_characters_item_instance.sql */

UPDATE item_instance SET data = REPLACE(data,’ ‘,’ ');

UPDATE item_instance SET data = CONCAT(TRIM(data),’ ');

UPDATE item_instance SET data = CONCAT(

SUBSTRING_INDEX(data, ’ ', 59 + 1), ’ ',

SUBSTRING_INDEX(data, ’ ', -3 -1), '0 ')

WHERE length(SUBSTRING_INDEX(data, ’ ', 64)) < length(data) and length(SUBSTRING_INDEX(data, ’ ', 64+1)) >= length(data);

UPDATE item_instance SET data = REPLACE(data,’ ‘,’ ');

UPDATE item_instance SET data = CONCAT(TRIM(data),’ ');

/* Don’t Execute 07904_characters_item_instance.sql coz mangos already has this field */

/* Execute 09090_characters_item_instance.sql */

– Add new fields

ALTER TABLE item_instance

ADD creatorGuid int(10) unsigned NOT NULL default ‘0’ AFTER owner_guid,

ADD giftCreatorGuid int(10) unsigned NOT NULL default ‘0’ AFTER creatorGuid,

ADD count int(10) unsigned NOT NULL default ‘1’ AFTER giftCreatorGuid,

ADD duration int(10) unsigned NOT NULL AFTER count,

ADD charges text NOT NULL AFTER duration,

ADD flags int(10) unsigned NOT NULL default ‘0’ AFTER charges,

ADD enchantments text NOT NULL AFTER flags,

ADD randomPropertyId int(11) NOT NULL default ‘0’ AFTER enchantments,

ADD durability int(10) unsigned NOT NULL default ‘0’ AFTER randomPropertyId,

ADD playedTime int(10) unsigned NOT NULL default ‘0’ AFTER durability;

– Temporarily change delimiter to prevent SQL syntax errors

DELIMITER ||

– Function to convert ints from unsigned to signed

DROP FUNCTION IF EXISTS uint32toint32||

CREATE FUNCTION uint32toint32(input INT(10) UNSIGNED) RETURNS INT(11) SIGNED DETERMINISTIC

BEGIN

RETURN input;

END||

– Restore original delimiter

DELIMITER ;

– Move data to new fields

UPDATE item_instance SET

creatorGuid = SUBSTRING(data,

length(SUBSTRING_INDEX(data,’ ',10))+2,

length(SUBSTRING_INDEX(data,’ ‘,10+1))-length(SUBSTRING_INDEX(data,’ ',10))-1),

giftCreatorGuid = SUBSTRING(data,

length(SUBSTRING_INDEX(data,’ ',12))+2,

length(SUBSTRING_INDEX(data,’ ‘,12+1))-length(SUBSTRING_INDEX(data,’ ',12))-1),

count = SUBSTRING(data,

length(SUBSTRING_INDEX(data,’ ',14))+2,

length(SUBSTRING_INDEX(data,’ ‘,14+1))-length(SUBSTRING_INDEX(data,’ ',14))-1),

duration = SUBSTRING(data,

length(SUBSTRING_INDEX(data,’ ',15))+2,

length(SUBSTRING_INDEX(data,’ ‘,15+1))-length(SUBSTRING_INDEX(data,’ ',15))-1),

charges = CONCAT_WS(’ ',

uint32toint32(SUBSTRING(data,

length(SUBSTRING_INDEX(data,’ ',16))+2,

length(SUBSTRING_INDEX(data,’ ‘,16+1))-length(SUBSTRING_INDEX(data,’ ',16))-1)),

uint32toint32(SUBSTRING(data,

length(SUBSTRING_INDEX(data,’ ',17))+2,

length(SUBSTRING_INDEX(data,’ ‘,17+1))-length(SUBSTRING_INDEX(data,’ ',17))-1)),

uint32toint32(SUBSTRING(data,

length(SUBSTRING_INDEX(data,’ ',18))+2,

length(SUBSTRING_INDEX(data,’ ‘,18+1))-length(SUBSTRING_INDEX(data,’ ',18))-1)),

uint32toint32(SUBSTRING(data,

length(SUBSTRING_INDEX(data,’ ',19))+2,

length(SUBSTRING_INDEX(data,’ ‘,19+1))-length(SUBSTRING_INDEX(data,’ ',19))-1)),

uint32toint32(SUBSTRING(data,

length(SUBSTRING_INDEX(data,’ ',20))+2,

length(SUBSTRING_INDEX(data,’ ‘,20+1))-length(SUBSTRING_INDEX(data,’ ',20))-1))),

flags = SUBSTRING(data,

length(SUBSTRING_INDEX(data,’ ',21))+2,

length(SUBSTRING_INDEX(data,’ ‘,21+1))-length(SUBSTRING_INDEX(data,’ ',21))-1),

enchantments = SUBSTRING(data,

length(SUBSTRING_INDEX(data,’ ',22))+2,

length(SUBSTRING_INDEX(data,’ ‘,57+1))-length(SUBSTRING_INDEX(data,’ ',22))-1),

randomPropertyId = uint32toint32(SUBSTRING(data,

length(SUBSTRING_INDEX(data,’ ',59))+2,

length(SUBSTRING_INDEX(data,’ ‘,59+1))-length(SUBSTRING_INDEX(data,’ ',59))-1)),

durability = SUBSTRING(data,

length(SUBSTRING_INDEX(data,’ ',60))+2,

length(SUBSTRING_INDEX(data,’ ‘,60+1))-length(SUBSTRING_INDEX(data,’ ',60))-1),

playedTime = SUBSTRING(data,

length(SUBSTRING_INDEX(data,’ ',62))+2,

length(SUBSTRING_INDEX(data,’ ‘,62+1))-length(SUBSTRING_INDEX(data,’ ',62))-1);

– Drop function

DROP FUNCTION IF EXISTS uint32toint32;

– Fix heroic item flag

UPDATE item_instance SET flags=flags&~0x8 WHERE

SUBSTRING(data,

length(SUBSTRING_INDEX(data,’ ',3))+2,

length(SUBSTRING_INDEX(data,’ ‘,3+1))-length(SUBSTRING_INDEX(data,’ ',3))-1)

NOT IN (5043,5044,17302,17305,17308,21831);

– Drop old field

ALTER TABLE item_instance DROP data;

/* Execute 09160_characters_item_instance.sql */

SET @allowedFlags := 0x00000001 | 0x00000008 | 0x00000200 | 0x00001000 | 0x00008000 | 0x00010000;

UPDATE item_instance SET flags = (flags & @allowedFlags);

[/SPOILER]
I was used this query’s four weeks ago. As you can see it will wipe all talents and some other things

It works all right for the 1st SQL.

I changed some things in the 2nd and 3rd SQL to make it compatible.

But there is a big worries with the 4th SQL for coping item_instance table, it crashs the server when I launch it and I don’t even know what to do to fix it so I think this one is not compatible at all… Does anybody knows what to do with this ?

Anyway thank you very much Tobmaps for your help I was searching for this weeks ago.

Did you try to execute 4th SQL with offline server? This is too heavy query and can make your MySQL server to gone away, you should set right settings in your MySQL config to prevent this.

If you mean a server crash at startup (after converting completion) - can you post a dumps and logs here? Better to post dump from server compiled with debug info.

This (4th) SQL is just copy-paste mangos character_inventory table and execute all standard trinity updates :S I just wondering how it can’t work

My MySQL server is offline but I don’t think it’s because of this.

I mean by server crash that when I open my World.exe it automatically closes itself and there is not any log lines, just look :

2010-12-29 17:58:51 Using configuration file worldserver.conf.2010-12-29 17:58:52 TrinityCore Rev: 10868 Release Hash: 2279a6653bea (Win32, little-endian) (core-daemon)

2010-12-29 17:58:52 to stop.

2010-12-29 17:58:52 ______ __

2010-12-29 17:58:52 /__ _\ __ _/\ _

2010-12-29 17:58:52 //\ / _ __ /_\ ___ /_\ \ ,\ __ __

2010-12-29 17:58:52 \ \ /`‘__/\ \ /’ _ `/\ \ \ / /\ /\ \

2010-12-29 17:58:52 \ \ \ \ / \ \ /\ /\ \ \ \ \ _\ \ _\ \

2010-12-29 17:58:52 \ _\ _\ \ _\ _\ _\ _\ _\/`___ \

2010-12-29 17:58:52 //// ////////// `/_/> \

2010-12-29 17:58:52 C O R E /___/

2010-12-29 17:58:52 http://TrinityCore.org /__/

And I don’t get any Crash directory…

This SQL is not only a copy of characters_inventory but also of item_instance wich is the most complicated table to copy (just look the difference between these tables in Mangos and in Trinity…) so it uses a very complicated codes (for me anyway /emoticons/default_tongue.png )

yes, i meant item_instance /emoticons/default_smile.png it’s just a typo that i can’t edit now in my prev post :confused:

and it doesn’t crashes when you not execute this queries?

EDIT:

good, edit function is enabled now (:

if server even can’t load first table then i think it can’t be related to item_instance query. It must be a problem with core or damaged/outdated tables, with outdated i mean you just forgot to install updates above revision range that i posted before

From what revision must I update my characters table ?

Ok i’m just stupid I didn’t read this xD All works fine now

The accurate revision is 10475

I really thank you for your help /emoticons/default_biggrin.png

See you.

Hi , i’ve tried this transfer, got some small errors, but when i try to login , it stays at conected, and world server crashes without any error. dont sent…

help pls?

Any newer scripts working on the newest revidion ?

part2

USE trinity_characters;

– CHARACTERS TRANSFER QUERIES

INSERT INTO account_data SELECT * FROM characters.account_data;

– addons – TC specific table, will be filled by TC

INSERT INTO arena_team SELECT * FROM characters.arena_team;

INSERT INTO arena_team_member (arenateamid, guid, played_week, wons_week, played_season, wons_season) SELECT arenateamid, guid, played_week, wons_week, played_season, wons_season FROM characters.arena_team_member;

INSERT INTO arena_team_stats SELECT * FROM characters.arena_team_stats;

INSERT INTO auctionhouse SELECT * FROM characters.auction;

– bugreport – skip

– channels – skip

INSERT INTO character_account_data SELECT * FROM characters.character_account_data;

INSERT INTO character_achievement SELECT * FROM characters.character_achievement;

INSERT INTO character_achievement_progress SELECT * FROM characters.character_achievement_progress;

INSERT INTO character_action SELECT * FROM characters.character_action;

INSERT INTO character_arena_stats (guid, slot, personal_rating) SELECT guid, (select type from arena_team where arenateamid), personal_rating FROM characters.arena_team_member;

– character_aura – this table is filled with buffs and similar spells, it can be dropped

– character_banned – better to skip it coz mangos doesn’t have this feature

INSERT INTO character_battleground_data SELECT * FROM characters.character_battleground_data;

– INSERT INTO character_battleground_random SELECT * FROM characters.character_battleground_random; – if you used RandomBG mod for you Mangos

INSERT INTO character_declinedname SELECT * FROM characters.character_declinedname;

INSERT INTO character_equipmentsets SELECT * FROM characters.character_equipmentsets;

INSERT INTO character_gifts SELECT * FROM characters.character_gifts;

– glyphs – you should use additional SQL file

INSERT INTO character_homebind SELECT * FROM characters.character_homebind;

INSERT INTO character_instance SELECT * FROM characters.character_instance;

INSERT INTO character_inventory SELECT * FROM characters.character_inventory;

INSERT INTO character_pet SELECT * FROM characters.character_pet;

INSERT INTO character_pet_declinedname SELECT * FROM characters.character_pet_declinedname;

INSERT INTO character_queststatus SELECT * FROM characters.character_queststatus;

INSERT INTO character_queststatus_daily (guid,quest) SELECT * FROM characters.character_queststatus_daily; – ?

INSERT INTO character_queststatus_weekly SELECT * FROM characters.character_queststatus_weekly;

INSERT INTO character_reputation SELECT * FROM characters.character_reputation;

INSERT INTO character_skills SELECT * FROM characters.character_skills;

INSERT INTO character_social SELECT * FROM characters.character_social;

INSERT INTO character_spell SELECT * FROM characters.character_spell;

– character_spell_cooldown – skip

INSERT INTO character_stats SELECT * FROM characters.character_stats;

– character_talent – talents will be reseted, sry

– character_tutorial – skip coz of structure difference

– characters – will be done at final phase

– corpse – skip

INSERT INTO creature_respawn SELECT * FROM characters.creature_respawn;

– game_event_condition_save – skip coz mangos doesn’t have this feature

– game_event_save – skip coz mangos doesn’t have this feature

INSERT INTO gameobject_respawn SELECT * FROM characters.gameobject_respawn;

– gm_subsurveys – skip coz mangos doesn’t have this feature

– gm_surveys – skip coz mangos doesn’t have this feature

– gm_tickets – skip coz of structure difference

– group_instance – skip

– group_member – skip coz of structure difference

– group_member – skip

– groups – skip

INSERT INTO guild SELECT * FROM characters.guild;

INSERT INTO guild_bank_eventlog SELECT * FROM characters.guild_bank_eventlog;

INSERT INTO guild_bank_item SELECT * FROM characters.guild_bank_item;

INSERT INTO guild_bank_right SELECT * FROM characters.guild_bank_right;

INSERT INTO guild_bank_tab SELECT * FROM characters.guild_bank_tab;

INSERT INTO guild_eventlog SELECT * FROM characters.guild_eventlog;

INSERT INTO guild_member SELECT * FROM characters.guild_member;

INSERT INTO guild_rank SELECT * FROM characters.guild_rank;

INSERT INTO instance SELECT * FROM characters.instance;

INSERT INTO instance_reset SELECT * FROM characters.instance_reset;

– item_instance – will be done at final phase

– item_refund_instance – skip coz of structure difference

– item_soulbound_trade_data – skip coz mangos doesn’t have this feature

– lag_reports – skip coz mangos doesn’t have this feature

INSERT INTO mail SELECT * FROM characters.mail;

INSERT INTO mail_items SELECT * FROM characters.mail_items;

– pet_aura – skip

INSERT INTO pet_spell SELECT * FROM characters.pet_spell;

– pet_spell_cooldown – skip

INSERT INTO petition SELECT * FROM characters.petition;

INSERT INTO petition_sign SELECT * FROM characters.petition_sign;

– pool_quest_save – skip coz mangos doesn’t have this feature

INSERT INTO reserved_name SELECT * FROM mangos.reserved_name;

UPDATE worldstates set value=(SELECT NextArenaPointDistributionTime from characters.saved_variables) where entry=20001;

UPDATE worldstates set value=(SELECT NextWeeklyQuestResetTime from characters.saved_variables) where entry=20002;

– UPDATE worldstates set value=(SELECT NextRandomBGResetTime from characters.saved_variables) where entry=20003; – if you used RandomBG mod for you Mangos

INSERT INTO characters (guid, account, name, race, class, gender, level, xp, money, playerBytes, playerBytes2, playerFlags, position_x, position_y, position_z, map, orientation, taximask, online, cinematic, totaltime, leveltime, logout_time, is_logout_resting, rest_bonus, resettalents_cost, resettalents_time, trans_x, trans_y, trans_z, trans_o, transguid, extra_flags, stable_slots, at_login, zone, death_expire_time, taxi_path, arenaPoints, totalHonorPoints, todayHonorPoints, yesterdayHonorPoints, totalKills, todayKills, yesterdayKills, chosenTitle, knownCurrencies, watchedFaction, drunk, health, power1, power2, power3, power4, power5, power6, power7, specCount, activeSpec, exploredZones, equipmentCache, ammoId, knownTitles, actionBars) SELECT guid, account, name, race, class, gender, level, xp, money, playerBytes, playerBytes2, playerFlags, position_x, position_y, position_z, map, orientation, taximask, online, cinematic, totaltime, leveltime, logout_time, is_logout_resting, rest_bonus, resettalents_cost, resettalents_time, trans_x, trans_y, trans_z, trans_o, transguid, extra_flags, stable_slots, at_login, zone, death_expire_time, taxi_path, arenaPoints, totalHonorPoints, todayHonorPoints, yesterdayHonorPoints, totalKills, todayKills, yesterdayKills, chosenTitle, knownCurrencies, watchedFaction, drunk, health, power1, power2, power3, power4, power5, power6, power7, specCount, activeSpec, exploredZones, equipmentCache, ammoId, knownTitles, actionBars FROM characters.characters;

[/SPOILER]
part3

[SPOILER]USE trinity_characters;

INSERT INTO character_glyphs (guid, spec) SELECT DISTINCT guid, spec FROM test_chars.character_glyphs;

UPDATE character_glyphs a SET glyph1 = (SELECT glyph FROM test_chars.character_glyphs WHERE guid = a.guid AND spec = a.spec AND slot = ‘0’);

UPDATE character_glyphs a SET glyph2 = (SELECT glyph FROM test_chars.character_glyphs WHERE guid = a.guid AND spec = a.spec AND slot = ‘1’);

UPDATE character_glyphs a SET glyph3 = (SELECT glyph FROM test_chars.character_glyphs WHERE guid = a.guid AND spec = a.spec AND slot = ‘2’);

UPDATE character_glyphs a SET glyph4 = (SELECT glyph FROM test_chars.character_glyphs WHERE guid = a.guid AND spec = a.spec AND slot = ‘3’);

UPDATE character_glyphs a SET glyph5 = (SELECT glyph FROM test_chars.character_glyphs WHERE guid = a.guid AND spec = a.spec AND slot = ‘4’);

UPDATE character_glyphs a SET glyph6 = (SELECT glyph FROM test_chars.character_glyphs WHERE guid = a.guid AND spec = a.spec AND slot = ‘5’);

[/SPOILER]
part4

[SPOILER]USE trinity_characters;

/* DROP Trinity table and use Mangos one */

DROP TABLE IF EXISTS item_instance;

CREATE TABLE item_instance (

guid int(11) unsigned NOT NULL default ‘0’,

owner_guid int(11) unsigned NOT NULL default ‘0’,

data longtext,

text longtext,

PRIMARY KEY (guid),

KEY idx_owner_guid (owner_guid)

) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT=‘Item System’;

/* Copy Mangos data */

INSERT INTO item_instance SELECT * FROM characters.item_instance;

/* Execute 07893_characters_item_instance.sql */

UPDATE item_instance SET data = REPLACE(data,’ ‘,’ ');

UPDATE item_instance SET data = CONCAT(TRIM(data),’ ');

UPDATE item_instance SET data = CONCAT(

SUBSTRING_INDEX(data, ’ ', 59 + 1), ’ ',

SUBSTRING_INDEX(data, ’ ', -3 -1), '0 ')

WHERE length(SUBSTRING_INDEX(data, ’ ', 64)) < length(data) and length(SUBSTRING_INDEX(data, ’ ', 64+1)) >= length(data);

UPDATE item_instance SET data = REPLACE(data,’ ‘,’ ');

UPDATE item_instance SET data = CONCAT(TRIM(data),’ ');

/* Don’t Execute 07904_characters_item_instance.sql coz mangos already has this field */

/* Execute 09090_characters_item_instance.sql */

– Add new fields

ALTER TABLE item_instance

ADD creatorGuid int(10) unsigned NOT NULL default ‘0’ AFTER owner_guid,

ADD giftCreatorGuid int(10) unsigned NOT NULL default ‘0’ AFTER creatorGuid,

ADD count int(10) unsigned NOT NULL default ‘1’ AFTER giftCreatorGuid,

ADD duration int(10) unsigned NOT NULL AFTER count,

ADD charges text NOT NULL AFTER duration,

ADD flags int(10) unsigned NOT NULL default ‘0’ AFTER charges,

ADD enchantments text NOT NULL AFTER flags,

ADD randomPropertyId int(11) NOT NULL default ‘0’ AFTER enchantments,

ADD durability int(10) unsigned NOT NULL default ‘0’ AFTER randomPropertyId,

ADD playedTime int(10) unsigned NOT NULL default ‘0’ AFTER durability;

– Temporarily change delimiter to prevent SQL syntax errors

DELIMITER ||

– Function to convert ints from unsigned to signed

DROP FUNCTION IF EXISTS uint32toint32||

CREATE FUNCTION uint32toint32(input INT(10) UNSIGNED) RETURNS INT(11) SIGNED DETERMINISTIC

BEGIN

RETURN input;

END||

– Restore original delimiter

DELIMITER ;

– Move data to new fields

UPDATE item_instance SET

creatorGuid = SUBSTRING(data,

length(SUBSTRING_INDEX(data,’ ',10))+2,

length(SUBSTRING_INDEX(data,’ ‘,10+1))-length(SUBSTRING_INDEX(data,’ ',10))-1),

giftCreatorGuid = SUBSTRING(data,

length(SUBSTRING_INDEX(data,’ ',12))+2,

length(SUBSTRING_INDEX(data,’ ‘,12+1))-length(SUBSTRING_INDEX(data,’ ',12))-1),

count = SUBSTRING(data,

length(SUBSTRING_INDEX(data,’ ',14))+2,

length(SUBSTRING_INDEX(data,’ ‘,14+1))-length(SUBSTRING_INDEX(data,’ ',14))-1),

duration = SUBSTRING(data,

length(SUBSTRING_INDEX(data,’ ',15))+2,

length(SUBSTRING_INDEX(data,’ ‘,15+1))-length(SUBSTRING_INDEX(data,’ ',15))-1),

charges = CONCAT_WS(’ ',

uint32toint32(SUBSTRING(data,

length(SUBSTRING_INDEX(data,’ ',16))+2,

length(SUBSTRING_INDEX(data,’ ‘,16+1))-length(SUBSTRING_INDEX(data,’ ',16))-1)),

uint32toint32(SUBSTRING(data,

length(SUBSTRING_INDEX(data,’ ',17))+2,

length(SUBSTRING_INDEX(data,’ ‘,17+1))-length(SUBSTRING_INDEX(data,’ ',17))-1)),

uint32toint32(SUBSTRING(data,

length(SUBSTRING_INDEX(data,’ ',18))+2,

length(SUBSTRING_INDEX(data,’ ‘,18+1))-length(SUBSTRING_INDEX(data,’ ',18))-1)),

uint32toint32(SUBSTRING(data,

length(SUBSTRING_INDEX(data,’ ',19))+2,

length(SUBSTRING_INDEX(data,’ ‘,19+1))-length(SUBSTRING_INDEX(data,’ ',19))-1)),

uint32toint32(SUBSTRING(data,

length(SUBSTRING_INDEX(data,’ ',20))+2,

length(SUBSTRING_INDEX(data,’ ‘,20+1))-length(SUBSTRING_INDEX(data,’ ',20))-1))),

flags = SUBSTRING(data,

length(SUBSTRING_INDEX(data,’ ',21))+2,

length(SUBSTRING_INDEX(data,’ ‘,21+1))-length(SUBSTRING_INDEX(data,’ ',21))-1),

enchantments = SUBSTRING(data,

length(SUBSTRING_INDEX(data,’ ',22))+2,

length(SUBSTRING_INDEX(data,’ ‘,57+1))-length(SUBSTRING_INDEX(data,’ ',22))-1),

randomPropertyId = uint32toint32(SUBSTRING(data,

length(SUBSTRING_INDEX(data,’ ',59))+2,

length(SUBSTRING_INDEX(data,’ ‘,59+1))-length(SUBSTRING_INDEX(data,’ ',59))-1)),

durability = SUBSTRING(data,

length(SUBSTRING_INDEX(data,’ ',60))+2,

length(SUBSTRING_INDEX(data,’ ‘,60+1))-length(SUBSTRING_INDEX(data,’ ',60))-1),

playedTime = SUBSTRING(data,

length(SUBSTRING_INDEX(data,’ ',62))+2,

length(SUBSTRING_INDEX(data,’ ‘,62+1))-length(SUBSTRING_INDEX(data,’ ',62))-1);

– Drop function

DROP FUNCTION IF EXISTS uint32toint32;

– Fix heroic item flag

UPDATE item_instance SET flags=flags&~0x8 WHERE

SUBSTRING(data,

length(SUBSTRING_INDEX(data,’ ',3))+2,

length(SUBSTRING_INDEX(data,’ ‘,3+1))-length(SUBSTRING_INDEX(data,’ ',3))-1)

NOT IN (5043,5044,17302,17305,17308,21831);

– Drop old field

ALTER TABLE item_instance DROP data;

/* Execute 09160_characters_item_instance.sql */

SET @allowedFlags := 0x00000001 | 0x00000008 | 0x00000200 | 0x00001000 | 0x00008000 | 0x00010000;

UPDATE item_instance SET flags = (flags & @allowedFlags);

[/SPOILER]
I was used this query’s four weeks ago. As you can see it will wipe all talents and some other things

Sry im new here ,

can anybody explain how to execute this ?

Or is any tutorial about this around ?

Ty for helping

I’d also like to know if there is any up to date query for the latest trinity core? /emoticons/default_smile.png

Hey, I’m planning on move my server from Mangos to trinity shortly, I would like to know if someone has an updated version of this converter, I would love to have it, there is no problem to make it compatible with Mangos, but as I don’t know the structure of trinity’s DB I don’t know what should I change.

Thanks to the person that could help me with this.

Regards.

So any have the update to this? Or maybe the database structure that works with these querys? so I could apply updates from that point to now after applying these querys