View Full Version : Changing File Names in Database to match new file type.
March 31st, 2008, 03:25 PM
I am trying to achieve a mass update on a specific category. What i'm doing is changing the entire contents of a category files from .wmv files to .flv in PP. I know i can do that in the database one by one but its going to be pretty strenuous exercise with over 500 videos. I have tried on one video and it works. The reason why I am doing this is because I want to still maintain the view count and comments that go with the old .wmv videos to carry over to the new .flv files in their place. From my simple testing, i guess the dimensions and file size do not affect this changes ---unless someone potentially thinks its a problem.
I am reaching out to anyone out there who know what lines i can execute in the database to make these changes en mass. I am keeping the same files names to make it easier.. All that is changing is just the extensions of the files. Thanks
March 31st, 2008, 03:31 PM
Well I am confused by the logic of the discussion?
To be able to change a video to a new format you need to hit editphoto and reupload the video in the new format and this will update the record so what am I missing.
There is no way to mass change a video as they all need to be reuploaded in a new format via the scripts to update the database one at a time.
March 31st, 2008, 04:02 PM
Well, I have tried ona few now and they work. This is my logic -
1. Upload the .flv file to the same category in the gallery.
2. If you maintained the same name of the duplicate .wmv file you are exchanging, all thats needed is to tell the database that the new file is .flv file and not the old .wmv.
3. If you go to the database in the photos table, lookup the items of the category that you are working in, and go to line called bigimage and change the value extension from .wmv to .flv, (ie. Video Mix 10.wmv to Video Mix 10.flv) - then save.
4. If then you try to play the video is the gallery, it will load the .flv video and keep all the data that was on the old .wmv file.
5. This works but its alot of work- im am just wondering if theres an easier way of changing all the values in that particular category to have an extension of .flv by executing a line in the database to do the same thing that I amdoing manually.
does that make sense now?
March 31st, 2008, 04:41 PM
Well if your going to mass upload new video files in the correct format possible to use this query but you use at your own risk and make sure you have database backups as its a powerful query
UPDATE pp_photos SET bigimage = REPLACE(bigimage, '.wmv','.flv') WHERE cat=502
You need to replace with your cat id number where noted by my example of 502
March 31st, 2008, 05:07 PM
I will try that - you are awesome Chuck...I will post here how it went. Thanks.
March 31st, 2008, 05:12 PM
Just make sure as noted to backup things before you do it as this is a powerful query and you use this at your own risk.
April 1st, 2008, 11:26 AM
works like a charm Chuck (oh...that rhymes!) ..you are great and thanks much!!
April 1st, 2008, 11:48 AM
enjoy have a good day
vBulletin® v3.8.1, Copyright ©2000-2014, Jelsoft Enterprises Ltd.