Change upload from database to DISK

Get help from other users here.

Moderators: Developer, Contributor

Post Reply
mpa
Posts: 27
Joined: 15 Jan 2008, 12:34

Change upload from database to DISK

Post 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
Dom75
Posts: 20
Joined: 28 Mar 2006, 13:47
Location: France
Contact:

Re: Change upload from database to DISK

Post 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
Kirill
Posts: 638
Joined: 25 Nov 2007, 08:05
Location: Kaliningrad, RF
Contact:

Re: Change upload from database to DISK

Post 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?
Dom75
Posts: 20
Joined: 28 Mar 2006, 13:47
Location: France
Contact:

Re: Change upload from database to DISK

Post by Dom75 »

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

regards

Dom75
Kirill
Posts: 638
Joined: 25 Nov 2007, 08:05
Location: Kaliningrad, RF
Contact:

Re: Change upload from database to DISK

Post by Kirill »

Thank's very much. I delete this folder :wink:
Dom75
Posts: 20
Joined: 28 Mar 2006, 13:47
Location: France
Contact:

Re: Change upload from database to DISK

Post by Dom75 »

That's why it's better to rename it and not to delete it :(
Kirill
Posts: 638
Joined: 25 Nov 2007, 08:05
Location: Kaliningrad, RF
Contact:

Re: Change upload from database to DISK

Post by Kirill »

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 »

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: 1293
Joined: 13 Feb 2005, 22:11
Location: Redmond, Washington
Contact:

Re: Change upload from database to DISK

Post 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.
Migrate your MantisBT to the MantisHub Cloud
mpa
Posts: 27
Joined: 15 Jan 2008, 12:34

Re: Change upload from database to DISK

Post 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
mpa
Posts: 27
Joined: 15 Jan 2008, 12:34

Re: Change upload from database to DISK

Post 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?
Post Reply