Karmafied

DB xfer possible?

7 posts in this topic

Before updating to Clementine, I saved a copy of my DB (I think) by using HeidiSQL and choosing 'Export DB as SQL'.

Once I updated, I realize that I have NO IDEA how to bring all the items from our old server (Territories, Containers, Construction, etc.) in the database.

Is this possible?

Share this post


Link to post
Share on other sites

Posted (edited)

this is what changed from previous .9.4 to .9.4.1
ALTER TABLE `player` CHANGE `loaded_magazines` `loaded_magazines` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL;
ALTER TABLE `player` CHANGE `handgun_items` `handgun_items` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL;
ALTER TABLE `player` CHANGE `primary_weapon_items` `primary_weapon_items` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL;
ALTER TABLE `player` CHANGE `secondary_weapon_items` `secondary_weapon_items` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL;

 

Alter your existing db to reflect those changes and reimport and all should be well.

Edited by wasti

Share this post


Link to post
Share on other sites
Advertisement

Posted (edited)

Honestly not sure, I think that it would be pretty safe to import only the account table to keep player stats/money/ect. The only visable difference between the 2 default db's from .9.3 to current is:

  PRIMARY KEY (`uid`),
  KEY `clan_id` (`clan_id`),
  CONSTRAINT `account_ibfk_1` FOREIGN KEY (`clan_id`) REFERENCES `clan` (`id`) ON DELETE SET NULL

for this table account, simply import your old table and then run the above as a query and it should work? otherwise just import and manually set your primary key and key clan_id and then run the constraint as a query.

 

 

As far as the custom player buildings, this has changed as well:

`maintained_at` datetime DEFAULT NULL,

`territory_id` int(11) UNSIGNED DEFAULT NULL,

`last_updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP

 

I suppose you could import your old construction table, and then add those columns, but I'm not sure what side effects you would experience by having the existing rows from your old db contain null for maintained_at and territory_id. Really, only one way to find out (do it :P )

Edited by wasti

Share this post


Link to post
Share on other sites

Okay so I am making progress by adding rows and fake information to the old tables before i import to the new DB.

Here is my latest error, which refers to your comment (PRIMARY KEY, etc.) which I don't understand. How can I fix this one? 

 

 

 

 

error.png

Share this post


Link to post
Share on other sites

Posted (edited)

select table (`account`),

  PRIMARY KEY (`uid`),
  KEY `clan_id` (`clan_id`),
  CONSTRAINT `account_ibfk_1` FOREIGN KEY (`clan_id`) REFERENCES `clan` (`id`) ON DELETE SET NULL

 

 

it looks like the query is running on your construction table.

 

when you get errors like that, always revert back to your original backup and then work off of a copy of that original backup. back ups upon back ups, INCEPTION!!!!

 

 

also, if your not already:

https://www.mysql.com/products/workbench/

Edited by wasti

Share this post


Link to post
Share on other sites

 Getting there.  I downloaded Workbench per your recommendation. Learning it as I go.  I don't know ANYTHING about SQL to begin with, so, not like I have anything to lose! :)

So Im sorry for the confusion, but, should I be doing anything with this information you mentioned?

select table (`account`),

  PRIMARY KEY (`uid`),
  KEY `clan_id` (`clan_id`),
  CONSTRAINT `account_ibfk_1` FOREIGN KEY (`clan_id`) REFERENCES `clan` (`id`) ON DELETE SET NULL

 

I selected the 'account' table and didn't see ANY of the other items lol.

Share this post


Link to post
Share on other sites
Advertisement

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.