• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

(MYACC) Merge 2 databases

Maziajka

Excellent OT User
Joined
Mar 4, 2009
Messages
1,714
Reaction score
619
Location
Hamburg
Hello!

I was wondering what is the best way to merge 2 databases from 2 different servers? Or if that's even possible. So basically all characters/accounts from server A will merge to server B.

If any more information is needed lmk
 
Considering that both databases are identical... the most obvious way would be to export the relevant database tables (data only) such as players, player_items to a schema. Then simply import to the target database.
(Note: If you are using PhpMyAdmin, beware of PHP's default timeout. It would be better to use an IDE such as HeidiSQL)

You will run into several problems such as conflicts of player names, misaligned account ids and more.

Therefore, I would programmatically do this via PHP or Python. I would iterate through each account and insert that first, then also insert each player for that account (whilst updating it with the new account id, resetting temple pos etc)...

The rest I will let you figure out.
 
Last edited:
Hello!

I was wondering what is the best way to merge 2 databases from 2 different servers? Or if that's even possible. So basically all characters/accounts from server A will merge to server B.

If any more information is needed lmk
So we have one main database, and the other one is to be migrated and not used again
Maybe this way if this only applies to accounts without items:
- Check the last AccountID in the main database (example 19000) and then execute the following on the one to be migrated:
SQL:
UPDATE players SET account_id = account_id + 20000;
UPDATE accounts SET id = id + 20000;
UPDATE players SET name = CONCAT(name, ' transferred') WHERE name IS NOT NULL;

Then export and import two files it into your main database (it should react auto increment to add new rows)
Of course make a backup and save before trying this method
 

Similar threads

Back
Top