Kodi Community Forum

Full Version: Help Moving SQL Database to New Computer
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Before I screw this up again, can someone tell me how to move a mysql database from one computer to another? I tried running a mysqldump on the old database then importing it into the new, freshly installed, sql database but that complained because there was a problem with the user kodi. I figured it was because I hadn't already created that user, but before I go any further, I need help from someone who knows what they are doing - as opposed to me who knows nothing about sql. I have setup the sql database on the new computer as per this page - http://kodi.wiki/view/MySQL/Setting_up_MySQL - and that is where I have stopped.
Quote:because there was a problem with the user kodi
In the land of computers, there is never just 'a problem'. There is usually a pretty good error description when something goes wrong during a mysql import. So if you could find that error description concerning the 'kodi' user, it would help a lot.

Also, what computer types are involved? Both are regular Windows computers?
Setting up the mysql user 'kodi' is best either done manually before doing the mysql import, or include the 'mysql' table in the mysqldump command. MySQL users are not included in the default mysqldump command.
I'm sorry. Both computers are Ubuntu Linux. The old computer is 10.04 and the new computer is 16.04. When doing the dump, I used this - http://www.thegeekstuff.com/2008/09/back...-mysqldump - as a guide. I do not remember the exact complaint/error it gave. I know I should have wrote that down - I tell people that all the time when I work on their computers, but you know... do as I say not as I do...

So, like I said, I've already manually set up the kodi user as per the wiki. Should I go ahead and see if the import will take now?
Okay then, Linux. You're in luck because the SQL language doesn't change that much over time. So that tutorial is okay.

You should need only 3 SQL queries for the backup dumps.

Code:
# KODI MYSQL DATABASE DUMP
mysqldump -u root -p<pw> mysql user  > mysql_users_dump.sql

mysqldump -u root -p<pw> MyVideos107 > kodi_video_dump.sql
mysqldump -u root -p<pw> MyMusic60   > kodi_music_dump.sql
or combined:
mysqldump -u root -p<pw> --databases MyVideos107 MyMusic60 > kodi_mysql_dump.sql
Insert your own user and password where applicable. Remove any users from the users dump if necessary.

Restoring goes via:
Code:
mysql -u root -p<pw> < mysql_users_dump.sql

mysql -u root -p<pw> < kodi_video_dump.sql
mysql -u root -p<pw> < kodi_music_dump.sql
Of course there are also tools like MySQL Workbench if you want to use a GUI.
If you already added the mysql user 'kodi', then you only need to do the video and music database queries.
I will try this this weekend. I'll let you know how it goes. Thank you!
I did as you directed. For some reason, I have to specify sudo to run the msyql commands on the new computer, although I do not on the old one. Maybe I set a root password there and I didn't here? Anyway... Kodi doesn't see the database. I was kind of confused about the bind command - do I bind it to the server that is running mysql or to the system that is accessing the database? I tried bind=192.168.1.15 - the server running mysql - first and when thath didn't work I tried 0.0.0.0. Kodi still doesn't see the database. I know that kodi can see that computer because it is serving the media files over the network and kodi is stay able to play playlists for songs located on that server....

What did I do wrong?
I have triple checked everything and I cannot figure this out. I even hooked the old server back up just to make sure and sure enough, kodi still sees that database. On the new server, there is a user kodi with kodi as password, the hostname and ip addresses are both the same as the old system, I imported the video and music databases, I can see them when logged into the server as kodi... but kodi will NOT see it!!!!!

/etc/mysql/my.cnf on the old system is identical to /etc/mysql/mysql.conf.d/mysqld.cnf on the new system, including the bind address being commented out in both. Is there another config file I'm missing maybe?

What as I missing!?
Are you using a hostname or an IP address to connect to your new database server?
In case of an IP address, does your new server have the same or a different IP address?

As always, supply the latest debug enabled kodi.log, as errors will appear in case Kodi cannot properly connect to a database.
I'm using the IP address, which is static and identical to that of the old server.

This is the advancedsettings.xml file: http://www.RobotsAndComputers.com/temp/a...ttings.xml

Here is the debug log: http://www.RobotsAndComputers.com/temp/kodi.log

It won't let me post these as [ c o d e ] portions so... sorry.
Hi... so, just a quick, polite nudge Smile

I think this think IS seeing the sql server, it's just not reading the database. I've been playing videos through Videos>Files and noticed that it is marking the ones I've watched. So I went to my other Kodi player and sure enough, under Videos>Files, it had marked the same ones that I'd watched on the other other Kodi. So it is using a database, just not the correct one!
Did you update kodi at some point?
Not since I first began using the shared database setup.
I am looking at the MySQL server and there are two entries each for Movies and Music - MyMusic56 and MyMusic60 and MyVideos107 and MyVideos99 - if that helps any.
And which one has your data?
Looks like MyVideos107 and MyMusic60.
Pages: 1 2