Сделал вменяемую систему сабжа при установке апдейтов... Вопщем так:
backup.bat - просто делает backup базы, создает файл типа "backup_18.11.2005-01`41`41.sql"
full_install.bat - полная установка, файл типа "install_18.11.2005-01`37`18.sql"
Конечно надо привести в порядок и сделань аналог для линукса еще...
@echo off
REM MYSQL 4.0
rem set mysqlBinPath=C:mysqlbin
REM MYSQL 4.1
rem set mysqlBinPath=C:Program FilesMySQLMySQL Server 4.1bin
REM MYSQL 5.0
set mysqlBinPath=C:Program FilesMySQLMySQL Server 5.0bin
set user=root
set pass=
set DBname=l2jdb
set DBHost=localhost
set mysqldumpPath="%mysqlBinPath%mysqldump"
set mysqlPath="%mysqlBinPath%mysql"
set ctime=%TIME:~0,2%
if "%ctime:~0,1%" == " " (
set ctime=0%ctime:~1,1%
)
set ctime=-%ctime%`%TIME:~3,2%`%TIME:~6,2%
echo.
echo Making a full backup.
%mysqldumpPath% --add-drop-table -h %DBHost% -u %user% --password=%pass% %DBname% > backup/backup_%DATE%%ctime%.sql
echo Done.
pause
@echo off
REM ############################################
REM ## You can change here your own DB params ##
REM ############################################
REM MYSQL 4.0
rem set mysqlBinPath=C:mysqlbin
REM MYSQL 4.1
rem set mysqlBinPath=C:Program FilesMySQLMySQL Server 4.1bin
REM MYSQL 5.0
set mysqlBinPath=C:Program FilesMySQLMySQL Server 5.0bin
set user=root
set pass=
set DBname=l2jdb
set DBHost=localhost
REM ############################################
set mysqldumpPath="%mysqlBinPath%mysqldump"
set mysqlPath="%mysqlBinPath%mysql"
set ctime=%TIME:~0,2%
if "%ctime:~0,1%" == " " (
set ctime=0%ctime:~1,1%
)
set ctime=-%ctime%`%TIME:~3,2%`%TIME:~6,2%
echo.
echo Making a backup of the original database.
%mysqldumpPath% --add-drop-table -h %DBHost% -u %user% --password=%pass% %DBname% > backup/install_%DATE%%ctime%.sql
echo.
echo Deleting tables for new content.
%mysqlPath% -h %DBHost% -u %user% --password=%pass% -D %DBname% < ../sql/full_install.sql
echo.
echo Installling full_install content.
%mysqlPath% -h %DBHost% -u %user% --password=%pass% -D %DBname% < ../sql/common/accounts.sql
%mysqlPath% -h %DBHost% -u %user% --password=%pass% -D %DBname% < ../sql/common/character_friends.sql
%mysqlPath% -h %DBHost% -u %user% --password=%pass% -D %DBname% < ../sql/common/character_hennas.sql
%mysqlPath% -h %DBHost% -u %user% --password=%pass% -D %DBname% < ../sql/common/character_macroses.sql
%mysqlPath% -h %DBHost% -u %user% --password=%pass% -D %DBname% < ../sql/common/character_quests.sql
%mysqlPath% -h %DBHost% -u %user% --password=%pass% -D %DBname% < ../sql/common/character_recipebook.sql
%mysqlPath% -h %DBHost% -u %user% --password=%pass% -D %DBname% < ../sql/common/character_shortcuts.sql
%mysqlPath% -h %DBHost% -u %user% --password=%pass% -D %DBname% < ../sql/common/character_skills.sql
%mysqlPath% -h %DBHost% -u %user% --password=%pass% -D %DBname% < ../sql/common/character_skills_save.sql
%mysqlPath% -h %DBHost% -u %user% --password=%pass% -D %DBname% < ../sql/common/characters.sql
%mysqlPath% -h %DBHost% -u %user% --password=%pass% -D %DBname% < ../sql/common/clan_data.sql
%mysqlPath% -h %DBHost% -u %user% --password=%pass% -D %DBname% < ../sql/common/clan_wars.sql
%mysqlPath% -h %DBHost% -u %user% --password=%pass% -D %DBname% < ../sql/common/items.sql
%mysqlPath% -h %DBHost% -u %user% --password=%pass% -D %DBname% < ../sql/common/pets.sql
%mysqlPath% -h %DBHost% -u %user% --password=%pass% -D %DBname% < ../sql/common/seven_signs.sql
%mysqlPath% -h %DBHost% -u %user% --password=%pass% -D %DBname% < ../sql/common/seven_signs_festival.sql
%mysqlPath% -h %DBHost% -u %user% --password=%pass% -D %DBname% < ../sql/common/siege_clans.sql
call upgrade.bat
pause
@echo off
REM MYSQL 4.0
rem set mysqlBinPath=C:mysqlbin
REM MYSQL 4.1
rem set mysqlBinPath=C:Program FilesMySQLMySQL Server 4.1bin
REM MYSQL 5.0
set mysqlBinPath=C:Program FilesMySQLMySQL Server 5.0bin
set user=root
set pass=
set DBname=l2jdb
set DBHost=localhost
set mysqldumpPath="%mysqlBinPath%mysqldump"
set mysqlPath="%mysqlBinPath%mysql"
set ctime=%TIME:~0,2%
if "%ctime:~0,1%" == " " (
set ctime=0%ctime:~1,1%
)
set ctime=-%ctime%`%TIME:~3,2%`%TIME:~6,2%
echo.
echo Making a backup of the original database.
%mysqldumpPath% --add-drop-table -h %DBHost% -u %user% --password=%pass% %DBname% > backup/upgrade_%DATE%%ctime%.sql
echo.
echo Deleting table for new content.
%mysqlPath% -h %DBHost% -u %user% --password=%pass% -D %DBname% < ../sql/upgrade.sql
echo.
echo Installing new content.
%mysqlPath% -h %DBHost% -u %user% --password=%pass% -D %DBname% < ../sql/common/armor.sql
%mysqlPath% -h %DBHost% -u %user% --password=%pass% -D %DBname% < ../sql/common/boxaccess.sql
%mysqlPath% -h %DBHost% -u %user% --password=%pass% -D %DBname% < ../sql/common/boxes.sql
%mysqlPath% -h %DBHost% -u %user% --password=%pass% -D %DBname% < ../sql/common/castle.sql
%mysqlPath% -h %DBHost% -u %user% --password=%pass% -D %DBname% < ../sql/common/castle_door.sql
%mysqlPath% -h %DBHost% -u %user% --password=%pass% -D %DBname% < ../sql/common/castle_doorupgrade.sql
%mysqlPath% -h %DBHost% -u %user% --password=%pass% -D %DBname% < ../sql/common/castle_guards.sql
%mysqlPath% -h %DBHost% -u %user% --password=%pass% -D %DBname% < ../sql/common/castle_guards_skills.sql
%mysqlPath% -h %DBHost% -u %user% --password=%pass% -D %DBname% < ../sql/common/castle_siege_guards.sql
%mysqlPath% -h %DBHost% -u %user% --password=%pass% -D %DBname% < ../sql/common/char_templates.sql
%mysqlPath% -h %DBHost% -u %user% --password=%pass% -D %DBname% < ../sql/common/character_variables.sql
%mysqlPath% -h %DBHost% -u %user% --password=%pass% -D %DBname% < ../sql/common/class_list.sql
%mysqlPath% -h %DBHost% -u %user% --password=%pass% -D %DBname% < ../sql/fortress/droplist.sql
%mysqlPath% -h %DBHost% -u %user% --password=%pass% -D %DBname% < ../sql/common/etcitem.sql
%mysqlPath% -h %DBHost% -u %user% --password=%pass% -D %DBname% < ../sql/common/henna.sql
%mysqlPath% -h %DBHost% -u %user% --password=%pass% -D %DBname% < ../sql/common/henna_trees.sql
%mysqlPath% -h %DBHost% -u %user% --password=%pass% -D %DBname% < ../sql/fortress/locations.sql
%mysqlPath% -h %DBHost% -u %user% --password=%pass% -D %DBname% < ../sql/common/lvlupgain.sql
%mysqlPath% -h %DBHost% -u %user% --password=%pass% -D %DBname% < ../sql/common/mapregion.sql
%mysqlPath% -h %DBHost% -u %user% --password=%pass% -D %DBname% < ../sql/common/merchant_areas_list.sql
%mysqlPath% -h %DBHost% -u %user% --password=%pass% -D %DBname% < ../sql/common/merchant_buylists.sql
%mysqlPath% -h %DBHost% -u %user% --password=%pass% -D %DBname% < ../sql/common/merchant_lease.sql
%mysqlPath% -h %DBHost% -u %user% --password=%pass% -D %DBname% < ../sql/common/merchant_shopids.sql
%mysqlPath% -h %DBHost% -u %user% --password=%pass% -D %DBname% < ../sql/common/merchants.sql
%mysqlPath% -h %DBHost% -u %user% --password=%pass% -D %DBname% < ../sql/common/minions.sql
%mysqlPath% -h %DBHost% -u %user% --password=%pass% -D %DBname% < ../sql/fortress/npc.sql
%mysqlPath% -h %DBHost% -u %user% --password=%pass% -D %DBname% < ../sql/fortress/npcskills.sql
%mysqlPath% -h %DBHost% -u %user% --password=%pass% -D %DBname% < ../sql/common/server_variables.sql
%mysqlPath% -h %DBHost% -u %user% --password=%pass% -D %DBname% < ../sql/common/skill_learn.sql
%mysqlPath% -h %DBHost% -u %user% --password=%pass% -D %DBname% < ../sql/common/skill_spellbooks.sql
%mysqlPath% -h %DBHost% -u %user% --password=%pass% -D %DBname% < ../sql/common/skill_trees.sql
%mysqlPath% -h %DBHost% -u %user% --password=%pass% -D %DBname% < ../sql/fortress/spawnlist.sql
%mysqlPath% -h %DBHost% -u %user% --password=%pass% -D %DBname% < ../sql/common/teleport.sql
%mysqlPath% -h %DBHost% -u %user% --password=%pass% -D %DBname% < ../sql/common/weapon.sql
%mysqlPath% -h %DBHost% -u %user% --password=%pass% -D %DBname% < ../sql/common/zone.sql
echo.
echo Installing fixes.
%mysqlPath% -h %DBHost% -u %user% --password=%pass% -D %DBname% < ../sql/fixes/c3.sql
%mysqlPath% -h %DBHost% -u %user% --password=%pass% -D %DBname% < ../sql/fixes/drop.sql
%mysqlPath% -h %DBHost% -u %user% --password=%pass% -D %DBname% < ../sql/fixes/exp_sp.sql
%mysqlPath% -h %DBHost% -u %user% --password=%pass% -D %DBname% < ../sql/fixes/FixDrop.sql
%mysqlPath% -h %DBHost% -u %user% --password=%pass% -D %DBname% < ../sql/fixes/FixNPC.sql
%mysqlPath% -h %DBHost% -u %user% --password=%pass% -D %DBname% < ../sql/fixes/FixPirTun.sql
%mysqlPath% -h %DBHost% -u %user% --password=%pass% -D %DBname% < ../sql/fixes/l2wh.sql
%mysqlPath% -h %DBHost% -u %user% --password=%pass% -D %DBname% < ../sql/fixes/prices.sql
%mysqlPath% -h %DBHost% -u %user% --password=%pass% -D %DBname% < ../sql/fixes/respawn.sql
echo.
echo Fixes installed.
echo.
pause