Problems with Ant 'xdb:restore' task

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
Report Content as Inappropriate

Problems with Ant 'xdb:restore' task

Tony Graham
Using the 'xdb:backup' Ant task worked okay [1], but when I tried to use
the 'xdb:restore' task, I had multiple problems.

The 'xdb:restore' task in documented [2] as having 'dir' and 'file'
attributes, but using 'dir' produces an 'xdb:restore doesn't support the
"dir" attribute' message.

Ant really doesn't know about a 'dir' or 'file' attribute, since this is
what the 'antstructure' task dumps for 'xdb:restore' from 'develop-acd0c14':

<!ELEMENT (dirset)*>
           id ID #IMPLIED
           configuration CDATA #IMPLIED
           uri CDATA #IMPLIED
           ssl %boolean; #IMPLIED
           user CDATA #IMPLIED
           restorepassword CDATA #IMPLIED
           initdb %boolean; #IMPLIED
           permissions CDATA #IMPLIED
           taskname CDATA #IMPLIED
           description CDATA #IMPLIED
           failonerror %boolean; #IMPLIED
           password CDATA #IMPLIED
           driver CDATA #IMPLIED>

Switching to using a <dirset>:

<target name="exist.restore">
   <xdb:restore xmlns:xdb=""
     <dirset dir="${xmldb.backup.dir}" />


[xdb:restore] ERROR StatusLogger No log4j2 configuration file found.
Using default configuration: logging only errors to the console.
[xdb:restore] Database driver registered.
[xdb:restore] Found 16677 files.
[xdb:restore] Did not found file

is in the second level of '__contents__.xml' files in the backup dump.
It is:

<collection xmlns=""
name="/db/ahrts-data/test-local-ahrts-pdf" owner="ahrts-data"
group="ahrts" mode="775" created="2017-02-28T13:51:32Z" version="1">
     <acl entries="0" version="1"/>
     <subcollection name="reports" filename="reports"/>
     <subcollection name="compareOutput" filename="compareOutput"/>

and there are no mystery, blank-named directories nor any troublesome
files or directories with '=' in their name in its directory:

total 24
drwxrwxr-x.  4 tgraham tgraham   63 Mar  2 17:24 .
drwxrwxr-x.  4 tgraham tgraham 4096 Mar  2 12:38 ..
drwxrwxr-x. 11 tgraham tgraham 4096 Mar  2 12:38 compareOutput
-rw-rw-r--.  1 tgraham tgraham  373 Mar  2 12:38 __contents__.xml
drwxrwxr-x.  2 tgraham tgraham 8192 Mar  2 12:38 reports

Trying to start the restore one level down in 'reports' finds the
right number of files but fails with a similar
'__contents__.xml/__contents__.xml' message.

Is the 'xdb:restore' task trying to treat '__contents__.xml' as a directory?


Tony Graham.
Senior Architect
XML Division
Antenna House, Inc.
Skerries, Ireland
[hidden email]

[1] Though it is surprising that it can't backup to a Zip file.

Check out the vibrant tech community on one of the world's most
engaging tech sites,!
Exist-open mailing list
[hidden email]