Moving data from built in server to dedicated one

General discussion about Life is Feudal MMO and Life is Feudal: Your Own, The main section and backbone of the forums.

NightlinerSGS
 
Posts: 4
Joined: 05 Oct 2014, 14:19

Moving data from built in server to dedicated one

Post by NightlinerSGS » 06 Oct 2014, 10:20

I've been playing LiF on the built-in server, mostly alone. Recently some friends joined in when I was playing, and we built a lot of things. Now that they play regulary, I decided to set up a dedicated server on a spare computer I have around. I set it up with the guide found on steam and it works, but everything we made isn't there obviously.

Is there a way to move the saved data from my client-server to the dedicated one? We'd really like to continue playing with what we have, and I want them to be able to play when I'm not online.

Thanks!


Snapshot
 
Posts: 29
Joined: 21 Sep 2014, 19:50

Re: Moving data from built in server to dedicated one

Post by Snapshot » 06 Oct 2014, 10:23

How have you migrated the server? Have you saved the database (including procedures etc) and created the new DB out of this export?
I haven't any expirience but I will come to the same point at some point in time :)


NightlinerSGS
 
Posts: 4
Joined: 05 Oct 2014, 14:19

Re: Moving data from built in server to dedicated one

Post by NightlinerSGS » 06 Oct 2014, 10:36

I haven't migrated anything yet since I don't know how to. That's what I'm asking, I don't know much about SQL Servers and Databases, I only took the first steps of setting the thing up with the guide on Steam.


Snapshot
 
Posts: 29
Joined: 21 Sep 2014, 19:50

Re: Moving data from built in server to dedicated one

Post by Snapshot » 06 Oct 2014, 10:51

NightlinerSGS wrote:I haven't migrated anything yet since I don't know how to. That's what I'm asking, I don't know much about SQL Servers and Databases, I only took the first steps of setting the thing up with the guide on Steam.


Sorry, then I heavent read your post properly! Shame on me :oops:

Alright, I tried to write the steps in here but it's quite difficult. I will write a short manual and then post it here :)


Snapshot
 
Posts: 29
Joined: 21 Sep 2014, 19:50

Re: Moving data from built in server to dedicated one

Post by Snapshot » 06 Oct 2014, 11:11

How to migrate a server (not tried):

Database migration
1) Connect to the old database server
Image
Image

2) Export the old existing lif_1 database
Image
Image

3) Create a new Database out of the exported SQL (copy & past text out of the file | needs to be done at the top parent entry on the left side: Unnamed)
Image
4) Check that "Send in one go" is set and run the query
Image

5) Check the output of the query. Should look like:
Code: Select all
/* Affected rows: 141'060  Found rows: 0  Warnings: 0  Duration for 395 queries: 0.016 sec. */



Let me know if this is working or if you are facing troubles


NightlinerSGS
 
Posts: 4
Joined: 05 Oct 2014, 14:19

Re: Moving data from built in server to dedicated one

Post by NightlinerSGS » 06 Oct 2014, 12:13

Thanks for the guide, but I tried it and it didn't work. And although my understanding is limited, I think I know why it can't work.

I'm connecting to the database I set up when I installed HeidiSQL to run my dedicated server on. But I want to copy files to it, not from it. The Problem is that I can't find or connect to the database LiF sets up when it starts its internal server, that's where the data is stored.

Edit: Actually, hang on. There are two sql files in LiFs server directory (Steam\SteamApps\common\Life is Feudal Your Own\server\sql), those might be worth checking out.

Edit2: So the question we need to ask is: Where the heck does the LiF internal server store its data? >.<

Edit3: Found it! Steam\SteamApps\common\Life is Feudal Your Own\daemon\mariadb\data\lif_1
Now there is just the issue of connecting to that database, getting the data from it and then paste it into the database on the dedicated server... I guess I'll try some things. Will be back shortly :D


Snapshot
 
Posts: 29
Joined: 21 Sep 2014, 19:50

Re: Moving data from built in server to dedicated one

Post by Snapshot » 06 Oct 2014, 15:33

The connection to the database is done within the config_local.cs file in the root folder... or do you mean another connection?


NightlinerSGS
 
Posts: 4
Joined: 05 Oct 2014, 14:19

Re: Moving data from built in server to dedicated one

Post by NightlinerSGS » 07 Oct 2014, 11:58

I searched around yesterday and today but didn't find a solution yet. The good thing is that I understand more and more about SQL ;)

There are currently two databases named lif_1 on my computer.

One is located in \Program Files\MariaDB 5.5\data. This is the one that gets created by the dedicated server when you set it up using the steam guide.

The other one is in \Steam\SteamApps\common\Life is Feudal Your Own\daemon\mariadb\data. This is the one created when you use Create a World from the games main menu.

