EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Support::Windows Servers (https://www.eqemulator.org/forums/forumdisplay.php?f=587)
-   -   Multiple Databases (https://www.eqemulator.org/forums/showthread.php?t=41997)

kris1 07-27-2018 09:03 AM

Multiple Databases
 
I have a Heidi question if anyone could be so kind...

I have my server running, and I play on it. But I want to start modifying a DB for how i want the server to be in the future.

Is there a way for me to have a separate DB, like a test server, so you don't screw up the one your playing on?

Is there a way to restart your server with the "test DB" to see how you are doing, without losing your old DB that you are playing on?

And lastly, is there a way to add only parts of your test DB without completely replacing everything?

Every time i try, I end up losing my characters and have to use a back up to restore.

Thanks in advance.

John C 07-27-2018 09:30 AM

I have never tried it but theorectically, you should be able to do this. The first step would be to create your new test database. Just dump your current DB, and use that to load your new DB using a different name. The database name is specified in the json config file, so you can change which database the game loads whenever you spin up the server. You could then dump and copy tables as desired, though obviously you have to be careful not to get things out of sync. Personally, I would just migrate to the new database once it is ready rather than trying to do piecemeal copies.

kris1 07-27-2018 09:38 AM

Ok...that all seems to make sense...

But when I convert over to the new database, won't my characters be lost? or reset?

John C 07-27-2018 10:24 AM

When you initially duplicate the DB, your character will be copied over. You are right though that you have essentially created a separate server and any progress you make thereafter on either server will not show up on the other. That's just the reality of having two databases. You could alter the code to always point to one set of character data, but that would be somewhat complex and could introduce new issues. Or you can continue to dump and copy character data between instances, though obviously that is manually burdensome. But those are your options if you want two databases.

kris1 07-27-2018 11:11 AM

thanks, bud

HuginnNavarita 07-27-2018 02:12 PM

what I do is I make a backup of the table that I want to mess with, when I make that backup I add this function....

Quote:

DROP TABLE IF EXISTS `rule_values`;
then the .SQL file will look like this...


Quote:

DROP TABLE IF EXISTS `rule_values`;
CREATE TABLE `rule_values` (
`ruleset_id` tinyint(3) UNSIGNED NOT NULL DEFAULT '0',
`rule_name` varchar(64) NOT NULL DEFAULT '',
`rule_value` varchar(30) NOT NULL DEFAULT '',
`notes` text
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
(after this statment the SQL inserts all the data)

this means that if you fuck anything up, all you need todo is import this SQL file that contains everything as it was before the fuckup, the DROP TABLE IF EXISTS means just that, it will kill the rule_values table and replace it with this one.

I find this useful for edit of things you would do often, for example the table inventory contains everything that you have in your bags and on you by ID of items, charID is the character, so I would take craploads of food and water from one character and copy paste it to all others, when done, just upload the SQL file and bing-bara-boom clone effect.

Uleat 07-27-2018 05:12 PM

Just remember that you can't run two servers at the same time from the same address (computer, LAN, WAN.)

There's no problem editing the database not in use.


I actually have two server installs on my system and each config does point to their respective database.

This allows me to run both a 'normal' and 'test' environment so there's no issues with server binary and database schema compatibility.

HuginnNavarita 07-27-2018 05:17 PM

Oohhh that is a great idea !

I'ma first timer also, so drinking in all the good ideas ��


All times are GMT -4. The time now is 12:04 AM.

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