View Issue Details

IDProjectCategoryView StatusLast Update
0004078mantisbtfeaturepublic2004-08-29 02:29
Reportervboctor Assigned Tothraxisp  
PriorityhighSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version0.19.0a1 
Summary0004078: Script to import the value of a custom field to a native field
Description

As we implement native field like fixed_in_version, it will needed to copy data in custom fields which users used to store this information into the newly created custom fields.

In the example of fixed_in_version, the script should do the following:

  • Take the custom field as an input from the user.
  • Detect the projects that has this custom field linked.
  • Iterate through all the issues in these projects and copy the value into the native field (if the value is valid, in this case valid means that it is one of the versions defined for the project).
  • The output should be a page that logs the projects, and issues traversed, and should log the errors as well. This way. It would be nice if the issue numbers are hyperlinked to the issue view pages.

In my opinion, such scripts are like upgrade scripts and they should live somewhere under the admin/ folder.

TagsNo tags attached.
Attached Files
mv_field.tar.gz (2,130 bytes)

Relationships

related to 0003714 closedthraxisp Please add in a way to transfer attachments from the database to disk 
has duplicate 0003905 closedthraxisp Implement a script to import fixed in release from custom fields 
child of 0003987 closedvboctor Mantis 0.19.0 Release 

Activities

grangeway

grangeway

2004-07-22 12:26

reporter   ~0006239

shouldn't this be a command line type script i.e. what happens if someone has say 20,000 bugs in their system, and php/web browser/proxy etc all have a 60 second 'timeout'? Same applies for moving database->disk.

I'd also be inclined to keep little 'helper scripts' seperate to the /admin area.

thraxisp

thraxisp

2004-07-22 13:19

reporter   ~0006242

If you have php >4.3, there is a command line php that might be used. Otherwise, there could be a lot to re-implement in perl or another language.

In my testing, I transferred about 200 attachments in about 8 sec for 16M total. This was on a slow server (1GHz Powerbook).

thraxisp

thraxisp

2004-07-23 14:22

reporter   ~0006258

Building on the changes I made in 3714, here is an additional module to move a custom field to the fixed_in_version field. It should be fairly extensible to other fields.

grangeway

grangeway

2004-07-23 15:03

reporter   ~0006259

I was assuming command line php, rather then any other language. I'm assuming that most people would only move from mysql->file if they hit an issue e.g. they had 200,000 attachments and it was slowing the db down - and this is when i was thinking you might start hitting issues with a webbased script (or not?)...

Re, your patch, I don't seem to have move_db2disk.php here.

(Also, didn't we decide a few months back to use echo instead of print)

thraxisp

thraxisp

2004-07-23 15:46

reporter   ~0006262

move_db2disk.php is now in the files listed under 0003714. There is a second patch (file_down.diff) there to allow you to switch from database to disk without a move (e.g., new attachments are stored on disk, old ones in schema).

thraxisp

thraxisp

2004-07-24 19:11

reporter   ~0006342

patch committed in CVS