Change upload from database to DISK

Get help from other users here.

Moderators: Contributor, Developer

Post Reply
mpa
Posts: 17
Joined: Jan 15, 2008 7:34 am

Change upload from database to DISK

Post by mpa » Jan 15, 2008 7:43 am

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

Dom75
Posts: 20
Joined: Mar 28, 2006 8:47 am
Location: France
Contact:

Re: Change upload from database to DISK

Post by Dom75 » Jan 21, 2008 10:04 am

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

Kirill
Posts: 577
Joined: Nov 25, 2007 3:05 am
Location: Kaliningrad, RF
Contact:

Re: Change upload from database to DISK

Post by Kirill » Jan 21, 2008 12:45 pm

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?

Dom75
Posts: 20
Joined: Mar 28, 2006 8:47 am
Location: France
Contact:

Re: Change upload from database to DISK

Post by Dom75 » Jan 22, 2008 2:05 am

hi,
just type /admin after the install path of the mantis installation then go to system utilities

regards

Dom75

Kirill
Posts: 577
Joined: Nov 25, 2007 3:05 am
Location: Kaliningrad, RF
Contact:

Re: Change upload from database to DISK

Post by Kirill » Jan 22, 2008 2:52 am

Thank's very much. I delete this folder :wink:

Dom75
Posts: 20
Joined: Mar 28, 2006 8:47 am
Location: France
Contact:

Re: Change upload from database to DISK

Post by Dom75 » Jan 22, 2008 8:47 am

That's why it's better to rename it and not to delete it :(

Kirill
Posts: 577
Joined: Nov 25, 2007 3:05 am
Location: Kaliningrad, RF
Contact:

Re: Change upload from database to DISK

Post by Kirill » Jan 22, 2008 9:02 am

rename something like this 2Wj69rbU ? :lol:
At me simple delete. I can in averytime restore this folder ;)

kuhsay

Re: Change upload from database to DISK

Post by kuhsay » Jan 22, 2008 8:07 pm

Is one method for storing uploads better than the other for any reason? What are the pros and cons of each approach?

vboctor
Site Admin
Posts: 1286
Joined: Feb 13, 2005 5:11 pm
Location: Redmond, Washington
Contact:

Re: Change upload from database to DISK

Post by vboctor » Jan 26, 2008 4:35 am

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.
Migrate your MantisBT to the MantisHub Cloud

mpa
Posts: 17
Joined: Jan 15, 2008 7:34 am

Re: Change upload from database to DISK

Post by mpa » Feb 02, 2008 12:49 pm

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

mpa
Posts: 17
Joined: Jan 15, 2008 7:34 am

Re: Change upload from database to DISK

Post by mpa » Feb 03, 2008 6:16 am

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?

Post Reply