Code Monkey home page Code Monkey logo

tool-tc-migration's Introduction

tool-tc-migration

[EXPERIMENTAL]

Some tools to migrate the characters and auth database from TrinityCore to AzerothCore.

IMPORTANT: backup your database before using this tool.

We cannot guarantee that the operation succeeds without side effects.

Instructions

In order to take benefit of the scripts we highly recomand to use Unix systems to execute the following script (Linux / Mac / Linux subsystem on windows etc)

Secure your server data

In order to avoid damaging your production server it's highly recomanded to save your data locally, and work on your data locally.

Using migration script on unix systems

Create an env file like following:

env.sh

# TrinityCore Characters DBs separated by colon symbol (:)
export CHARACTERS_DBS="characters:characters_test"

# TrinityCore Auth DB
export AUTH_DB=auth

# DB user / password
export DB_USER=trinity
export DB_PASS=trinity

# Hostname
export DB_HOSTNAME=arthas
export DB_PORT=3306

# Location of your dump files (sql) for characters DBs separated by colon symbol (:) you should use absolute path
export DUMP_CHARACTERS_FILES_PATH="/home/johndoe/dumps/characters_mysql_22_10_29_00_30.sql:/home/johndoe/dumps/characters_test_mysql_22_10_29_00_30.sql"

# Location of your dump file for auth DB
export DUMP_AUTH_FILE_PATH=~/dumps/auth_mysql_22_10_29_00_30.sql

Use it as source and execute the migration:

source env.sh
./migration.sh -a

You have several option for the migration:

  • -a: restore and migrate
  • -r: restore only
  • -m: migrate only

Restore on windows

On Windows the restore have to be done manually after that, you have to execute the migration scripts on each DB manually.

File 1_xxx.sql to 5_xxx.sql needs to be executed in numeral order on characters DBs. 6.xxx and 7.xxx have to be executed on auth DB.

Check data integrity

To check the data integrity I highly recomand to create an AzerothCore server with his own dbs:

Ex in my case:

  • characters: DB for TrinityCore characters data to migrate
  • auth: DB for TrinityCore auth data to migrate
  • acore_characters: Clean AzerothCore characters table
  • acore_auth: Clean AzerothCore auth table

The following queries will help you to compare the DBs of a same kind:

Check what is missing in your migrated auth db

-- AUTH => columns and table IN AzerothCore and missing in TrinityCore
SELECT col_az.TABLE_NAME, col_az.COLUMN_NAME, col_tc.TABLE_NAME, col_tc.COLUMN_NAME
FROM information_schema.columns col_az
LEFT JOIN information_schema.columns col_tc on col_az.TABLE_NAME = col_tc.TABLE_NAME and col_az.COLUMN_NAME = col_tc.COLUMN_NAME
WHERE col_az.table_schema = 'acore_auth'
AND col_az.table_name = 'auth' AND col_tc.COLUMN_NAME is null;

If this query returns results it means that some table or columns are missing in your auth table. You can use git log -S [my table name] to find when this table have been created / modified.

Check what you should remove in your migrated auth db

-- AUTH => columns and table IN TrinityCore not in AzerothCore
select col_tc.TABLE_NAME, col_tc.COLUMN_NAME FROM information_schema.columns col_tc
LEFT JOIN information_schema.columns col_az on
    col_az.TABLE_NAME = col_tc.TABLE_NAME and
    col_az.COLUMN_NAME = col_tc.COLUMN_NAME and
    col_az.TABLE_SCHEMA = 'acore_auth'
WHERE col_tc.TABLE_SCHEMA = 'auth' and col_az.COLUMN_NAME is null;

The columns / table returned in this query have to be removed in your migrated db.

Check what is missing in your migrated characters db

-- AUTH => columns and table IN AzerothCore and missing in TrinityCore
SELECT col_az.TABLE_NAME, col_az.COLUMN_NAME, col_tc.TABLE_NAME, col_tc.COLUMN_NAME
FROM information_schema.columns col_az
LEFT JOIN information_schema.columns col_tc on col_az.TABLE_NAME = col_tc.TABLE_NAME and col_az.COLUMN_NAME = col_tc.COLUMN_NAME
WHERE col_az.table_schema = 'acore_characters'
AND col_az.table_name = 'characters' AND col_tc.COLUMN_NAME is null;

Check what you should remove in your migrated characters db

-- AUTH => columns and table IN TrinityCore not in AzerothCore
select col_tc.TABLE_NAME, col_tc.COLUMN_NAME FROM information_schema.columns col_tc
LEFT JOIN information_schema.columns col_az on
    col_az.TABLE_NAME = col_tc.TABLE_NAME and
    col_az.COLUMN_NAME = col_tc.COLUMN_NAME and
    col_az.TABLE_SCHEMA = 'acore_characters'
WHERE col_tc.TABLE_SCHEMA = 'characters' and col_az.COLUMN_NAME is null;

The columns / table returned in this query have to be removed in your migrated db. The current script dosn't remove migration tables those which starts with __

I hope that everything goes well, good fortune my friend.

OLD Instructions

http://www.azerothcore.org/wiki/TrinityCore-to-AzerothCore-characters-migration

tool-tc-migration's People

Contributors

fr4z3n avatar francescoborzi avatar helias avatar milestorme avatar miorey avatar yehonal avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

tool-tc-migration's Issues

Not working for TDB 63

Seems like this needs an update.

I just tested this on a TDB 63 Character DB and AzerothCore cant start up.

Btw... just a question, taking into account the way AzerothCore handles spells and character bytes (hair, face etc) wouldn't be better to just sync that kind of stuff with TC DB Structure?

At the end most of the people using this core will be people coming from TC, so making the DB Structure alike would be awesome.

ERROR 1064 in 4_CLEANUP_AND_CONVERT_SPELLS.sql

4_CLEANUP_AND_CONVERT_SPELLS.sql

ERROR 1064 (42000) at line 62: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') WHERE cnt>2) x2) ON s.guid = x2.guid AND s.skill = x2.skill' at line 1

I apologize, my MySQL knowledge starts and ends at "google the error" so I don't really have anything constructive to add.
I got this error when running 4_CLEANUP_AND_CONVERT_SPELLS.sql against azerothcore_characters DB, that DB contains a recent dump of my trinitycore characters DB.

I have a separate MySQL server from the AzerothCore and TrinityCore Servers, not sure if that is relevant. Let me know if I can provide anything more to assist in troubleshooting this error.

Lack of table and wrong name

Hello,

When you upload the tools and you finish the instructions you will get an error when you launch the authserver and worldserver
The solution is :

Rename the 7th column to "Token_key" in tables "account"
and upload ip2nation
Now, you have your AUTH

For the DB Characters, you have to add 3 tables

  1. recovery_item
  2. gameobject_respawn
  3. creature_respawn

Now, you have your Characters DB

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.