EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   General::General Discussion (https://www.eqemulator.org/forums/forumdisplay.php?f=586)
-   -   Automatic Database Upgrade and Versioning (https://www.eqemulator.org/forums/showthread.php?t=39021)

Akkadius 11-16-2014 11:40 PM

Automatic Database Upgrade and Versioning
 
Just wanted to shoot out a quick update for this, had a code session grind last night and earlier today to finish this out. We've been needing this for quite a while. Thanks Demonstar55 for helping me test the Linux side of the updates.

What this solves:
  • It will automatically go through and look at each update historically and compare it against your database, if your database is missing the update, it will continue and build a list of updates and apply them in a very quick fashion
  • As people update their source, they no longer need to worry about upgrading their database as the process has become streamlined and completely automatic

How it Works:
  • When World boots up, it will start this check process by pulling down scripts from Github if you don't have them, this process happens transparent to the user
  • The script will load a manifest that we use to intelligently drive the script to know which updates need to be ran, I have the manifest cleanly working for old databases all the way back through our Github SQL updates about 2 years back. I have yet to go through SVN, but when I do it will work the same for people.

With this I was able to take a super old server database, and get it upgraded within minutes and boot it up. So it will be great to have for regular updates and folks who haven't upgraded in quite a while.

To run it manually, there is a db_update.pl in the server directory that you can run, to trigger other utilities such as the db_dumper.pl (Backup script) for pre-backup measures.

In the future:
  • We can do things like pull down latest opcodes from Github
  • Pull down latest PEQ AA Tables
  • Pull down latest PEQ Mercenary tables
  • Anything else that makes sense

Below is an example of what it would look like:

Code:

        - On world bootup or standalone run of db_update.pl, users will be prompted with a simple menu that we will expand upon later:
       
                ============================================================
                          EQEmu: Automatic Database Upgrade Check
                ============================================================
                                Operating System is: MSWin32
                                (Windows) MySQL is in system path
                                Path = C:\Program Files\MariaDB 10.0\bin/mysql
                ============================================================
                                Binary Database Version: (9057)
                                Local Database Version: (9057)

                                Database up to Date: Continuing World Bootup...
                ============================================================
                Retrieving latest database manifest...
        URL:    https://raw.githubusercontent.com/EQ...e_manifest.txt
        Saved:  db_update/db_update_manifest.txt

Database Management Menu (Please Select):
        1) Backup Database - (Saves to Backups folder)
                Ideal to perform before performing updates
        2) Backup Database Compressed - (Saves to Backups folder)
                Ideal to perform before performing updates
        3) Check for pending Database updates
                Stages updates for automatic upgrade...
        0) Exit

When you select 3) it would stage to see which updates your database does not have.

You would see something like this:

Code:

Reading manifest...

Missing DB Update 9057 '2014_11_13_spells_new_updates.sql'
        URL:    https://raw.githubusercontent.com/EQEmu/Server/master/utils/sql/git/required/2014_11_13_spells_new_updates.sql
        Saved:  db_update/2014_11_13_spells_new_updates.sql
Missing DB Update 9056 '2014_11_08_RaidMembers.sql'
        URL:    https://raw.githubusercontent.com/EQEmu/Server/master/utils/sql/git/required/2014_11_08_RaidMembers.sql
        Saved:  db_update/2014_11_08_RaidMembers.sql
Missing DB Update 9055 '2014_10_30_special_abilities_null.sql'
        URL:    https://raw.githubusercontent.com/EQEmu/Server/master/utils/sql/git/required/2014_10_30_special_abilities_null.sql
        Saved:  db_update/2014_10_30_special_abilities_null.sql
ERROR 1146 (42S02) at line 1: Table 'eoc.raid_leaders' doesn't exist
Missing DB Update 9054 '2014_10_19_raid_group_mentor.sql'
        URL:    https://raw.githubusercontent.com/EQEmu/Server/master/utils/sql/git/required/2014_10_19_raid_group_mentor.sql
        Saved:  db_update/2014_10_19_raid_group_mentor.sql
Missing DB Update 9053 '2014_10_18_group_mentor.sql'
        URL:    https://raw.githubusercontent.com/EQEmu/Server/master/utils/sql/git/required/2014_10_18_group_mentor.sql
        Saved:  db_update/2014_10_18_group_mentor.sql
Missing DB Update 9052 '2014_10_13_RaidLeadership.sql'
        URL:    https://raw.githubusercontent.com/EQEmu/Server/master/utils/sql/git/required/2014_10_13_RaidLeadership.sql
        Saved:  db_update/2014_10_13_RaidLeadership.sql
Missing DB Update 9051 '2014_10_11_RaidMOTD.sql'
        URL:    https://raw.githubusercontent.com/EQEmu/Server/master/utils/sql/git/required/2014_10_11_RaidMOTD.sql
        Saved:  db_update/2014_10_11_RaidMOTD.sql
Missing DB Update 9050 '2014_09_20_ban_messages.sql'
        URL:    https://raw.githubusercontent.com/EQEmu/Server/master/utils/sql/git/required/2014_09_20_ban_messages.sql
        Saved:  db_update/2014_09_20_ban_messages.sql
