How to transfer media files from one installation to another?

Is it possible to transfer the media files from one installation to another?

I can rsync 100GB of media files from one server to another - no problem. But, of course, they will not be in the media library.

Would this require the transfer of a database table as well?

Many thanks in advance.

Yes, you just have to keep the same paths for the transferred medias, then export/import the database, this way everything will be in the library, like in your previous installation.

1 Like

Thanks @Leekid - but I cannot transfer the database over as I posted here:

https://discourse.libretime.org/t/any-way-to-transfer-lt-to-new-domain/876

I am moving LT to a new server and new domain.

So is it possible to just transfer the database table related to the music files?

This is probably possible but it would take either some trial and error. It might be feasible just by exporting from your old instance and importing the cc_files into your new instance (as long as the files are in the same place).

I did the opposite where I copied the entire database and then tried to delete all of the files but found it extremely hard to pull off because of the way that LibreTime cascades the deletion of tracks to removing them from all past shows.

If you are just taking the cc_files table I suspect it would be easier but you’d need to test it. I’d setup the new instance and then rsync the files - take a backup of the database (for easy restore if it fails) and then try importing just the cc_files table and see if it populates your library correctly. There maybe other tables that are important to have but off the top of my head this should contain the brunt of the track data.

I just did what you are trying to do—a couple of weeks ago.

Yes, keep the file path the same, use symlinks or whatever you have to and be sure to get the permissions and owner fixed.

The key is to open a backup of the database, the raw sql from the original machine, find and replace all instances of the old url to the new url and find/replace all instances of the icecast password to your new machine.

Then, on the new machine, drop the airtime db, create a new empty airtime db and then restore your edited DB to the new empty one. Open your admin panel from the new url and it should work. I’ve done this a number of times in the past and it seemed to work fine.

It keeps all references to your media content, playlists, webstreams and programming. If you don’t want the playlists and programming, it’s probably faster to just do the DB import and delete what you don’t want later.