Jump to content
TrinityCore

How to switch properly from manual updates to automatic updates ?


Magnuss
 Share

Recommended Posts

For years I have updated my 3.3.5 databases by hand with a small script. Was always working without any problem.

But now I wanted to change to automatic updates by the core. (I do that for WoD from the beginning, it's quite comfortable)

The problem: The core makes or tries to apply old updates I have already done long time ago. Of course this behaviour either destroys my data or gives errors. My last core compliation and DB update was on Feb 09, 2016.

1. I started the auth server. Here's a snipped of the log:

2016-03-04_18:11:35 DEBUG Checking update "2014_11_10_00_auth.sql"...
2016-03-04_18:11:35 DEBUG >> Update is already applied and is matching hash '0E3CB11'.
...... more similar lines

2016-03-04_18:11:35 DEBUG Checking update "2015_03_20_00_auth.sql"...
2016-03-04_18:11:35 INFO  >> Re-hashing update "2015_03_20_00_auth.sql" 'E8C5B74'...
...... more similar lines

2016-03-04_18:11:35 DEBUG Checking update "2015_08_21_00_auth.sql"...
2016-03-04_18:11:35 INFO  >> Applying update "2015_08_21_00_auth.sql" 'C31A9E1'...
2016-03-04_18:11:35 ERROR Warning: Using a password on the command line interface can be insecure.
.....
2016-03-04_18:11:35 INFO  >> Applying update "2015_11_07_00_auth.sql" '0ACDD35'...
.....
2016-03-04_18:11:35 INFO  >> Applying update "2016_01_13_00_auth.sql" '24615CC'...

However I know for sure that I have made these updates already. Here's the log of my own script:
09.02.2016 11:14:56.75 Start importing files
09.02.2016 11:14:56.76 Importing: 2015_11_07_00_auth.sql
09.02.2016 11:14:56.76 Importing: 2016_01_13_00_auth.sql
09.02.2016 11:14:57.06 End importing files

What do I need to do or what I'm doing wrong ?

Edit:
Of course when I start the world server the updating process fails from the beginning because it tries to update 2015_06_26_00_characters_335.sql which I have done long time ago.

 

Link to comment
Share on other sites

You need to add applied updates to the `updates` table of your databases to tell the DBUpdater that the update was applied already.

You can leave the hash empty (the core will insert it for you) and set the state to `RELEASED` (the core will correct it as well).

 

Link to comment
Share on other sites

Thanks, is there a recommended way how to do that ? Or just by hand ?  (Quite a lot of files to add)

One possible way would be to install a complete empty DB and let the core add the filenames into the 'updates' table. After that I can export this table to an existing DB.

Link to comment
Share on other sites

On Windows I use something like that:

@echo off
SET updatefile=updatefiles.txt

echo -- %date% %time% Start reading files > %updatefile%
echo.

for %%C in (.\*.sql) do (
    echo INSERT INTO `updates` (name^) VALUES ('%%~nxC'^); >> %updatefile%
)

echo Done !
pause

  • Upvote 1
Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...