Log in

View Full Version : how can i free attachment field in database


booktoweb
09-15-2008, 12:13 AM
how can i free attachment field in database

when i want to move attachment from file to database
i stopped it after its finished
it working now from files
but i want to free attachment field ( its size now 199 mb )

Dismounted
09-15-2008, 05:40 AM
Where you moving from the file system to the database, or the other way around - you aren't really clear.

Opserty
09-15-2008, 07:39 AM
I think the attachments have just been moved from the database to the file system and now they want to clear the attachments table.

booktoweb
09-16-2008, 09:59 AM
i moved attachment to file system
but its table in database still big

i want to clear it from files data

Dismounted
09-16-2008, 12:23 PM
Look in the attachment table - is the field "filedata" (or something like that) empty for every row?

booktoweb
09-20-2008, 09:33 AM
no its not empty i many tables

Lynne
09-20-2008, 02:27 PM
You moved the attachments from the database to the file system and all is working just fine now (right?) but you are wanting to make the attachment table smaller after the move (did you make the move in order to make the database smaller?)?

After the move, did you run Optimize on the attachment table? That will make the size smaller. (admin cp > maintenance > repair/optimize tables > select attachment > Continue)

booktoweb
09-20-2008, 04:10 PM
i tried ti moving attachment to database
but after moving 3000 files its stop and database error arrived to me
so i let it in file system ( its working fine now from file system )

but attachment table after this contains many files ( that moved before error occurred )

did you run Optimize on the attachment table? That will make the size smaller. (admin cp > maintenance > repair/optimize tables > select attachment > Continue)


i do this from admincp
and from cpanel

but its size still 199.33 mb

Lynne
09-20-2008, 05:19 PM
It would have been helpful to see what the database error was. Does you host have a limit on how much data is allowed in the database? After you got the error, did you try again?

booktoweb
09-20-2008, 06:37 PM
i have 3.5 gb of database
i don't wont to transfer it to database
i just want to clear data that merged with database

there aren't any tools to do this

after transfer attachments from database to file system
what's query happen to clear database from old data ?

Lynne
09-20-2008, 07:17 PM
After transferring attachments from the database to the file system, you run Optimize/Repair on the Attachment table. The size of the Attachment table will decrease quite a bit.

Marco van Herwaarden
09-23-2008, 09:40 AM
If you never finalised the move from file system to database, then you can clear out the attachments by running the following query:

UPDATE attachment SET filedata = "";
PS Always create a backup before running a manual query.

Once you have empited the data you can run an optimise on the table.