Kodi Community Forum

Full Version: How to adjust file locations in database?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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.
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