Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Database/World Building

Development::Database/World Building World Building forum, dedicated to the EQEmu MySQL Database. Post partial/complete databases for spawns, items, etc.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 11-24-2012, 05:48 AM
Drajor's Avatar
Drajor
Developer
 
Join Date: Nov 2012
Location: Halas
Posts: 355
Default TIP: Reducing DB backup size for custom servers

Hey guys,

I thought I would share this technique as someone else may find it useful. The server I am developing is customised in such a way that I am only using a subset of the many available zones (not uncommon in custom set ups). This means that there is a considerable amount of data redundancy in the DB across a few tables. In this example I am focusing on the 'grid', 'grid_entries' and 'doors' tables.

Create a duplicate of the 'grid', 'grid_entries' and 'doors' tables, naming them 'grid_copy', 'grid_entries_copy' and 'doors_copy'. These new tables will not be included in your regular DB backup.

The following SQL will create your copy tables and empty the original tables.
Code:
# grid table
CREATE TABLE grid_copy LIKE grid;
INSERT grid_copy SELECT * FROM grid;
DELETE FROM grid;

# grid_entries table
CREATE TABLE grid_entries_copy LIKE grid_entries;
INSERT grid_entries_copy SELECT * FROM grid_entries;
DELETE FROM grid_entries;

# doors table
CREATE TABLE doors_copy LIKE doors;
INSERT doors_copy SELECT * FROM doors;
DELETE FROM doors;
The following SQL can be adjusted to bring data back from your copy tables, such as when you add a new zone.

Code:
INSERT INTO grid SELECT * FROM grid_copy WHERE zoneid = 58;
INSERT INTO grid_entries SELECT * FROM grid_entries_copy where zoneid = 58;
INSERT INTO doors SELECT * FROM doors_copy where zone = "crushbone";
Note that this may or may not be appropriate if you have customisations in any of these tables. Someone could also fairly argue that these tables do not need to be backed up unless they are custom, but I prefer doing /complete/ back ups.

If anyone else has any tips or tricks for this kind of thing please share! I am still learning myself
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

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


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3