Missing DB Update 9048 '2014_09_09_attack_delay.sql'
        URL:    https://raw.githubusercontent.com/EQEmu/Server/master/utils/sql/git/required/2014_09_09_attack_delay.sql
        Saved:  db_update/2014_09_09_attack_delay.sql
Missing DB Update 9046 '2014_08_23_player_events_and_player_aa_rate_hourly.sql'
        URL:    https://raw.githubusercontent.com/EQEmu/Server/master/utils/sql/git/required/2014_08_23_player_events_and_player_aa_rate_hourly.sql
        Saved:  db_update/2014_08_23_player_events_and_player_aa_rate_hourly.sql
Missing DB Update 9045 '2014_08_23_Complete_QueryServ_Table_Structures.sql'
        URL:    https://raw.githubusercontent.com/EQEmu/Server/master/utils/sql/git/required/2014_08_23_Complete_QueryServ_Table_Structures.sql
        Saved:  db_update/2014_08_23_Complete_QueryServ_Table_Structures.sql
Missing DB Update 9044 '2014_08_20_merchantlist_probability.sql'
        URL:    https://raw.githubusercontent.com/EQEmu/Server/master/utils/sql/git/required/2014_08_20_merchantlist_probability.sql
        Saved:  db_update/2014_08_20_merchantlist_probability.sql
Missing DB Update 9043 '2014_08_18_spells_new_update.sql'
        URL:    https://raw.githubusercontent.com/EQEmu/Server/master/utils/sql/git/required/2014_08_18_spells_new_update.sql
        Saved:  db_update/2014_08_18_spells_new_update.sql
Missing DB Update 9042 '2014_08_12_NPC_raid_targets.sql'
        URL:    https://raw.githubusercontent.com/EQEmu/Server/master/utils/sql/git/required/2014_08_12_NPC_raid_targets.sql
        Saved:  db_update/2014_08_12_NPC_raid_targets.sql
Missing DB Update 9041 '2014_08_02_spells_new.sql'
        URL:    https://raw.githubusercontent.com/EQEmu/Server/master/utils/sql/git/required/2014_08_02_spells_new.sql
        Saved:  db_update/2014_08_02_spells_new.sql
Missing DB Update 9040 '2014_07_10_npc_spells.sql'
        URL:    https://raw.githubusercontent.com/EQEmu/Server/master/utils/sql/git/required/2014_07_10_npc_spells.sql
        Saved:  db_update/2014_07_10_npc_spells.sql
Missing DB Update 9039 '2014_07_04_AA_Updates.sql'
        URL:    https://raw.githubusercontent.com/EQEmu/Server/master/utils/sql/git/required/2014_07_04_AA_Updates.sql
        Saved:  db_update/2014_07_04_AA_Updates.sql
Missing DB Update 9038 '2014_06_25_AA_Updates.sql'
        URL:    https://raw.githubusercontent.com/EQEmu/Server/master/utils/sql/git/required/2014_06_25_AA_Updates.sql
        Saved:  db_update/2014_06_25_AA_Updates.sql
Missing DB Update 9036 '2014_05_04_SlowMitigationFix.sql'
        URL:    https://raw.githubusercontent.com/EQEmu/Server/master/utils/sql/git/required/2014_05_04_SlowMitigationFix.sql
        Saved:  db_update/2014_05_04_SlowMitigationFix.sql
Missing DB Update 9035 '2014_04_27_AISpellEffects.sql'
        URL:    https://raw.githubusercontent.com/EQEmu/Server/master/utils/sql/git/required/2014_04_27_AISpellEffects.sql
        Saved:  db_update/2014_04_27_AISpellEffects.sql
Missing DB Update 9034 '2014_04_25_spawn_events.sql'
        URL:    https://raw.githubusercontent.com/EQEmu/Server/master/utils/sql/git/required/2014_04_25_spawn_events.sql
        Saved:  db_update/2014_04_25_spawn_events.sql
Missing DB Update 9032 '2014_04_12_SlowMitigation.sql'
        URL:    https://raw.githubusercontent.com/EQEmu/Server/master/utils/sql/git/required/2014_04_12_SlowMitigation.sql
        Saved:  db_update/2014_04_12_SlowMitigation.sql
Missing DB Update 9031 '2014_04_10_No_Target_With_Hotkey.sql'
        URL:    https://raw.githubusercontent.com/EQEmu/Server/master/utils/sql/git/required/2014_04_10_No_Target_With_Hotkey.sql
        Saved:  db_update/2014_04_10_No_Target_With_Hotkey.sql
Missing DB Update 9030 '2014_04_04_PhysicalResist.sql'
        URL:    https://raw.githubusercontent.com/EQEmu/Server/master/utils/sql/git/required/2014_04_04_PhysicalResist.sql
        Saved:  db_update/2014_04_04_PhysicalResist.sql
Missing DB Update 9029 '2014_02_26_virulentvenomAA.sql'
        URL:    https://raw.githubusercontent.com/EQEmu/Server/master/utils/sql/git/required/2014_02_26_virulentvenomAA.sql
        Saved:  db_update/2014_02_26_virulentvenomAA.sql
Missing DB Update 9028 '2014_02_26_roambox_update.sql'
        URL:    https://raw.githubusercontent.com/EQEmu/Server/master/utils/sql/git/required/2014_02_26_roambox_update.sql
        Saved:  db_update/2014_02_26_roambox_update.sql
