-
Active Member
(AzerothCore) Powershell scripts for character and guild export/import
GitHub - AldebaraanMKII/WoW-character-and-guild-export-import-scripts: Powershell scripts to export/import world of warcraft characters and guilds
This currently only works on AzerothCore.
You may ask yourself: Why not just use the .pdump command?
The .pdump command works most of the time. But it has several disavantages:
1. You need to know the name of all the characters you want to transfer. With the script you only need to know the account name.
2. No info is displayed for these characters. If you want to know more details about them, you need to log in into the account to see them for yourself.
3. You need to run the account/world server. With this, you only need to run the database.
4. The .pdump command doesn`t transfer guilds (let alone any items in its bank).
5. The .pdump command doesn`t transfer transmog and reagent bank module data.
Instructions
1. Install Powershell 7 (this was tested with 7.4.5)
2. Extract the scripts folder somewhere
3. Open each script with notepad++ and check/update the following:
Code:
$serverName = "127.0.0.1"
$port = 3306
$username = "root"
$password = "test"
$username and $password is your MySQL server user and password.
you may need to alter $serverName and $port if you`re not running the server locally.
4. If you`re using the export scripts, you also need to check the following settings:
Code:
$mysqldumpPath = "H:\My Repack\mysql\bin\mysqldump.exe"
$mysqlPath = "H:\My Repack\mysql\bin\mysql.exe"
those executables are typically included in a repack`s mysql/bin folder. If you don`t have them, install MySQL server.
5. If you`re exporting characters/guilds, open the MySQL database that contain those characters/guilds.
6. If you`re importing characters/guilds, open the MySQL database that you want to transfer them to.
7. Go into the folder you extracted the scripts to, right click > PowerShell 7 > Open Here
8. type the name of the script like this: ./"Backup character data.ps1"
9. Follow the instructions in the console.
Current issues:
Mysql.data library errors:
Sometimes it will complain about CLS compliance and the script will fail. When that happens, press CTRL + C to terminate the script (without closing the terminal), open the script in question with notepad++ and comment the following lines:
Code:
try {
Add-Type -Path "./MySql.Data.dll" 2>$null
} catch {
}
so that it becomes like this:
Code:
#try {
# Add-Type -Path "./MySql.Data.dll" 2>$null
#} catch {
#
#}
then try running the script again (in the same terminal from before).
I don`t know why does this happen nor how to fix it permanently. Any feedback on this issue would be appreciated.
IMPORTANT: Make sure only the mysql database is open when you export/import your characters or guild! Trying to export/import while the auth/world server is running can lead to issues, like several items missing from the character inventory or duplicate entries in the database!.
Last edited by Aldebaraan; 10-01-2024 at 08:11 PM.
-
Post Thanks / Like - 1 Thanks
-
Member
What am I doing wrong? This is my old repack (Zaicopx)
Backup character data.ps1:
# Paths to executables
$mysqldumpPath = "D:\Games\AzerothCore Single Player Repack\mysql\bin\mysqldump.exe" # path to mysqldump executable
$mysqlPath = "D:\Games\AzerothCore Single Player Repack\mysql\bin\mysql.exe" # path to mysql executable
MySQL Server is running, login and pass is correct (unchanged)
$serverName = "127.0.0.1"
$port = 3306
$username = "root"
$password = "ascent"
script.png
-
Active Member
Originally Posted by
uber-cheater3000
What am I doing wrong? This is my old repack (Zaicopx)
Backup character data.ps1:
# Paths to executables
$mysqldumpPath = "D:\Games\AzerothCore Single Player Repack\mysql\bin\mysqldump.exe" # path to mysqldump executable
$mysqlPath = "D:\Games\AzerothCore Single Player Repack\mysql\bin\mysql.exe" # path to mysql executable
MySQL Server is running, login and pass is correct (unchanged)
$serverName = "127.0.0.1"
$port = 3306
$username = "root"
$password = "ascent"
script.png
It's a issue with mysql.data. Follow the instructions in the opening post regarding issues (comment out the lines mentioned) and try running the script again without closing the console.
-
Member
The script from your archive (Backup character data.ps1) already has commented lines. This error was exactly with these parameters
Code:
#try {
# Add-Type -Path "./MySql.Data.dll" 2>$null
#} catch {
#
#}
Now I uncommented these lines and tried to run the script. It seems to work. But now I encountered another error:
anotherone.png
But I managed to export my guild using another script (Backup guild data.ps1).
-
Active Member
Originally Posted by
uber-cheater3000
The script from your archive (Backup character data.ps1) already has commented lines. This error was exactly with these parameters
Code:
#try {
# Add-Type -Path "./MySql.Data.dll" 2>$null
#} catch {
#
#}
Now I uncommented these lines and tried to run the script. It seems to work. But now I encountered another error:
anotherone.png
But I managed to export my guild using another script (Backup guild data.ps1).
With the console open comment the lines again, save the script, and try to run it again. If that doesn't work update your net framework.
-
Member
Well, this was tricky but it works. Now the last step left...
I get an error when importing a character into your repack (I didn't forget about the commented lines and #Paths to executables)
Code:
PS D:\Games\Azerothcore WoTLK Repack (Playerbots)\WoW-character-and-guild-export-import-scripts-main> ./"Restore character data.ps1"
Please select a character by typing the corresponding number:
1. (gamer) Shooterguy - Troll Hunter Male LV2
2. (gamer) Vredina - Orc Warlock Female LV60
3. All characters in list
4. Exit
Enter your choice (1-4): 2
You selected: (gamer) Vredina - Orc Warlock Female LV60
Enter account name to transfer the character(s).: horell
Error: The field or property: "Datetime" for type: "MySql.Data.MySqlClient.MySqlDbType" differs only in letter casing from the field or property: "DateTime". The type must be Common Language Specification (CLS) compliant.
Please select a character by typing the corresponding number:
1. (gamer) Shooterguy - Troll Hunter Male LV2
2. (gamer) Vredina - Orc Warlock Female LV60
3. All characters in list
4. Exit
Enter your choice (1-4):
PS D:\Games\Azerothcore WoTLK Repack (Playerbots)\WoW-character-and-guild-export-import-scripts-main> ./"Restore character data.ps1"
Please select a character by typing the corresponding number:
1. (gamer) Shooterguy - Troll Hunter Male LV2
2. (gamer) Vredina - Orc Warlock Female LV60
3. All characters in list
4. Exit
Enter your choice (1-4): 2
You selected: (gamer) Vredina - Orc Warlock Female LV60
Enter account name to transfer the character(s).: horell
ID for username 'horell': 203
Restoring character 'Vredina'
(characters) An error occurred: Exception calling "ExecuteNonQuery" with "0" argument(s): "Column count doesn't match value count at row 1"
Importing character data...
(character_account_data) An error occurred: Exception calling "ExecuteNonQuery" with "0" argument(s): "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 'VERSION 5\n\nADDEDVERSION 13\n\nOPTION_GUILD_RECRUITMENT_CHANNEL AUTO\n\nCHANNEL' at line 1"
(character_achievement_progress) An error occurred: Exception calling "ExecuteNonQuery" with "0" argument(s): "Duplicate entry '2005-40' for key 'character_achievement_progress.PRIMARY'"
(character_action) An error occurred: Exception calling "ExecuteNonQuery" with "0" argument(s): "Duplicate entry '2005-0-0' for key 'character_action.PRIMARY'"
(character_aura) An error occurred: Exception calling "ExecuteNonQuery" with "0" argument(s): "Duplicate entry '2005-5-0-11735-3' for key 'character_aura.PRIMARY'"
(character_glyphs) An error occurred: Exception calling "ExecuteNonQuery" with "0" argument(s): "Duplicate entry '2005-0' for key 'character_glyphs.PRIMARY'"
(character_queststatus) An error occurred: Exception calling "ExecuteNonQuery" with "0" argument(s): "Duplicate entry '2005-4003' for key 'character_queststatus.PRIMARY'"
(character_queststatus_rewarded) An error occurred: Exception calling "ExecuteNonQuery" with "0" argument(s): "Duplicate entry '2005-25' for key 'character_queststatus_rewarded.PRIMARY'"
(character_reputation) An error occurred: Exception calling "ExecuteNonQuery" with "0" argument(s): "Duplicate entry '2005-21' for key 'character_reputation.PRIMARY'"
(character_skills) An error occurred: Exception calling "ExecuteNonQuery" with "0" argument(s): "Duplicate entry '2005-43' for key 'character_skills.PRIMARY'"
(character_spell) An error occurred: Exception calling "ExecuteNonQuery" with "0" argument(s): "Duplicate entry '2005-126' for key 'character_spell.PRIMARY'"
(character_talent) An error occurred: Exception calling "ExecuteNonQuery" with "0" argument(s): "Duplicate entry '2005-17785' for key 'character_talent.PRIMARY'"
(character_homebind) An error occurred: Exception calling "ExecuteNonQuery" with "0" argument(s): "Duplicate entry '2005' for key 'character_homebind.PRIMARY'"
Importing pet data...
Importing character items...
(character_inventory) An error occurred: Exception calling "ExecuteNonQuery" with "0" argument(s): "Duplicate entry '2005-0-0' for key 'character_inventory.guid'"
Import done in 1.4537746 seconds. Returning to menu...
Please select a character by typing the corresponding number:
1. (gamer) Shooterguy - Troll Hunter Male LV2
2. (gamer) Vredina - Orc Warlock Female LV60
3. All characters in list
4. Exit
Enter your choice (1-4):
-
Active Member
Originally Posted by
uber-cheater3000
Well, this was tricky but it works. Now the last step left...
I get an error when importing a character into your repack (I didn't forget about the commented lines and
#Paths to executables)
Code:
PS D:\Games\Azerothcore WoTLK Repack (Playerbots)\WoW-character-and-guild-export-import-scripts-main> ./"Restore character data.ps1"
Please select a character by typing the corresponding number:
1. (gamer) Shooterguy - Troll Hunter Male LV2
2. (gamer) Vredina - Orc Warlock Female LV60
3. All characters in list
4. Exit
Enter your choice (1-4): 2
You selected: (gamer) Vredina - Orc Warlock Female LV60
Enter account name to transfer the character(s).: horell
Error: The field or property: "Datetime" for type: "MySql.Data.MySqlClient.MySqlDbType" differs only in letter casing from the field or property: "DateTime". The type must be Common Language Specification (CLS) compliant.
Please select a character by typing the corresponding number:
1. (gamer) Shooterguy - Troll Hunter Male LV2
2. (gamer) Vredina - Orc Warlock Female LV60
3. All characters in list
4. Exit
Enter your choice (1-4):
PS D:\Games\Azerothcore WoTLK Repack (Playerbots)\WoW-character-and-guild-export-import-scripts-main> ./"Restore character data.ps1"
Please select a character by typing the corresponding number:
1. (gamer) Shooterguy - Troll Hunter Male LV2
2. (gamer) Vredina - Orc Warlock Female LV60
3. All characters in list
4. Exit
Enter your choice (1-4): 2
You selected: (gamer) Vredina - Orc Warlock Female LV60
Enter account name to transfer the character(s).: horell
ID for username 'horell': 203
Restoring character 'Vredina'
(characters) An error occurred: Exception calling "ExecuteNonQuery" with "0" argument(s): "Column count doesn't match value count at row 1"
Importing character data...
(character_account_data) An error occurred: Exception calling "ExecuteNonQuery" with "0" argument(s): "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 'VERSION 5\n\nADDEDVERSION 13\n\nOPTION_GUILD_RECRUITMENT_CHANNEL AUTO\n\nCHANNEL' at line 1"
(character_achievement_progress) An error occurred: Exception calling "ExecuteNonQuery" with "0" argument(s): "Duplicate entry '2005-40' for key 'character_achievement_progress.PRIMARY'"
(character_action) An error occurred: Exception calling "ExecuteNonQuery" with "0" argument(s): "Duplicate entry '2005-0-0' for key 'character_action.PRIMARY'"
(character_aura) An error occurred: Exception calling "ExecuteNonQuery" with "0" argument(s): "Duplicate entry '2005-5-0-11735-3' for key 'character_aura.PRIMARY'"
(character_glyphs) An error occurred: Exception calling "ExecuteNonQuery" with "0" argument(s): "Duplicate entry '2005-0' for key 'character_glyphs.PRIMARY'"
(character_queststatus) An error occurred: Exception calling "ExecuteNonQuery" with "0" argument(s): "Duplicate entry '2005-4003' for key 'character_queststatus.PRIMARY'"
(character_queststatus_rewarded) An error occurred: Exception calling "ExecuteNonQuery" with "0" argument(s): "Duplicate entry '2005-25' for key 'character_queststatus_rewarded.PRIMARY'"
(character_reputation) An error occurred: Exception calling "ExecuteNonQuery" with "0" argument(s): "Duplicate entry '2005-21' for key 'character_reputation.PRIMARY'"
(character_skills) An error occurred: Exception calling "ExecuteNonQuery" with "0" argument(s): "Duplicate entry '2005-43' for key 'character_skills.PRIMARY'"
(character_spell) An error occurred: Exception calling "ExecuteNonQuery" with "0" argument(s): "Duplicate entry '2005-126' for key 'character_spell.PRIMARY'"
(character_talent) An error occurred: Exception calling "ExecuteNonQuery" with "0" argument(s): "Duplicate entry '2005-17785' for key 'character_talent.PRIMARY'"
(character_homebind) An error occurred: Exception calling "ExecuteNonQuery" with "0" argument(s): "Duplicate entry '2005' for key 'character_homebind.PRIMARY'"
Importing pet data...
Importing character items...
(character_inventory) An error occurred: Exception calling "ExecuteNonQuery" with "0" argument(s): "Duplicate entry '2005-0-0' for key 'character_inventory.guid'"
Import done in 1.4537746 seconds. Returning to menu...
Please select a character by typing the corresponding number:
1. (gamer) Shooterguy - Troll Hunter Male LV2
2. (gamer) Vredina - Orc Warlock Female LV60
3. All characters in list
4. Exit
Enter your choice (1-4):
Can you please send me the character sql files zipped?
-
Member
Sure
Vredina - Orc Warlock Female LV60.zip
Maybe it's because that repack was really old? I played it in like ‘22 or so
-
Active Member
Originally Posted by
uber-cheater3000
It seems to be so. I encountered a similar issue related to hearthstone data when using zaicopx repack with the latest patch from 2023. But this has issues with other stuff. I will download the old repack from 2022 to test. In the meantime you can use the .pdump command to transfer your character.
-
Post Thanks / Like - 1 Thanks
-
Member
Unfortunately the .pdump command doesn't work either. The character cannot be imported into the new server
Code:
.pdump load MyProgress horell Vredina
LoadPlayerDump: (line 819) unknown column name `posO` for table `character_homebind`, aborting due to incompatible DB structure.
Dump file have broken data!
Anyway, thanks for trying to help
-
Member
I think I've done it. I created a new character, exported it. Then copied his coordinates from:
Code:
INSERT INTO `character_homebind` (`guid`, `mapId`, `zoneId`, `posX`, `posY`, `posZ`) VALUES
and overwrites it to my character.
But that's not all. Then I got the error ‘duplicate `character_pet`’
Apparently, this is because of the BeastMaster NPC module.
Then I deleted the line (since I was hiring a hunter's pet)
Code:
INSERT INTO `character_pet` .........
This worked, the character was able to be imported, but my Felhunter still has some abilities from the Hunter pet. I have to delete them somehow now.
Other than that, everything seems to be fine.
-
Active Member
Originally Posted by
uber-cheater3000
Unfortunately the .pdump command doesn't work either. The character cannot be imported into the new server
Code:
.pdump load MyProgress horell Vredina
LoadPlayerDump: (line 819) unknown column name `posO` for table `character_homebind`, aborting due to incompatible DB structure.
Dump file have broken data!
Anyway, thanks for trying to help
Homebind from old zaicopx has a extra column that was removed in current azerothcore.