Page 1 of 1

Change upload from database to DISK

Posted: 15 Jan 2008, 12:43
by mpa
Hello,

I'm using version 1.0.6
upload method is 'DATABASE'.

I would like to change my attachment upload from DATABASE to DISK method. Because I want to minimize my Database space and for backup reasons.
But if I change this, am I still be able to access my already uploaded attachments?

Better is to move the attachments in the DATABASE to DISK. But how do I do this?
I tried to use the system utilities option 'Move Attachments to DISK', but this gives me an Error: "Failure: Upload Method is not DISK".

Does anyone has a solution for me?

Thanks in advance.

Marnix

Re: Change upload from database to DISK

Posted: 21 Jan 2008, 15:04
by Dom75
HI,
you need to first set in your config_inc file the storage method with this :
$g_file_upload_method = DISK;

And the run the script utility


Regards

Dom75

Re: Change upload from database to DISK

Posted: 21 Jan 2008, 17:45
by Kirill
mpa wrote:I tried to use the system utilities option 'Move Attachments to DISK', but this gives me an Error: "Failure: Upload Method is not DISK".
Marnix
Sorry. How You do this? Where you find this?

Re: Change upload from database to DISK

Posted: 22 Jan 2008, 07:05
by Dom75
hi,
just type /admin after the install path of the mantis installation then go to system utilities

regards

Dom75

Re: Change upload from database to DISK

Posted: 22 Jan 2008, 07:52
by Kirill
Thank's very much. I delete this folder :wink:

Re: Change upload from database to DISK

Posted: 22 Jan 2008, 13:47
by Dom75
That's why it's better to rename it and not to delete it :(

Re: Change upload from database to DISK

Posted: 22 Jan 2008, 14:02
by Kirill
rename something like this 2Wj69rbU ? :lol:
At me simple delete. I can in averytime restore this folder ;)

Re: Change upload from database to DISK

Posted: 23 Jan 2008, 01:07
by kuhsay
Is one method for storing uploads better than the other for any reason? What are the pros and cons of each approach?

Re: Change upload from database to DISK

Posted: 26 Jan 2008, 09:35
by vboctor
It is recommended to use the DISK for the following reasons:

1. The database doesn't get bloated with attachments, hence, it makes it typically easier to take a backup of the database.
2. In some hosting companies, you have much more disk space than database space.
3. Tools that allow remote administration with the database (e.g. phpMyAdmin) are not tuned to work with big size databases.

Re: Change upload from database to DISK

Posted: 02 Feb 2008, 17:49
by mpa
Thank you all for your help, but still having some issues.......

It seems to be that I have 2688 attachments (not records) with about approximately about 200 MB, which are all situated in de database.
I have done some testing with moving the attachments to DISK with a smaller database which was doing fine.
But when I did the same procedure with the big database I got the following error:
"Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 4065281 bytes) in /www/htdocs/admin/move_db2disk.php on line 90"

In this stage, only about 1800 attachments have been saved to the DISK. So I lost a couple....hmmm. (bug maybe?)

Thank god I made a backup.

But how am I dealing with this issue. I have to move all the attachments from the DATABASE to DISK.
So far, I'm stuck.

Hopefully someone can help me out???

Thank you in advance for your help,

Marnix

Re: Change upload from database to DISK

Posted: 03 Feb 2008, 11:16
by mpa
Maybe it's better to perform a SQL statement directly from phpmyadmin to move the files to DISK.

Does anyone knows which SQL statement I should use?