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