Francesco Borzi
Francesco Borzi

Reputation: 61994

How to make sure that the DB is up to date

When installing/updating AzerothCore sometimes one encounters errors such as:

[ERROR]: In mysql_stmt_prepare() id: 3, sql:

[ERROR]: Unknown column 'entry' in 'field list'

[ERROR]: Unknown column 'dmg_multiplier' in 'field list'

[ERROR]: Table 'acore_world.graveyard_zone' doesn't exist

[ERROR]: Unknown column 'mindmg' in 'field list'

ERROR: Your database structure is not up to date. Please make sure you've executed all queries in the sql/updates folders.

this usually means the database structure is not up to date.

More specifically, the local DB version is not aligned with the local core version.

This leads to the following questions:

Upvotes: 3

Views: 2636

Answers (1)

Francesco Borzi
Francesco Borzi

Reputation: 61994

UPDATE 2021:

The latest AzerothCore has now the automated DB updater integrated inside the core.

You just need to enable it via worldserver.conf by setting:

Updates.EnableDatabases = 7

Then your worldserver process will automatically update all DBs for you.

You need latest AC to get this feature.


Original answer and explanation:

AzerothCore has three databases: auth, characters and world. All of them need to be properly up to date in order to start the server application.

Each database has a table version_db_xxxx which holds information about the database version inside its last column's name.

  • auth DB has the version_db_auth table
  • characters DB has the version_db_characters table
  • world DB has the version_db_world table

The database version will be expressed in the format of YYYY_MM_DD_XX which is basically a date followed by a number (XX).

This value will be the name of the last column of such tables and it corresponds to the name of the last SQL update file that has been applied to that database.

The SQL update files can be found in the azerothcore-wotlk/data/sql/updates/db_xxxx/ directory (where xxx is the database name):

To make sure the database is up to date, one should compare (per each database):

  • the last column name of the version_db_xxxx table
  • the most recent sql file name contained in data/sql/updates/db_xxxx

(most recent in terms of most recent date. If the date is the same, the file having the highest pending number is the most recent)

If the values are the same, then the DB is up to date. Otherwise, the DB needs to be updated by importing all missing SQL update files in order.

Upvotes: 4

Related Questions