On Tue, Dec 30, 2014, 4:05 PM Greg Earle <[email protected]> wrote:

I have Trac 1.0.2 running on a new server.  The old server is still
running Trac 0.12.

I want to migrate the existing Projects from the old to the new, but ran
into a problem.  For each of the existing Projects I basically did a

trac-admin /var/trac/projects/$i hotcopy /var/trac/projects_backups/$i

on the old server to back them up.  I then tar'ed up the "projects_backups"
directory and transferred them over to the new server where it sits in
"/var/trac" alongside the new "projects" (to be) directory.

As a first test, I copied one of the Projects (a small, nearly empty one)
from the backups directory into /var/trac/projects on the new server.

But when I tried to run 'trac-admin update' on it, I got

--
[root@newtracserver ~]# trac-admin -v
trac-admin 1.0.2

[root@newtracserver projects]# trac-admin `pwd`/test_project upgrade
The upgrade of attachments was successful, but the old attachments
directory:

  /var/trac/projects/test_project/attachments

couldn't be removed, possibly due to the presence of files that weren't
referenced in the database. The error was:

  OSError: [Errno 39] Directory not empty:
'/var/trac/projects/test_project/attachments/wiki/PeerReviews/PeerReviewsHelp'

This error can be ignored, but for keeping your environment clean you should
backup any remaining files in that directory and remove it manually.

Upgrade done.

You may want to upgrade the Trac documentation now by running:

  trac-admin /var/trac/projects/test_project wiki upgrade
--

In all copies (except for this newest one) of the test Project, they contain
several subdirectories under .../attachments/wiki:

--
[root@oldtracserver projects]# ls -ltFh
/var/trac/projects_backups/test_project/attachments/wiki/*

/var/trac/projects_backups/test_project/attachments/wiki/WikiStart:
total 276K
-rw-r--r-- 1 apache apache 269K Dec 22 11:29
Screen%20Shot%202014-12-18%20at%2010.15.49%20AM.png

/var/trac/projects_backups/test_project/attachments/wiki/Design:
total 696K
-rw-r--r-- 1 apache apache 240K Oct 15  2013
test_project-design-datamgmt.graffle
-rw-r--r-- 1 apache apache 166K Oct 14  2013 test_project%20telem.xls
-rw-r--r-- 1 apache apache  18K Oct 14  2013
test_project%20Data%20Rates%202013-09-16.xlsx
-rw-r--r-- 1 apache apache 254K Oct  8  2013 test_project.graffle

/var/trac/projects_backups/test_project/attachments/wiki/Overview:
total 0

/var/trac/projects_backups/test_project/attachments/wiki/PeerReviews:
total 32K
drwxr-xr-x 2 apache apache 4.0K Oct  7  2013 PeerReviewsHelp/
-rw-r--r-- 1 apache apache  25K Oct  7  2013 RFAForm.doc

/var/trac/projects_backups/test_project/attachments/wiki/TemplateHelp:
total 36K
-rw-r--r-- 1 apache apache 33K Oct  7  2013 trac_layout.png
--

The "Directory not empty" is because of these two files:

--
[root@oldtracserver trac]# ls
/var/trac/projects/test_project/attachments/wiki/PeerReviews/PeerReviewsHelp
RFA_doc.png  RFA_ticket.png
--

It looks like the upgrade process basically stopped in its tracks at
that point.  After running "trac-admin upgrade", only 2 sub-directories
of the Wiki attachments tree are present:

--
[root@newtracserver trac]# pwd
/var/trac
[root@newtracserver trac]# ls -lhF projects/oco-3/attachments/wiki
projects/oco-3/attachments/wiki:
total 8.0K
drwxr-xr-x 3 apache apache 4.0K Oct  7  2013 PeerReviews/
drwxr-xr-x 2 apache apache 4.0K Oct  7  2013 TemplateHelp/
--

The other 3 are missing:

--
[root@oldtracserver trac]# pwd
/var/trac
[root@oldtracserver trac]# ls -lhF projects/test_project/attachments/wiki
projects/test_project/attachments/wiki:
total 20K
drwxr-xr-x 2 apache apache 4.0K Oct 15  2013 Design/
drwxr-xr-x 2 apache apache 4.0K Oct  7  2013 Overview/
drwxr-xr-x 3 apache apache 4.0K Oct  7  2013 PeerReviews/
drwxr-xr-x 2 apache apache 4.0K Oct  7  2013 TemplateHelp/
drwxr-xr-x 2 apache apache 4.0K Dec 22 11:29 WikiStart/
--

How can I fix this?

(Sorry for the long-winded post btw)

        - Greg




The upgrade step moves the attachment files to
/var/trac/projects_backups/test_project/files

You could avoid the error by removing the files that can't be moved because
they aren't linked to any resource. It shouldn't be a problem to leave them
though. I suspect that the upgrade step completed normally and you are just
looking in the wrong place for your attachments.

If you don't find you find the attachments in the "files" directory, then
we might have another case of this issue:
http://trac.edgewall.org/ticket/11370

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to