How do I move the existing pictures stored in database to file system, after changing the setting Pictures to be stored to File System?

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
12 years ago
I uploaded many pictures before realizing they are stored in database by default in the [dbo].[Picture] table, and now I just changed the setting "Pictures to be stored on" from database to File System.  But how do I move the existing pictures stored in database to file system after this setting change?

Thank you so much,
Ray.
12 years ago
They're automatically moved to the file system when you change the "Pictures to be stored on" setting
12 years ago
a.m. wrote:
They're automatically moved to the file system when you change the "Pictures to be stored on" setting


Thank you Andrei!  

I haven't seen the database size reduced yet on my web host, do I need to do anything to my database after the system moved my picutres to file system?  And, does the system move only the pictures or it also moves files like pdf?

Thanks a bunch!
Ray.
12 years ago
Try executing the following SQL statement over your database:
DBCC SHRINKDATABASE('your_db_name_here')

It moved only pictures.
12 years ago
Thank you so much Andrei!  That did shrink my database down!  One thing I found is that the [dbo].[Picture] table still has all the rows of the pictures and when I add new product it also inserted rows in this table, so did the shrink operation take out the [PictureBinary] column's data?  And, how do I make pdfs store on file system also?  Thanks -ray.
12 years ago
All binary data is stored on the file system, only picture metadata (filename, extensions, etc) is stored on the database. So that's OK.

ray247 wrote:
And, how do I make pdfs store on file system also?

Actually all generated PDF files are already stored on the file system
12 years ago
I forgot to ask is there a way to shrink the log file of the database, I noticed the SHRINKDATABASE only shrank the data file of the database?
12 years ago
My webhost helped shrink the log file down and they set my Recovery Model to Simple and Auto Shrink to True.

Thanks,
Ray.
12 years ago
hi, our site has just started to give the error message

Could not allocate space for object 'dbo.Nop_Log'.'PK_Nop_Log' in database 'DATABASE' because the 'PRIMARY' filegroup is full. Create disk space by deleting unneeded files, dropping objects in the filegroup, adding additional files to the filegroup, or setting autogrowth on for existing files in the filegroup.

We have removed all the message q etc and there still inst enough room, i wondered if it was because all the images are stored in the database and would like to move them to a file location, however, when i amend the store images in database to false in all settings all the existing images disappear off the pages.  we are using 1.8.  

I have no experiance playing around with databases so am unsure what to do next.

Dan
11 years ago
a.m. wrote:
They're automatically moved to the file system when you change the "Pictures to be stored on" setting


I am in version 1.8 right now and can't upgrade, so I set the setting to "false" and I go back to the store and images don't show up!

Is there something else I need to do? Is there a table I need to update?

BTW: I can change setting back to "true" and I see the images again in the store. Any ideas? thanks in advance!
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.