Open Bug 460373 Opened 16 years ago Updated 2 years ago

contrib/bzdbcopy.pl ignores custom fields

Categories

(Bugzilla :: Installation & Upgrading, defect)

defect
Not set
major

Tracking

()

People

(Reporter: LpSolit, Unassigned)

Details

contrib/bzdbcopy.pl only considers tables and columns being in the target DB, and so ignores all custom fields defined in the source DB. As some data about custom fields is stored in fielddefs, the target installation *thinks* these custom fields exist, but is unable to access them and crashes (the first one to crash is checksetup.pl).

The only workaround so far is to manually create all custom fields exactly as they are defined in the source DB, and then run bzdbcopy.pl. From what I saw, checksetup.pl is then able to create foreign keys for multi-select fields, but it displays nothing about drop-down fields, so I'm not sure he created them (one would have to check).

IMO, this is critical enough to block 3.2, but mkanat says 'no'. :)
I tried working on this bug, but there is another problem: even if all fields are defined, we still don't know if they are of the same type.

How should bzdbcopy.pl behave? Warn the user that both DB mismatch and quit, or try fixing custom fields itself?
It should create the fields itself, and thus assume that if they have the same name, they're the same field. You are always doing bzdbcopy into an empty DB.
Bugzilla 3.2 is restricted to security bugs only. Moreover, this bug is either assigned to nobody or got no traction for several months now. Rather than retargetting it at each new release, I'm clearing the target milestone and the bug will be retargetted to some sensible release when someone starts fixing this bug for real (Bugzilla 3.8 more likely).
Target Milestone: Bugzilla 3.2 → ---
Target Milestone: --- → Bugzilla 3.4
Bugzilla 3.4 is now restricted to security bugs. We will retarget this bug (to 3.6 or later) when it's fixed.
Target Milestone: Bugzilla 3.4 → ---
Here are the steps I have to do to migrate 3.4.4 to 3.4.4. 
Yes I know they are old versions!!!
We're being forced to go to another tracking tool, and the new (target) bugzilla will be used for legacy purposes only.

<omitted steps that resulted in failure!>
*) installed 3.4.4 on target machine
*) whatever configuration required for apache
*) if database was already created, DROP it. checksetup.pl will create it.
*) ran checksetup.pl and ONLY installed modules it complained about!
*) THIS IS CRITICAL PART! Login to target bugzilla, and through target bugzilla create all custom fields exactly as they are defined in source bugzilla! This includes the values used in the drop downs. Not sure if latter part is really required, but did it anyway.
*) at this point, configure bzdbcopy.pl with user configurable values.
*) run bzdbcopy.pl
*) if this succeeds, did for me, run checksetup.pl again. This time it should succeed as well.
*) login and try to view some bugs 
*) I got TimeZone errors, so I followed these steps provided by Max in another bug I found.
**) ./install-module.pl DateTime::TimeZone
**) ./install-module.pl DateTime::Locale
**) ./install-module.pl Class::Singleton 
**) checksetup.pl
**) re-try looking at bugs.

Well this worked for me, no promises it'll work for you. Just thought I'd pass along this info. later.
mercer: bzdbcopy.pl is only for copying between different types of databases. For example, from MySQL to Oracle or from PostgreSQL to MySQL. Is that what you're doing? If you're just moving between machines, you should be following these instructions:

  https://wiki.mozilla.org/Bugzilla:Move_Installation
Heh, I just run into this while trying to setup my Pg test installs. :) Extremely frustrating but it seems I figured out to create the custom fields manually and then copy succeeded. Custom Field configuration itself (description, visibility options, legal values) was copied correctly as well.
Summary: contrib/bzdbcopy.pl ignores custom fields → Document that contrib/bzdbcopy.pl ignores custom fields in its POD
No, I didn't file this bug to fix the documentation. I want bzdbcopy.pl to create missing custom fields itself. If you disagree with that, then close this bug as wontfix.
Summary: Document that contrib/bzdbcopy.pl ignores custom fields in its POD → contrib/bzdbcopy.pl ignores custom fields
You need to log in before you can comment on or make changes to this bug.