Example: you have 2 tv show folders and you want to merge them.
Ex: you have 10 tv shows here /VD/TvShows and 3 tv shows here /VD/TvShows1. you would like to move them all to /VD/TvShows (assuming no conflicts), so that in the end /VD/TvShows has 13 tv shows.

Format of the sqlite search and replace command:

update table_name set 
content_url = replace(content_url, 'band%20albums', 'bands/studio%20albums')
where
content_url like '%nazgulled/music/band_20albums/%';

Sidenote: another method you might be thinking of is to get the SQL ascii text from the sickrage.db file and use sed (search and replace) to replace all occurrences of /VD/TvShows1 with /VD/TvShows & then use that new SQL ascii to make a new sickrage.db, THIS WILL NOT WORK sqlite sickrage.db .dump > tmp.sql; sed -i tmp.sql ‘s|/VD/TvShows1|/VD/TvShows1/g’; sqlite sickrage1.db < tmp.sql; cp sickrage.db sickrage.db-backup; cp sickrage1.db sickrage.db; this method will NOT WORK and sickrage will not launch afterwards (even though the database is totally fine – well it seems totally fine, but other aspects/properties of it are lost & when you launch sickrage it will complain things are missing like encryption or something. whatever. just use the steps below). HOWEVER METHOD BELOW WORKED.

STEPS

step 1. close out of sickrage

# if you have systemd
systemctl stop sickrage
# if you have sysvinit system
/etc/init.d/sickrage stop
# or just kill it

step 2. make a backup of your sickrage setup and your videos

step 3. move the TvShows

ex:

mv /VD/TvShows1/* /VD/TvShows1/

step 4. optional make backup of sickrage db. make another quick backup just in case (its redundant with step2, but depending on how you did step2, this might be faster to reach if you mess up)

cp sickrage.db sickrage-backup.db

step 5. load up sickrage

sqlite3 sickrage.db

step 6: update tv_shows

update tv_shows set 
location = replace(location, '/VD/TvShows1', '/VD/TvShows')
where
location like '%/VD/TvShows1%';

details: located all of the locations columns in tv_shows tables that have /VD/TvShows1 somewhere in the value (update tv_shows … location like ‘%/VD/TvShows1%’; The % allow the value /VD/TvShows1 to be somewhere in the value. We could remove the first % because the strings starts with /VD/TvShows1, but we dont as its optional & this way example can apply to more people) and set the value of the location column to whatever the value of location is if you were to replace any occurance of /VD/TvShows1 anywhere in the string with /VD/TvShows.

step 7: update tv_episodes

update tv_episodes set 
location = replace(location, '/VD/TvShows1', '/VD/TvShows')
where
location like '%/VD/TvShows1%';

Note: the other tables dont have “location” or any paths.

Note: also other .db files like cache.db and failed.db and cache/rss/*db dont have anything related to the location of tv_shows and episodes (at least they didnt on the latest version on 2016-04-28)

step 8: you may also need to change your config.ini or from General Config -> Show Root Directories

Leave a Reply

Your email address will not be published. Required fields are marked *