Mozilla/mozilla/webtools/bugzilla/docs/en/rst/upgrading/migrating-from-2.inc.rst
bzrmirror%bugzilla.org 299a31dc56 WIP
git-svn-id: svn://10.0.0.236/trunk@265719 18797224-902f-48f8-a5cc-f745e15eee43
2014-12-03 22:18:44 +00:00

139 lines
4.9 KiB
ReStructuredText
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

.. This file is included in multiple places, so can't have labels as they
appear as duplicates.
Download Code from Git
======================
Download an additional copy of your *current* version of Bugzilla from the git
repository into a separate directory alongside your existing Bugzilla
installation (which we will assume is in a directory called :file:`bugzilla`).
You will need a copy of the git program. All Linux distributions have it;
search your package manager for "git". On Windows or Mac OS X, you can
`download the official build <http://www.git-scm.com/downloads>`_.
Once git is installed, run these commands to pull a copy of Bugzilla:
:command:`git clone https://git.mozilla.org/bugzilla/bugzilla bugzilla-new`
:command:`cd bugzilla-new`
:command:`git checkout $VERSION`
Replace $VERSION with the two-digit version number of your current Bugzilla, e.g.
4.2. These command will automatically switch your checkout to be a copy of
the latest point release of version $VERSION.
Save Any Local Customizations
=============================
Go into your original Bugzilla directory and run this command:
|diffcommand|
If you have made customizations to your Bugzilla, and you made them by
changing the Bugzilla code itself (rather than using the Extension system),
then :file:`patch.diff` will have non-zero size. You will want to keep a copy
of those changes by keeping a copy of this file. If the file has zero size,
you haven't made any local customizations of this sort.
Shut Down Bugzilla
==================
At this point, you should shut down Bugzilla to make sure nothing changes
while you make the switch. Go into the administrative interface and put an
appropriate message into the :param:`shutdownhtml` parameter, which is in the
"General" section of the administration parameters. As the name implies, HTML
is allowed.
This would be a good time to make :ref:`backups`. We shouldn't be affecting
the database, but you can't be too careful.
Copy Across Data and Modules
============================
Copy the contents of the following directories from your current installation
of Bugzilla into the corresponding directory in :file:`bugzilla-new/`:
.. code-block:: none
lib/
data/
template/en/custom (may or may not exist)
You also need to copy any extensions you have written or installed, which are
in the :file:`extensions/` directory. |extstatusinfo|
Lastly, copy the following file from your current installation of Bugzilla
into the corresponding place in :file:`bugzilla-new/`:
.. code-block:: none
localconfig
This file contains your database password and access details. Because your
two versions of Bugzilla are the same, this should all work fine.
Reapply Local Customizations
============================
If your :file:`patch.diff` file was zero sized, you can
jump to the next step. Otherwise, you have to apply the patch to your new
installation. If you are on Windows and you dont have the :command:`patch`
program, you can download it from
`GNUWin <http://gnuwin32.sourceforge.net/packages/patch.htm>`_. Once
downloaded, you must copy patch.exe into the Windows directory.
Copy :file:`patch.diff` into the :file:`bugzilla-new` directory and then do:
:command:`patch -p0 --dry-run < patch.diff`
The patch should apply cleanly because you have exactly the same version of
Bugzilla in both directories. If it does, remove the :command:`--dry-run` and
rerun the command to apply it for real. If it does not apply cleanly, it is
likely that you have managed to get a Bugzilla version mismatch between the
two directories.
Swap The New Version In
=======================
Now we swap the directories over, and run checksetup.pl to confirm that all
is well. From the directory containing the :file:`bugzilla` and
:file:`bugzilla-new` directories, run:
:command:`mv bugzilla bugzilla-old`
:command:`mv bugzilla-new bugzilla`
:command:`cd bugzilla`
:command:`./checksetup.pl`
Running :file:`checksetup.pl` should not result in any changes to your database at
the end of the run. If it does, then it's most likely that the two versions
of Bugzilla you have are not, in fact, the same.
Re-enable Bugzilla
==================
Go into the administrative interface and clear the contents of the
:param:`shutdownhtml` parameter.
Test Bugzilla
=============
Use your Bugzilla for several days to check that the switch has had no
detrimental effects. Then, if necessary, follow the instructions in
:ref:`upgrading-with-git` to upgrade to the latest version of Bugzilla.
Rolling Back
============
If something goes wrong at any stage of the switching process (e.g. your
patch doesn't apply, or checksetup doesn't complete), you can always just
switch the directories back (if you've got that far) and re-enable Bugzilla
(if you disabled it) and then seek help. Even if you have re-enabled Bugzilla,
and find a problem a little while down the road, you are still using the same
version so there would be few side effects to switching the directories back
a day or three later.