Missing DB Update 9027 '2014_02_20_buff_update.sql'
        URL:    https://raw.githubusercontent.com/EQEmu/Server/master/utils/sql/git/required/2014_02_20_buff_update.sql
        Saved:  db_update/2014_02_20_buff_update.sql
DB up to date with: 9026 '2014_02_13_spells_new_update.sql'
Missing DB Update 9025 '2014_02_13_Rename_instance_lockout_tables.sql'
        URL:    https://raw.githubusercontent.com/EQEmu/Server/master/utils/sql/git/required/2014_02_13_Rename_instance_lockout_tables.sql
        Saved:  db_update/2014_02_13_Rename_instance_lockout_tables.sql
DB up to date with: 9024 '2014_02_02_SpellCriticalsAA.sql'
Missing DB Update 9023 '2014_01_27_CritcalMendAA.sql'
        URL:    https://raw.githubusercontent.com/EQEmu/Server/master/utils/sql/git/required/2014_01_27_CritcalMendAA.sql
        Saved:  db_update/2014_01_27_CritcalMendAA.sql
Missing DB Update 9022 '2014_01_20_Weather.sql'
        URL:    https://raw.githubusercontent.com/EQEmu/Server/master/utils/sql/git/required/2014_01_20_Weather.sql
        Saved:  db_update/2014_01_20_Weather.sql
Missing DB Update 9021 '2014_01_20_SpellCastingReinforcement.sql'
        URL:    https://raw.githubusercontent.com/EQEmu/Server/master/utils/sql/git/required/2014_01_20_SpellCastingReinforcement.sql
        Saved:  db_update/2014_01_20_SpellCastingReinforcement.sql
DB up to date with: 9020 '2014_01_20_Not_Extendable.sql'
Missing DB Update 9019 '2014_01_20_MezMastery.sql'
        URL:    https://raw.githubusercontent.com/EQEmu/Server/master/utils/sql/git/required/2014_01_20_MezMastery.sql
        Saved:  db_update/2014_01_20_MezMastery.sql
Missing DB Update 9018 '2014_01_09_PreservePetSize.sql'
        URL:    https://raw.githubusercontent.com/EQEmu/Server/master/utils/sql/git/required/2014_01_09_PreservePetSize.sql
        Saved:  db_update/2014_01_09_PreservePetSize.sql
DB up to date with: 9017 '2014_01_08_SpellsNewAdditions.sql'
Missing DB Update 9016 '2014_01_04_SongModCapAAs.sql'
        URL:    https://raw.githubusercontent.com/EQEmu/Server/master/utils/sql/git/required/2014_01_04_SongModCapAAs.sql
        Saved:  db_update/2014_01_04_SongModCapAAs.sql
Missing DB Update 9015 '2013_12_26_MerchantList_Class_Required.sql'
        URL:    https://raw.githubusercontent.com/EQEmu/Server/master/utils/sql/git/required/2013_12_26_MerchantList_Class_Required.sql
        Saved:  db_update/2013_12_26_MerchantList_Class_Required.sql
DB up to date with: 9014 '2013_11_18_AssistRadius.sql'
DB up to date with: 9013 '2013_11_13_Instrument_Singing_Mastery.sql'
DB up to date with: 9012 '2013_11_07_BaseData.sql'
DB up to date with: 9011 '2013_10_31_Recipe_disabling.sql'
DB up to date with: 9009 '2013_10_12_Merc_Special_Abilities.sql'
DB up to date with: 9008 '2013_07_11_NPC_Special_Abilities.sql'
DB up to date with: 9007 '2013_05_05_Item_Tick.sql'
DB up to date with: 9006 '2013_05_05_Account_Flags.sql'
DB up to date with: 9005 '2013_04_08_Salvage.sql'
DB up to date with: 9004 '2013_04_04_NaturesBounty.sql'
DB up to date with: 9002 '2013_03_1_Merc_Rules_and_Equipment.sql'
DB up to date with: 9001 '2013_02_25_Impr_HT_LT.sql'
DB up to date with: 9000 '2013_02_18_Merc_Rules_and_Tables.sql'
DB up to date with: 8000 'mercs.sql'

When this routine completes, you should see something that resembles the following:

Code:

