Guest - Testers are needed for the reworked CDateTime core component. See... https://forum.kodi.tv/showthread.php?tid=378981 (September 29) x
Solved How to adjust file locations in database?
#1
I'm running Mariadb as a central kodi db for my home. I've recently found a need to change the folder name of my movies.

/snapraid/pool/videos

to

/snapraid/pool/video

I have no idea how to work sql in the slightest. I know how to migrate a mythtv backend with the UPDATE command but I don't know how to list tables, or what they are called for Kodi.

Is there a simple way to do this? I have backups so a bit of trial and error won't kill me. I just don't even know where to start, or how to find the proper field to update.

*EDIT* A few minutes after this post the idea of backups occured to me. I dumped my databases to a non compressed file and just used sed. Then reloaded from that file. Working fine, took less than 2 minutes total. Posting solution. Use mysqldump to dump to file. Can find that info on Arch wiki.

Code:
sed -i 's/pool\/videos/pool\/video/g' $SQLDUMP

Followed by import to mariadb / mysql

Code:
cat $SQLDUMP | sudo mysql

I restarted the service just to be sure.
Reply
#2
Thread moved to OS independent.

Replacing words in a text file can be done in any decent editor, although 'sed' can be pretty handy for those that know how to use it.

Doing a MySQL/MariaDB export is usually done with mysqldump
Code:
mysqldump MyVideos116 --add-drop-database > dumpfile.sql

Restoring is done via
Code:
mysql -u kodi -p MyVideos116 < dumpfile.sql
Reply

Logout Mark Read Team Forum Stats Members Help
How to adjust file locations in database?0