Item14168: bulk_copy.pl tool relies on absolute paths in LocalSite.cfg which is not immediately apparent

pencil
Priority: Normal
Current State: No Action Required
Released In: n/a
Target Release: n/a
Applies To: Engine
Component: FoswikiTools
Branches:
Reported By: DavidTonhofer
Waiting For:
Last Change By: CrawfordCurrie
I have used bulk_copy.pl to migrate an old installation to a new one.

Confusingly, it didn't work at first.

I had this structure:

/home/wikis/wiki
               \_bin
               \_data

/home/wikis/wiki_old
                   \_bin
                   \_data
                       \_some_web

So, the old installation had been renamed to /home/wikis/wiki_old and the new, still empty one would be /home/wikis/wiki.

In the old one the web some_web could be found.

Pretty straightforward to migrate using bulk_copy.pl

/home/wikis/wiki/tools/bulk_copy.pl --iweb=some_web /home/wikis/wiki_old/bin/ /home/wikis/wiki/bin/ | tee > ERRORS

Well, this didn't work. Indeed bulk_copy.pl didn't even find the some_web web.

It took me some time to find out that bulk_copy.pl gets the path to the data directory (among others) from /home/wikis/wiki_old/bin/../lib/LocalSite.cfg

The paths in that file are absolute (as opposed to relative to bin for example) and thus are actually already pointing to the soon-to-be installation due to my renaming tactic.

The path to data in /home/wikis/wiki_old/bin/../lib/LocalSite.cfg would be /home/wikis/wiki/data (which is empty when bulk_copy.pl is run) instead of /home/wikis/wiki_old/data (which actually contains the to-be-migrated web).

Thus bulk_copy.pl terminates immediately, as it analyses a still empty installation.

Not sure how to solve this. The easiest way might be to verify that the paths obtained from the old LocalSite.cfg and the new LocalSite.cfg are indeed different. If they are identicial, one would tell the user to manually edit the path in the old LocalSite.cfg and terminate at once.

-- DavidTonhofer - 03 Sep 2016

Setting to confirmed. It would be nice to re-set the file path settings relative to the referenced bin directory. That might be dangerous for sites that use alternate file system layouts, so we should at least check and warn.

-- GeorgeClark - 25 Sep 2016

As I understand it, the script did exactly what it says on the tin. OP set up two foswiki installs that share a data area - an empty one, unfortunately - and asked bulk_copy to transfer data between them, which it did. The problem is the configuration of the two foswiki installs, not with bulk_copy.

Unless I'm missing something, I don't think it did anything wrong.

-- Main.CrawfordCurrie - 06 Apr 2017 - 11:07

 

ItemTemplate edit

Summary bulk_copy.pl tool relies on absolute paths in LocalSite.cfg which is not immediately apparent
ReportedBy DavidTonhofer
Codebase
SVN Range
AppliesTo Engine
Component FoswikiTools
Priority Normal
CurrentState No Action Required
WaitingFor
Checkins
TargetRelease n/a
ReleasedIn n/a
CheckinsOnBranches
trunkCheckins
masterCheckins
ItemBranchCheckins
Release02x01Checkins
Release02x00Checkins
Release01x01Checkins
Topic revision: r3 - 06 Apr 2017, CrawfordCurrie
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy