I have now completed a script that will allow me to backup my characters, delete the old server, copy the git files from my update folder, rebuild the server, and restore my character backups.
I have this in multiple files, and I will list each file.
Please keep in mind though, there are probably many better ways to do this (And feel free to make suggestions if you know how I can simplify them). You will also need to change everything to fit your environment, so this isn't an easy to use, create and go. Hopefully I will finish
Although I doubt anyone specifically will want this, hopefully it can help people come up with their own modifications to make their server control automated.
Here are my files:
Char_backup.bat (Backs up the appropriate tables from your mySQL database):
Code: Select all
c:
cd C:\Program Files\MySQL\MySQL Server 5.6\bin
mysqldump.exe -e -uroot -proot dspdb auction_house > "D:\PlayOnline\SquareEnix\Char backup\auction_house.sql"
mysqldump.exe -e -uroot -proot dspdb accounts > "D:\PlayOnline\SquareEnix\Char backup\accounts.sql"
mysqldump.exe -e -uroot -proot dspdb accounts_banned > "D:\PlayOnline\SquareEnix\Char backup\accounts_banned.sql"
mysqldump.exe -e -uroot -proot dspdb char_effects > "D:\PlayOnline\SquareEnix\Char backup\char_effects.sql"
mysqldump.exe -e -uroot -proot dspdb char_equip > "D:\PlayOnline\SquareEnix\Char backup\char_equip.sql"
mysqldump.exe -e -uroot -proot dspdb char_exp > "D:\PlayOnline\SquareEnix\Char backup\char_exp.sql"
mysqldump.exe -e -uroot -proot dspdb char_inventory > "D:\PlayOnline\SquareEnix\Char backup\char_inventory.sql"
mysqldump.exe -e -uroot -proot dspdb char_jobs > "D:\PlayOnline\SquareEnix\Char backup\char_jobs.sql"
mysqldump.exe -e -uroot -proot dspdb char_look > "D:\PlayOnline\SquareEnix\Char backup\char_look.sql"
mysqldump.exe -e -uroot -proot dspdb char_pet > "D:\PlayOnline\SquareEnix\Char backup\char_pet.sql"
mysqldump.exe -e -uroot -proot dspdb char_pet_name > "D:\PlayOnline\SquareEnix\Char backup\char_pet_name.sql"
mysqldump.exe -e -uroot -proot dspdb char_points > "D:\PlayOnline\SquareEnix\Char backup\char_points.sql"
mysqldump.exe -e -uroot -proot dspdb char_profile > "D:\PlayOnline\SquareEnix\Char backup\char_profile.sql"
mysqldump.exe -e -uroot -proot dspdb char_skills > "D:\PlayOnline\SquareEnix\Char backup\char_skills.sql"
mysqldump.exe -e -uroot -proot dspdb char_stats > "D:\PlayOnline\SquareEnix\Char backup\char_stats.sql"
mysqldump.exe -e -uroot -proot dspdb char_storage > "D:\PlayOnline\SquareEnix\Char backup\char_storage.sql"
mysqldump.exe -e -uroot -proot dspdb char_vars > "D:\PlayOnline\SquareEnix\Char backup\char_vars.sql"
mysqldump.exe -e -uroot -proot dspdb char_weapon_skill_points > "D:\PlayOnline\SquareEnix\Char backup\char_weapon_skill_points.sql"
mysqldump.exe -e -uroot -proot dspdb chars > "D:\PlayOnline\SquareEnix\Char backup\chars.sql"
mysqldump.exe -e -uroot -proot dspdb conquest_system > "D:\PlayOnline\SquareEnix\Char backup\conquest_system.sql"
mysqldump.exe -e -uroot -proot dspdb delivery_box > "D:\PlayOnline\SquareEnix\Char backup\delivery_box.sql"
mysqldump.exe -e -uroot -proot dspdb linkshells > "D:\PlayOnline\SquareEnix\Char backup\linkshells.sql"
mysqldump.exe -e -uroot -proot dspdb > "D:\PlayOnline\SquareEnix\Char backup\dspdb.sql"
I do recommend using the wiki provided file though, as it works just fine.
Code: Select all
cd c:\darkstar\sql
del auction_house.sql
del chars.sql
del accounts.sql
del accounts_banned.sql
del char_effects.sql
del char_equip.sql
del char_exp.sql
del char_inventory.sql
del char_jobs.sql
del char_look.sql
del char_pet.sql
del char_pet_name.sql
del char_points.sql
del char_profile.sql
del char_skills.sql
del char_stats.sql
del char_storage.sql
del char_vars.sql
del char_weapon_skill_points.sql
del chars.sql
del conquest_system.sql
del delivery_box.sql
del linkshells.sql
FOR %%X IN (*.sql) DO ECHO Importing %%X & "c:\program files\mysql\mysql server 5.6\bin\mysql" dspdb -h localhost -u root -pMYSQLPASS < %%X
Code: Select all
Call D:\PlayOnline\SquareEnix\Char_backup.bat
Call D:\PlayOnline\SquareEnix\Serverbackup.bat
Call D:\PlayOnline\SquareEnix\ServerReplace.bat
Call D:\PlayOnline\SquareEnix\Serverbuild.bat
Call D:\PlayOnline\SquareEnix\DSP_Import.bat
Call D:\PlayOnline\SquareEnix\Char_restore.bat
Code: Select all
@ECHO OFF
REM =============================================================================
REM =============================================================================
REM ====== =========
REM ====== THis script will drop the DB specificed, then create the DB =========
REM ====== specified, and then load all .sql tables from its run dir to =========
REM ====== the the DB. =========
REM ====== =========
REM ====== File needs to be run from within the \dsp\sql folder (same =========
REM ====== folder with all the .sql files. Please edit as needed. By =========
REM ====== default it WILL DROP the standard dspdb DB, loosing all =========
REM ====== accounts and characters. If this is not desired, then update =========
REM ====== the file to load the new DB into a new DB name. =========
REM ====== =========
REM ====== Update -p with MySQL password. If you password is 'foo', =========
REM ====== then change '-pMYSQLPASS' to '-pfoo' (3 places). =========
REM ====== =========
REM ====== If you want to use a different database name, change 'dspdb' =========
REM ====== with a database name of your choosing. =========
REM ====== =========
REM =============================================================================
REM =============================================================================
REM ====== =========
REM ====== by Thrydwolf 9/8/2012 =========
REM ====== Updated with status by bluekirby0 3/30/2012 =========
REM ====== Updated by Thrydwolf 9/18/2012 =========
REM ====== =========
REM =============================================================================
REM =============================================================================
ECHO Creating Database dspdb
mysqladmin -h localhost -u root -proot DROP dspdb
ECHO Creating Database dspdb
mysqladmin -h localhost -u root -proot CREATE dspdb
ECHO Loading dspdb tables into the database
cd D:\PlayOnline\SquareEnix\Final Fantasy XI server\darkstar\sql
FOR %%X IN (*.sql) DO ECHO Importing %%X & "c:\program files\mysql\mysql server 5.6\bin\mysql" dspdb -h localhost -u root -proot < %%X
ECHO Finished!
Code: Select all
del D:\PlayOnline\SquareEnix\FFXIServerBackup.zip
D:
CD D:\PlayOnline\SquareEnix
CScript zip.vbs "D:\PlayOnline\SquareEnix\Final Fantasy XI server" D:\PlayOnline\SquareEnix\FFXIServerBackup.zip
Code: Select all
"C:\Program Files (x86)\MSBuild\12.0\Bin\MSBuild.exe" "D:\PlayOnline\SquareEnix\Final Fantasy XI server\darkstar\win32\DSConnect-server\DSConnect-server.sln" /p:Configuration=Debug
"C:\Program Files (x86)\MSBuild\12.0\Bin\MSBuild.exe" "D:\PlayOnline\SquareEnix\Final Fantasy XI server\darkstar\win32\DSGame-server\DSGame-server.sln" /p:Configuration=Debug
"C:\Program Files (x86)\MSBuild\12.0\Bin\MSBuild.exe" "D:\PlayOnline\SquareEnix\Final Fantasy XI server\darkstar\win32\DSSearch-server\DSSearch-server.sln" /p:Configuration=Debug
Code: Select all
rmdir /s /q "D:\PlayOnline\SquareEnix\Final Fantasy XI server\darkstar"
ROBOCOPY "D:\PlayOnline\SquareEnix\Server Update" "D:\PlayOnline\SquareEnix\Final Fantasy XI server" /s
Code: Select all
'Get command-line arguments.
Set objArgs = WScript.Arguments
InputFolder = objArgs(0)
ZipFile = objArgs(1)
'Create empty ZIP file.
CreateObject("Scripting.FileSystemObject").CreateTextFile(ZipFile, True).Write "PK" & Chr(5) & Chr(6) & String(18, vbNullChar)
Set objShell = CreateObject("Shell.Application")
Set source = objShell.NameSpace(InputFolder).Items
objShell.NameSpace(ZipFile).CopyHere(source)
'Required!
objShell.NameSpace(ZipFile).CopyHere(source)
' Wait for compression window to open
set scriptShell = CreateObject("Wscript.Shell")
Do While scriptShell.AppActivate("Compressing...") = FALSE
WScript.Sleep 500 ' Arbitrary polling delay
Loop
' Wait for compression to complete before exiting script
Do While scriptShell.AppActivate("Compressing...") = TRUE
WScript.Sleep 500 ' Arbitrary polling delay
Loop