I'm trying to connect to database 2 with HeidiSQL to make a proper database dump which I'd then import into database 1. However, I'm unable to connect database 2 in HeidiSQL as it doesn't show up there. From the contents inside \Life is Feudal Your Own\daemon I suspect LiF launches its own SQL server when creating a game server, but I haven't figured out how to connect to that SQL server and its database yet.

Also, the local server lacks the config_local.cs file, which would contain the connection info... :(

I also tried to simply copy the contents of lif_1 to the other lif_1 folder. I learned that SQL doesn't work that way... it refused to start up, saying the files were corrupted. My attempts to fix that made it worse and I had to reinstall MariaDB from scratch.


Kjadamek
 
Posts: 1
Joined: 10 Jan 2015, 20:58

Re: Moving data from built in server to dedicated one

Post by Kjadamek » 13 Jan 2015, 15:46

So have you been able to connect to the client side database? This is pretty much where I am at with this as well.


Dzitars
 
Posts: 1
Joined: 11 Jun 2015, 01:50

Re: Moving data from built in server to dedicated one

Post by Dzitars » 11 Jun 2015, 01:53

Anyone find this out yet? I've been doing all of my playing on a local server until I'm able to switch internet providers because my current one won't let me do any hosting. But I can't find a way to edit or move the data in the local database. I see all of the FRM and IDB files but I'm unsure of how to actually export that into actual sql code to move/edit.


Miscni
 
Posts: 3
Joined: 24 Jun 2015, 22:17

Re: Moving data from built in server to dedicated one

Post by Miscni » 25 Jun 2015, 03:58

I may have an idea for that.


Thamal
 
Posts: 1
Joined: 22 Sep 2014, 13:02

Re: Moving data from built in server to dedicated one

Post by Thamal » 18 Sep 2016, 12:09

Even though this thread is older then a year now I do want to tell you a way to migrate from local to dedicated server.

Here is a Website that describes how you can recover DB Tables form the *.frm / *.ibd files http://www.voxteneo.com/restoring-tables-mysql-database-frm-ibd-files-available/

The steps I have done:
  • Create empty dedicated server.
  • Using HeidiSQL connect to Dedicated Server DB
  • Save in a txt file all Create Tables that have Constraints and remove the Constraints from the tables.
  • User command
    Code: Select all
    ALTER TABLE `table_name` DISCARD TABLESPACE;
    to remove all the connection to the .ibd file / File will be deleted automatically.
  • When all .idb files are removed you can copy the files from your local server to the dedicated mysql folder.
  • User command
    Code: Select all
    ALTER TABLE `table_name` IMPORT TABLESPACE;
    to link the new table files.
  • Restore Constraints form the Create Tables that where saved at the beginning.

* Use this info at your own risk
If something is unclear I can try to explain further.

Kind regards.


Agluk
True Believer
 
Posts: 2
Joined: 24 Dec 2015, 02:41

Re: Moving data from built in server to dedicated one

Post by Agluk » 03 Jan 2017, 06:09

Thamal wrote:Even though this thread is older then a year now I do want to tell you a way to migrate from local to dedicated server.

Here is a Website that describes how you can recover DB Tables form the *.frm / *.ibd files http://www.voxteneo.com/restoring-tables-mysql-database-frm-ibd-files-available/

The steps I have done:
  • Create empty dedicated server.
  • Using HeidiSQL connect to Dedicated Server DB
  • Save in a txt file all Create Tables that have Constraints and remove the Constraints from the tables.
  • User command
    Code: Select all
    ALTER TABLE `table_name` DISCARD TABLESPACE;
    to remove all the connection to the .ibd file / File will be deleted automatically.
  • When all .idb files are removed you can copy the files from your local server to the dedicated mysql folder.
  • User command
    Code: Select all
    ALTER TABLE `table_name` IMPORT TABLESPACE;
    to link the new table files.
  • Restore Constraints form the Create Tables that where saved at the beginning.

* Use this info at your own risk
If something is unclear I can try to explain further.

Kind regards.

If not too much trouble, you can make a step by step guide?
Thank you.


Tholld
 
Posts: 20
Joined: 19 Sep 2016, 08:33

Re: Moving data from built in server to dedicated one

Post by Tholld » 23 Jul 2017, 08:33

More easy way to copy your local world to a dedicated server:

Dump your local world like described here:http://steamcommunity.com/sharedfiles/filedetails/?id=632278721 until the point "Database SQL Export". Now you have your World in a .sql-File.

IMPORTANT: You should start your local server first (NOT the client!), then mount the database in Heidi SQL and export the local database in a SQL File.

When you have your SQL-File, setup your dedicated server like described here: http://lifeisfeudal.com/forum/server-setup-2016-t18814/#p75846 with one exception:
Don't copy and paste the new.sql file. Use your extracted .sql file instead!

Return to General Discussion