Project-Id-Version: Trac 0.12
Report-Msgid-Bugs-To: trac-dev@googlegroups.com
POT-Creation-Date: 2008-01-30 09:20+0100
PO-Revision-Date: 2010-07-19 23:05+0200
Last-Translator: Jeroen Ruigrok van der Werven <asmodai@in-nomine.org>
Language-Team: en_US <trac-dev@googlegroups.com>
Plural-Forms: nplurals=2; plural=(n != 1)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Generated-By: Babel 0.9.6

Warning: Can't synchronize with repository "(default)" (Unsupported version control system "git": Can't find an appropriate component, maybe the corresponding plugin was not enabled? ). Look in the Trac log for more information.

Version 7 (modified by sebastian, 7 years ago) (diff)

Improve migration guilde for 2.2

This page describes the migration of different phTagr versions without CVS (Concurrent Versions System, like SVN or Git)

General

This section describes the general steps to upgrade or migrate your phTagr gallery to a newer version. If no other revision is mentioned below you can follow these steps.

It is assumed that your phTagr gallery files are located in /var/www/phtagr. The configuration file phtagr/app/config/core.php and the user upload directory phtagr/app/users have to be migrated from the old to the new phtagr sources.

  1. Rename your old phTagr
    $ cd /var/www
    $ mv phtagr phtagr.old
    
  2. Fetch the latest phTagr sources from !SourceForge and unzip it to /var/www/
    $ wget https://sourceforge.net/projects/phtagr/files/latest
    $ unzip phtagr-rXXX.zip
    
  3. Migrate required files and directories from the old to the new phTagr
    $ mv phtagr.old/app/config/core.php phtagr/app/config/core.php
    $ mv phtagr.old/app/config/database.php phtagr/app/config/database.php
    $ rm phtagr/app/users
    $ mv phtagr.old/app/users phtagr/app
    
  4. Finally migrate the database schema and call the setup controller. If http://localhost/phtagr is your gallery URL, call http://localhost/phtagr/setup. Note: Usually the database migration was sucessful tested and should work fine. However you never know and before anything bad happens make a database dump (e.g. with mysqldump)!

Create a patch

You can create also a patch from the source online if you know your subversion revision.

  1. Go to the source browser of trac to trunk
  2. Click on the bottom View Changes
  3. Select your revision and the current source revision
  4. Download the Unified Diff
  5. Apply patch to your code
    cd [your phtagr directory]
    patch -p1 < [your downloaded patch file]
    

If these steps are not handy for you you can change TO-REVISION and FROM-REVISION values of the following link and download it directly: http://trac.phtagr.org/changeset?format=diff&old=FROM-REVISION&new=TO-REVISION&new_path=trunk&old_path=trunk

For example

cd /var/www/phtagr
wget "http://trac.phtagr.org/changeset?format=diff&old=599&&new=607new_path=trunk&old_path=trunk" -O phtagr-r599:607.patch
patch -p1 < phtagr-r599:607.patch

phTagr prior 2.2

In phTagr 2.2 the folder structure changed. phTagr is no longer a subfolder of the PHP framework CakePHP. Since phTagr 2.2 CakePHP is a subfolder of phTagr. The change has the advantage that CakePHP can be used as GIT submodule and simplifies the folders which where confusing in the past. Now there is only /var/www/phtagr as root directory.

Due this change the phTagrs folder /var/www/cake/phtagr becomes /var/www/phtagr (/var/www/phtagr/phtagr becomes /var/www/phtagr or ~/public_html/phtagr/app becomes ~/public_html/phtagr). Or in more abstract words phtagr root directory was CakePHP's root directory and both switches their roles.

The new folder structure is

/phtagr        <-- phTagr root directory
    /cakephp   <-- CakePHP framework
    /webroot   <-- Webroot 
    /config    <-- Configuration directory for phTagr
    /users     <-- Users directory for uploaded files
    /tmp       <-- Temporary directory for cached files
    ...

Note Before you migrate, please ensure that you have done your backups, especially your database if the database migration fails unpredictable.

phTagr in /var/www from zip archive

In following example it is assumed that your are installed phtagr from a ZIP archive and phtagr was installed at /var/www.

# download and extract phtagr 2.2 in your home directory
cd 
wget http://sourceforge.net/projects/phtagr/files/latest # phtagr-2.2.zip
unzip phtagr-2.2.zip
cd /var/www
sudo mv phtagr phtagr.old
sudo mv ~/phtagr .
cp phtagr.old/app/config.php phtagr.old/app/database.php phtagr/config
rm -rf phtagr/users phtagr/tmp
mv phtagr.old/app/tmp phtagr.old/app/users phtagr

Now the user files have a new location. Before they where in /var/www/phtagr/app/users now they are in /var/www/phtagr/users. These change must be updated in the database as well. The following example assumes that phTagr uses no table prefixes. Otherwise check command mysql> show tables;

mysql -u phtagr -p phtagr
mysql> update files set path=REPLACE(path, '/var/www/phtagr/app/users', '/var/www/phtagr/users');
mysql> quit;

Now everything should be working again. If not check your web server configuration if the document root points to the correct directory. If the document root points to /var/www/phtagr/app/webroot it should not point to /var/www/phtagr/webroot.

phTagr in /var/www from git

In following example assumes that phtagr is installed at /var/www via git.

cd /var/www/cake/phtagr
git stash
git pull
git submodule init
git submodule update
git stash pop
cd /var/www
sudo mv cake/phtagr phtagr

The user files need to be migrated in the database. Before they where located in /var/www/cake/phtagr now they are in /var/www/phtagr/users. Following example assumes that the table prefix (written in config/database.php) is set to pt_.

mysql -u phtagr -p phtagr
mysql> update pt_files set pt_path=REPLACE(path, '/var/www/cake/phtagr/users', '/var/www/phtagr/users');
mysql> quit;

Done. If it is not working check your web server configuration if the document root points to the correct directory. If the document root points to /var/www/cake/phtagr/webroot it should not point to /var/www/phtagr/webroot.

If everything works as expected you can delete the old directory /var/www/cake.

phTagr in user directory

The migration works similar to the above examples. Maybe you need to adapt the RewriteBase in .htaccess files respectively. Also migrate the database entries for the files.

phTagr 2.1.1 To phTagr 2.1.2 (>r581)

phTagr 2.1.2 (r581) switched the CakePHP framework from CakePHP 1.2 to CakePHP 1.3. Please fetch a new CakePHP from CakePHP's git hub and replace the current ./cake directory with new ./cake directory provided by the archive of CakePHP.