Running Update: 9015 - 2013_12_26_MerchantList_Class_Required.sql
Running Update: 9016 - 2014_01_04_SongModCapAAs.sql
Running Update: 9018 - 2014_01_09_PreservePetSize.sql
Running Update: 9019 - 2014_01_20_MezMastery.sql
Running Update: 9021 - 2014_01_20_SpellCastingReinforcement.sql
Running Update: 9022 - 2014_01_20_Weather.sql
Running Update: 9023 - 2014_01_27_CritcalMendAA.sql
Running Update: 9025 - 2014_02_13_Rename_instance_lockout_tables.sql
Running Update: 9027 - 2014_02_20_buff_update.sql
ERROR 1146 (42S02) at line 4: Table 'eoc.botbuffs' doesn't exist
ERROR 1146 (42S02) at line 8: Table 'eoc.botbuffs' doesn't exist
ERROR 1146 (42S02) at line 12: Table 'eoc.botbuffs' doesn't exist
ERROR 1146 (42S02) at line 16: Table 'eoc.botbuffs' doesn't exist
ERROR 1146 (42S02) at line 20: Table 'eoc.botbuffs' doesn't exist
ERROR 1054 (42S22) at line 22: Unknown column 'not_reflectable' in 'spells_new'
Running Update: 9028 - 2014_02_26_roambox_update.sql
Running Update: 9029 - 2014_02_26_virulentvenomAA.sql
Running Update: 9030 - 2014_04_04_PhysicalResist.sql
Running Update: 9031 - 2014_04_10_No_Target_With_Hotkey.sql
Running Update: 9032 - 2014_04_12_SlowMitigation.sql
Running Update: 9034 - 2014_04_25_spawn_events.sql
Running Update: 9035 - 2014_04_27_AISpellEffects.sql
Running Update: 9036 - 2014_05_04_SlowMitigationFix.sql
Running Update: 9038 - 2014_06_25_AA_Updates.sql
Running Update: 9039 - 2014_07_04_AA_Updates.sql
Running Update: 9040 - 2014_07_10_npc_spells.sql
Running Update: 9041 - 2014_08_02_spells_new.sql
Running Update: 9042 - 2014_08_12_NPC_raid_targets.sql
Running Update: 9043 - 2014_08_18_spells_new_update.sql
Running Update: 9044 - 2014_08_20_merchantlist_probability.sql
Running Update: 9045 - 2014_08_23_Complete_QueryServ_Table_Structures.sql
Running Update: 9046 - 2014_08_23_player_events_and_player_aa_rate_hourly.sql
Running Update: 9048 - 2014_09_09_attack_delay.sql
Running Update: 9050 - 2014_09_20_ban_messages.sql
Running Update: 9051 - 2014_10_11_RaidMOTD.sql
Running Update: 9052 - 2014_10_13_RaidLeadership.sql
Running Update: 9053 - 2014_10_18_group_mentor.sql
Running Update: 9054 - 2014_10_19_raid_group_mentor.sql
Running Update: 9055 - 2014_10_30_special_abilities_null.sql
Running Update: 9056 - 2014_11_08_RaidMembers.sql
Running Update: 9057 - 2014_11_13_spells_new_updates.sql
Reading manifest...

DB up to date with: 9057 '2014_11_13_spells_new_updates.sql'
DB up to date with: 9056 '2014_11_08_RaidMembers.sql'
DB up to date with: 9055 '2014_10_30_special_abilities_null.sql'
DB up to date with: 9054 '2014_10_19_raid_group_mentor.sql'
DB up to date with: 9053 '2014_10_18_group_mentor.sql'
DB up to date with: 9052 '2014_10_13_RaidLeadership.sql'
DB up to date with: 9051 '2014_10_11_RaidMOTD.sql'
DB up to date with: 9050 '2014_09_20_ban_messages.sql'
DB up to date with: 9048 '2014_09_09_attack_delay.sql'
DB up to date with: 9046 '2014_08_23_player_events_and_player_aa_rate_hourly.sql'
DB up to date with: 9045 '2014_08_23_Complete_QueryServ_Table_Structures.sql'
DB up to date with: 9044 '2014_08_20_merchantlist_probability.sql'
DB up to date with: 9043 '2014_08_18_spells_new_update.sql'
DB up to date with: 9042 '2014_08_12_NPC_raid_targets.sql'
DB up to date with: 9041 '2014_08_02_spells_new.sql'
DB up to date with: 9040 '2014_07_10_npc_spells.sql'
DB up to date with: 9039 '2014_07_04_AA_Updates.sql'
DB up to date with: 9038 '2014_06_25_AA_Updates.sql'
DB up to date with: 9036 '2014_05_04_SlowMitigationFix.sql'
DB up to date with: 9035 '2014_04_27_AISpellEffects.sql'
DB up to date with: 9034 '2014_04_25_spawn_events.sql'
DB up to date with: 9032 '2014_04_12_SlowMitigation.sql'
DB up to date with: 9031 '2014_04_10_No_Target_With_Hotkey.sql'
DB up to date with: 9030 '2014_04_04_PhysicalResist.sql'
DB up to date with: 9029 '2014_02_26_virulentvenomAA.sql'
DB up to date with: 9028 '2014_02_26_roambox_update.sql'
DB up to date with: 9027 '2014_02_20_buff_update.sql'
DB up to date with: 9026 '2014_02_13_spells_new_update.sql'
DB up to date with: 9025 '2014_02_13_Rename_instance_lockout_tables.sql'
DB up to date with: 9024 '2014_02_02_SpellCriticalsAA.sql'
DB up to date with: 9023 '2014_01_27_CritcalMendAA.sql'
DB up to date with: 9022 '2014_01_20_Weather.sql'
DB up to date with: 9021 '2014_01_20_SpellCastingReinforcement.sql'
DB up to date with: 9020 '2014_01_20_Not_Extendable.sql'
DB up to date with: 9019 '2014_01_20_MezMastery.sql'
DB up to date with: 9018 '2014_01_09_PreservePetSize.sql'
DB up to date with: 9017 '2014_01_08_SpellsNewAdditions.sql'
DB up to date with: 9016 '2014_01_04_SongModCapAAs.sql'
DB up to date with: 9015 '2013_12_26_MerchantList_Class_Required.sql'
DB up to date with: 9014 '2013_11_18_AssistRadius.sql'
DB up to date with: 9013 '2013_11_13_Instrument_Singing_Mastery.sql'
DB up to date with: 9012 '2013_11_07_BaseData.sql'
DB up to date with: 9011 '2013_10_31_Recipe_disabling.sql'
DB up to date with: 9009 '2013_10_12_Merc_Special_Abilities.sql'
DB up to date with: 9008 '2013_07_11_NPC_Special_Abilities.sql'
DB up to date with: 9007 '2013_05_05_Item_Tick.sql'
DB up to date with: 9006 '2013_05_05_Account_Flags.sql'
DB up to date with: 9005 '2013_04_08_Salvage.sql'
DB up to date with: 9004 '2013_04_04_NaturesBounty.sql'
DB up to date with: 9002 '2013_03_1_Merc_Rules_and_Equipment.sql'
DB up to date with: 9001 '2013_02_25_Impr_HT_LT.sql'
DB up to date with: 9000 '2013_02_18_Merc_Rules_and_Tables.sql'
DB up to date with: 8000 'mercs.sql'

Yes there were some errors, because I'm not using bots. But everything else went through smoothly.

And then a return back to the management menu:

Code:

Database Management Menu (Please Select):
        1) Backup Database - (Saves to Backups folder)
                Ideal to perform before performing updates
        2) Backup Database Compressed - (Saves to Backups folder)
                Ideal to perform before performing updates
        3) Check for pending Database updates
                Stages updates for automatic upgrade...
        0) Exit

When the database is up to date, world will not interrupt the bootup process. When versions match it will simply bootup as intended. When you have updates that need to be made, you probably shouldn't be booting up anyways.

If anyone has any questions, comments feel free. Enjoy this should be a huge step in keeping our server upgrade process streamlined.

http://i.imgur.com/lCVKRms.png

Changelog Notes:

Code:

== 11/16/2014 ==
demonstar55: fix size issue with ControlBoat_Struct and exploit fix in OP_BoardBoat
Akkadius: Implemented Automatic Database update and versioning system
Akkadius: Created database revision define, this is located in version.h in common #define CURRENT_BINARY_DATABASE_VERSION 9057
        - This revision define will need to be incremented each time a database update is made
        - Along with a revision define increment, you will need to update the db_update manifest located in:
                - https://raw.githubusercontent.com/EQEmu/Server/master/utils/sql/db_update_manifest.txt
                - An entry needs to be made at the bottom of the manifest, the entry is quite simple
                - Example: 9057|2014_11_13_spells_new_updates.sql|SHOW COLUMNS FROM `spells_new` LIKE 'disallow_sit'|empty|
                        - This latest example is checking to see if the spells_new table contains the column 'disallow_sit', if its empty, the update needs to be ran
                                - More examples of match types below:
                # Example: Version|Filename.sql|Query_to_Check_Condition_For_Needed_Update|match type|text to match
                #        0 = Database Version
                #        1 = Filename.sql
                #        2 = Query_to_Check_Condition_For_Needed_Update
                #        3 = Match Type - If condition from match type to Value 4 is true, update will flag for needing to be ran
                #                contains = If query results contains text from 4th value
                #                match = If query results matches text from 4th value
                #                missing = If query result is missing text from 4th value
                #                empty = If the query results in no results
                #                not_empty = If the query is not empty
                #        4 = Text to match
        - The manifest contains all database updates 'Required' to be made to the schema, and it will contain a working backport all the way back to SVN -
                currently it is tested and backported through the beginning of our Github repo
        - On world bootup or standalone run of db_update.pl, users will be prompted with a simple menu that we will expand upon later:
       
                ============================================================
                          EQEmu: Automatic Database Upgrade Check
                ============================================================
                                Operating System is: MSWin32
                                (Windows) MySQL is in system path
                                Path = C:\Program Files\MariaDB 10.0\bin/mysql
                ============================================================
                                Binary Database Version: (9057)
                                Local Database Version: (9057)

                                Database up to Date: Continuing World Bootup...
                ============================================================
                Retrieving latest database manifest...
        URL:    https://raw.githubusercontent.com/EQEmu/Server/master/utils/sql/db_update_manifest.txt
        Saved:  db_update/db_update_manifest.txt

Database Management Menu (Please Select):
        1) Backup Database - (Saves to Backups folder)
                Ideal to perform before performing updates
        2) Backup Database Compressed - (Saves to Backups folder)
                Ideal to perform before performing updates
        3) Check for pending Database updates
                Stages updates for automatic upgrade...
        0) Exit

Akkadius: Created db_update.pl, placed in utils/scripts folder, used for the automatic database update routine (Linux/Windows)
        - db_update.pl script created db_version table if not created, if old one is present it will remove it
Akkadius: Created db_dumper.pl, placed in utils/scripts folder, used for the automatic database update routine backups and standalone backups (Linux/Windows)
Akkadius: World will now check the db_update.pl script on bootup, if the db_update.pl script is not present, it will fetch it remotely before running -
        when db_update.pl is done running, world will continue with bootup

Thanks,
Akka

ghanja 11-17-2014 03:04 AM

Is there a parameter world can be passed to either make a users preferred choice and/or completely say "not right now go away" ?

Confused because you stated:
Quote:

When World boots up, it will start this check process by pulling down scripts from Github if you don't have them, this process happens transparent to the user
but then what reads to be a slight contradiction:
Quote:

When you have updates that need to be made, you probably shouldn't be booting up anyways.
Interrupting the World process seems, well, a little pushy. <shrug> You asked for opinions, there ya go.

Akkadius 11-17-2014 03:13 AM

These are required database scheme updates and if you are updating your binaries you are also going to want your schematic to reflect so what you're saying doesn't make sense.

Adding a skip check parameter to world can be done for those who would like the choice. But the point is to have it so most users will notice that there is an upgrade needing to be done with the database side. It really takes seconds to do and you won't have to see it until you update your source with another schema change.

Also what you may not be seeing as well is that if your schema is up to date, world will still boot up uninterrupted. if world boots up and their binary DB version is greater than you local than you would want to update otherwise you could have major things flat out not work.

Anything can be added to it at this point it's pretty easy. Most of the heavy lifting is done and it was a lot of work in a short amount of time mainly because I've had a lot of time to think about it.

ghanja 11-17-2014 03:19 AM

Quote:

Originally Posted by Akkadius (Post 235610)
These are required database scheme updates and if you are updating your binaries you are also going to want your schematic to reflect so what you're saying doesn't make sense.

Halting the running of World waiting for user input was the gist of what I was making comment about.

Made sense to me. :)

vsab 11-17-2014 07:03 AM

Just to clarify; assuming that you are running a server and don't update the binaries and your database is 100% up to date with the binaries you are using, this script will determine that you are running the latest you need and basically do nothing and World will just run without any intervention. So in this case automated restarts will simply "just work".

However, if you update your binaries but NOT your database, then it will update, immediately after which I assume you would be doing a restart attended (or manually update the database).

Is that correct?

chrsschb 11-17-2014 11:07 AM

Making sure I understand this fully...

The script automatically does schema updates, NOT content updates. Correct?

So for instance it won't overwrite changes to spells, items, AAs, rules, etc?

Akkadius 11-17-2014 12:16 PM

Once again, required schema updates are things like adding a table, or a field or changing core mechanic data. Not content oriented data.

Scorpious2k 11-17-2014 12:36 PM

I hate people who wait until something is done and then come around to poke it and criticize. I apologize if I appear to be doing that. That isn't what is intended. I think this is a brilliant and useful feature!

That said, wouldn't it have been better in shared_memory instead of world? That way it could update the DB before writing out the tables. Tables affected, including those in shared memory would then be up-to-date before you got to world.

It seems to me that if you do it in world, and tables affected includes those in shared_memory then shared_memory could crash before ever getting to world or it would write old style tables to shared memory which would ultimately cause problems in world/zones.

I could of course be wrong.

Akkadius 11-17-2014 12:59 PM

I think people are severely missing the point here.

I did this for a mere quality of life benefit for the EQEmu community.

The complaints or suggestions I'm getting are one small fucking step in regards to quality of life as to how you open your server. Patch it, be done within seconds, never see it again until next binary update actually requires a database change.

If you are maintaining a server, updating binaries, you need to update your database, it's that simple. Otherwise, there is no change in the workflow.

chrsschb 11-17-2014 03:55 PM

Quote:

Originally Posted by Akkadius (Post 235618)
I think people are severely missing the point here.

I did this for a mere quality of life benefit for the EQEmu community.

The complaints or suggestions I'm getting are one small fucking step in regards to quality of life as to how you open your server. Patch it, be done within seconds, never see it again until next binary update actually requires a database change.

If you are maintaining a server, updating binaries, you need to update your database, it's that simple. Otherwise, there is no change in the workflow.

No hate intended from me, just wanting to make sure I understand 100%. :-D

Appreciate it!

provocating 11-17-2014 07:43 PM

Oh my!! Going to test this out soon, awesomeness.

Akkadius 11-17-2014 09:50 PM

Here is a Wiki article that may explain things a little more clearly:

http://wiki.eqemulator.org/p?Automat...ystem&frm=Main

In the end, the system is super simple to use.

ionhsmith 11-19-2014 03:13 PM

This seems cool ... I know U said u have it working for Linux ... is it available for others? If so how do I get it to work?

Akkadius 11-19-2014 03:18 PM

Quote:

Originally Posted by ionhsmith (Post 235644)
This seems cool ... I know U said u have it working for Linux ... is it available for others? If so how do I get it to work?

............What?

Akkadius 11-19-2014 06:05 PM

FYI this now optionally allow users to pull fresh PEQ AA tables:

http://i.imgur.com/OBrIOCM.png

Krran 11-20-2014 02:49 AM

This is pretty good stuff and will cut down on the errors people are encountering starting and updating a server. Thanks for putting in the time to make this process MUCH easier, especially for newbies or those who are not as familiar with how to script this kind of stuff.
I know I will be using it and will help me to update more frequently.

Drajor 11-20-2014 12:43 PM

This is a really positive step in the right direction IMO. Anything that lowers or removes an entry barrier will hopefully result in more people trying it out and making cool things. Also less 'Hulp! It's broken!' posts heh

pfyon 11-20-2014 03:32 PM

Just FYI, my old start script redirects the output of all the binaries (world, zone, etc) to a logfile. Turns out when this starts, it prompts for user input if there are updates.... and continues to prompt. 16GB logfile later I discovered this and killed it.

So anyone who redirects output to a logfile, beware.

Akkadius 11-20-2014 03:51 PM

Quote:

Originally Posted by pfyon (Post 235658)
Just FYI, my old start script redirects the output of all the binaries (world, zone, etc) to a logfile. Turns out when this starts, it prompts for user input if there are updates.... and continues to prompt. 16GB logfile later I discovered this and killed it.

So anyone who redirects output to a logfile, beware.

These are the sorts of things that I need to fix and be brought to attention.

I'm assuming this is Linux.

If your database is up to date you won't have that issue since it will not wait for a prompt.

Can you reproduce to me what the contents of the log is? I'm going to guess its reprinting the menu because the start script is sending characters.

trevius 11-20-2014 04:04 PM

Quote:

Originally Posted by pfyon (Post 235658)
Just FYI, my old start script redirects the output of all the binaries (world, zone, etc) to a logfile. Turns out when this starts, it prompts for user input if there are updates.... and continues to prompt. 16GB logfile later I discovered this and killed it.

So anyone who redirects output to a logfile, beware.

Had this same issue, so Akkadius was already aware and it will be resolved. Until it is fixed, you can get around this by starting world manually the first time after you update by doing the following:

./world

Then you can respond to the prompts, update your db and CTRL+C to end the process. Finally, use your startup script again as normal and you will be running without issues (at least until the next update).

pfyon 11-20-2014 04:56 PM

Quote:

Originally Posted by trevius (Post 235660)
Had this same issue, so Akkadius was already aware and it will be resolved. Until it is fixed, you can get around this by starting world manually the first time after you update by doing the following:

./world

Then you can respond to the prompts, update your db and CTRL+C to end the process. Finally, use your startup script again as normal and you will be running without issues (at least until the next update).

Yeah, I realized the issue after waiting about half an hour and doing a df -h. And yes, linux.

Ultimately, I was bringing my source up to date and my database is all screwed up because I guess bots are screwed up right now? So it was never able to run all the updates properly.

knowom 11-20-2014 05:17 PM

Is this a bit like WSUS offline slipstream updates applied to EQemu? Basically take for example EQemu repack and ensure it stays up to date automatically as the peqDB changes in the future?

Another words combined together a slipstream installation and patching system. I kind of assume it was partly made both to update old DB's easily, but also to ensure your repack stays up to date and doesn't require constant maintenance for users?

Akkadius 11-20-2014 06:48 PM

Quote:

Originally Posted by knowom (Post 235664)
Is this a bit like WSUS offline slipstream updates applied to EQemu? Basically take for example EQemu repack and ensure it stays up to date automatically as the peqDB changes in the future?

Another words combined together a slipstream installation and patching system. I kind of assume it was partly made both to update old DB's easily, but also to ensure your repack stays up to date and doesn't require constant maintenance for users?

No, its not supposed to be a WSUS type of setup. Most people upgrading a server are connected to the internet at the time because they need to pull down new source files to even compile and this script runs no differently.

This is for everyone, to keep databases consistent and also provide us a graceful medium to apply updates effectively.

Yeah sure its being but right in the middle of normal workflow, but if you're up to date you don't notice anything.

At its core its meant to keep a database update with the binary you are running, it fetches updates from github and runs whatever is appropriate.

With it, we also can start providing pre-patch options in it too. Like for example enabling bots at the database level or enabling mercenaries, turning on and off rules and such can be made plug and play with this as well. Lots to evolve with.

Akkadius 11-20-2014 06:48 PM

Quote:

Originally Posted by pfyon (Post 235662)
Yeah, I realized the issue after waiting about half an hour and doing a df -h. And yes, linux.

Ultimately, I was bringing my source up to date and my database is all screwed up because I guess bots are screwed up right now? So it was never able to run all the updates properly.

Are you running bots currently?

pfyon 11-20-2014 09:02 PM

Quote:

Originally Posted by Akkadius (Post 235670)
Are you running bots currently?

I was, but that was around 6 months ago. I had to rebuild my vps and am just getting around to getting eqemu back up now.

Akkadius 11-27-2014 01:52 AM

Here is a fix for linux users. Replace your start script as such:

http://wiki.eqemulator.org/i?Module=...Paste=xRJzfmq2

It will run the update routine before ever triggering world, which will all the user take care of updates, exit the program and then everything will continue to flow and start the server up every single time until you decide to upgrade.

ionhsmith 11-28-2014 09:31 PM

Hmm I must be missing something ... how do I go about installing this?

Akkadius 11-28-2014 09:37 PM

Quote:

Originally Posted by ionhsmith (Post 235815)
Hmm I must be missing something ... how do I go about installing this?

What do you mean? Are you running Linux? Or are you talking about the system itself?

ionhsmith 11-30-2014 02:29 PM

No I do not run linux ... I was talking about the system itself ... I like the idea of being able to quickly install updates .... Is this only for linux?

Akkadius 11-30-2014 04:52 PM

No being on Linux just means you have to change a little bit of your scripts to make it more friendly.

This explains how it works here, in the end its part of the binary and I've put a lot of effort in making it seamless.

http://wiki.eqemulator.org/p?Automat...-process-works

Burningsoul 11-30-2014 05:03 PM

Hypopathetically speaking, what's the age limit on a database this will upgrade? I see your in your example pic it starts with updates from 2013, anyone run Zeb/Squeeker/older stuff through it for giggles?

Akkadius 11-30-2014 05:08 PM

Quote:

Originally Posted by Burningsoul (Post 235850)
Hypopathetically speaking, what's the age limit on a database this will upgrade? I see your in your example pic it starts with updates from 2013, anyone run Zeb/Squeeker/older stuff through it for giggles?

Thanks for reminding me, I have the manifest built through all of Github updates. I need to configure the manifest to understand all of the upgrades through SVN.

So technically when I have that done, it should take a super old database all the way up to recent with ease.

Akka's Funhouse for example was just old enough to be a few months ahead of when we started with Git, so I took a 2 year old database and brought it to recent within seconds. Very very nice thing to have.

wirepuller134 12-09-2014 10:06 AM

Just compiled and updated. This worked flawlessly, thank you for adding this feature!

Riklin 01-07-2015 01:38 AM

I just wanted to mention that this works GREAT!

For around 20 total hours I tried every guide I could find, every list of steps, to update halls havoc database correctly. Everything I tried would have errors in various sql scripts. Then when it apparently worked, there were things obviously wrong. Things like inventory disappeared completely and all items seemed to be unavailable, yet the items table was full of items. I ended up resurrecting a an old database save from before I started trying to update, and then sourced the data then ran the server.

The automatic updater worked perfectly!


I think there is so much obsolete information out there now, that it is difficult to figure out exactly what to do. This auto-updater is a GREAT feature!

Excellent work, all!

Rick HallsHavoc

iluvseq 01-10-2015 08:50 PM

This only works if the database runs on the same host as the world server. Your script grabs host from the config file, but never actually uses the $host variable in your mysql commands.

Since it also auto-downloads db_update.pl I can't even fix the script as my changes get overwritten.

Akkadius 01-10-2015 09:35 PM

Quote:

Originally Posted by iluvseq (Post 236704)
This only works if the database runs on the same host as the world server. Your script grabs host from the config file, but never actually uses the $host variable in your mysql commands.

Since it also auto-downloads db_update.pl I can't even fix the script as my changes get overwritten.

Run your updates on the world server?

iluvseq 01-11-2015 09:17 AM

The world server and the database server are not the same host. You should simply modify the script to add --host="$host" to the various mysql command lines and that would solve the issue.

As a work-around, I've simply set the MYSQL_HOST environment variable prior to running ./world

Even then, the script still doesn't fully update the database (coming from peqbeta_2014-10-11-02:01.sql) as apparently that database is missing some core tables like character_buffs so there are 8 required updates which fail to apply. Not really a problem with the script, per-se, although I'm surprised there isn't a simple empty schema included with the source that one could apply to build an empty, clean and current database so that this whole patch process wouldn't be necessary for a brand new installation. Relying on PEQ to provide the base schema seems silly.

Riklin 01-11-2015 05:28 PM

But there are warnings all over the place not to use the October 2014 version of the database. You need to use the September version...

iluvseq 01-11-2015 07:05 PM

I have yet to see any of those warnings. Other than the one I posted after I figured it out the hard way.

Regardless, that has nothing to do with the fact that the update_db.pl script parses the configuration file for <host> and then ignores it, only working on localhost unless you set the MYSQL_HOST environment variable.

This is a bug in the script, regardless of which peq db one uses (or even if one doesn't use peq at all!)

Akkadius 01-11-2015 09:16 PM

Quote:

Originally Posted by iluvseq (Post 236751)
I have yet to see any of those warnings. Other than the one I posted after I figured it out the hard way.

Regardless, that has nothing to do with the fact that the update_db.pl script parses the configuration file for <host> and then ignores it, only working on localhost unless you set the MYSQL_HOST environment variable.

This is a bug in the script, regardless of which peq db one uses (or even if one doesn't use peq at all!)

Wouldn't necessarily call it a bug.

It pulls it down automatically because I've set it that way for a while because at one point the script wasn't capable of checking itself for updates by being passed parameters by the source, could probably change that soon.

Also, why are you using multiple hosts? It's far unecessary unless you actually have load to match the necessity.

98% of the folks who run the script aren't going to need a host option and would simply run it on their database server.

Updated, you're welcome.

https://github.com/EQEmu/Server/comm...a6e1e00cc91214

And

Quote:

Even then, the script still doesn't fully update the database (coming from peqbeta_2014-10-11-02:01.sql) as apparently that database is missing some core tables like character_buffs so there are 8 required updates which fail to apply. Not really a problem with the script, per-se, although I'm surprised there isn't a simple empty schema included with the source that one could apply to build an empty, clean and current database so that this whole patch process wouldn't be necessary for a brand new installation. Relying on PEQ to provide the base schema seems silly.
This has to do with PEQ dumps, the schema update does exactly what it needs to do and PEQ missing tables is another issue in itself. I will notify those who oversee those dumps.


All times are GMT -4. The time now is 05:43 PM.

Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.