You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by Trevor Donaldson <tm...@gmail.com> on 2015/03/06 17:29:13 UTC

Backup and Restore TDB using Fuseki2

Hi all,

 I was wondering if there is a way to programmatically backup the tdb
instance? I found this question
http://webcache.googleusercontent.com/search?q=cache:0whNmMD65OcJ:answers.semanticweb.com/questions/24740/how-do-you-create-and-restore-backups-with-fuseki-and-tdb+&cd=3&hl=en&ct=clnk&gl=us
but it is referencing fuseki 1 (i.e. --mgtPort=port). Is there another way
that a backup and a restore should be handled in fuseki2?

Thanks in advance,

Trevor

Re: Backup and Restore TDB using Fuseki2

Posted by Andy Seaborne <an...@apache.org>.
On 08/03/15 23:30, Trevor Donaldson wrote:
> Andy,
>
> Question, does fuseki2 have a tdbloader script equivalent in it or is it
> only in the apache jena distro?

Not a script currently, but it is there ...

java -cp jena-fuseki-server-VER.jar tdb.tdbloader ARGS

NB "-cp" not "-jar"

This works because the server jar includes all of TDB.

This also works for all of the the command line java tools - just not 
tdbloader2 which has a shell script as well.

	Andy

And JENA-582.

>
> On Sun, Mar 8, 2015 at 7:25 PM, Trevor Donaldson <tm...@gmail.com>
> wrote:
>
>> Andy, WOOHOO!!!, it worked. Thanks man. I should have known something was
>> up when the backup file was 20 bytes. SMH!!! Everything is good. Thanks
>>
>> On Sun, Mar 8, 2015 at 12:43 PM, Andy Seaborne <an...@apache.org> wrote:
>>
>>> PS The development version is now 2.0.1-SNAPSHOT
>>>
>>>
>>> On 08/03/15 09:05, Andy Seaborne wrote:
>>>
>>>> Trevor,
>>>>
>>>> Sorry - I wasn't clear.  The exception would be in the Fuseki logs.
>>>>
>>>> The problem [*] was that the backup process was breaking as it started
>>>> to write the backup but it cleared up cleanly.  Net result - a valid
>>>> .nq.gz file of zero quads.
>>>>
>>>> [*] https://issues.apache.org/jira/browse/JENA-895
>>>> shows the exception.
>>>>
>>>> You need the latest Fuseki build and perform another backup.  Last
>>>> timne, it would have happened rather quickly.
>>>>
>>>> The sequence I used was:
>>>> 1/ Clear $FUSEKI_BASE
>>>> 2/ Start Fuseki2
>>>> 3/ Create database
>>>> 4/ Load data via the UI
>>>> 5/ Query to check the data
>>>> 6/ Perform backup
>>>> 7/ Wait for backup to finish
>>>>      (it is done async so look in the Fuseki logs)
>>>> 8/ Stop fuseki
>>>> 9/ Clean database location
>>>> 10/ Load with data tdbloader
>>>> 11/ Restart Fuseki
>>>>
>>>> Your sequence for loading the data is fine.
>>>>
>>>>       Andy
>>>>
>>>> On 08/03/15 00:34, Trevor Donaldson wrote:
>>>>
>>>>> Andy I don't see any exception when I run tdbloader but I data still
>>>>> isn't
>>>>> being imported. Should I try to get another backup using version
>>>>> 2015-03-07
>>>>> build? I just used the same backup version I already had. Just to make
>>>>> sure
>>>>> I am doing it correctly. This is my process.
>>>>>
>>>>> 1. Click backup from fuseki ui
>>>>> 2. remove all files in (rm -rf $FUSEKI_HOME/databases/myapp/*)
>>>>> 3. downloaded apache-jena-2.12.1
>>>>> 4. ran bin/tdbloader --loc=$FUSEKI_HOME/databases/myapp
>>>>> backups/backup_file.nq.gz
>>>>> 5. restart fuseki
>>>>> 6. SELECT (COUNT(*) as ?no) ?g
>>>>> WHERE {
>>>>>     GRAPH ?g {?s ?p ?o}
>>>>> }
>>>>>
>>>>
>>>>
>>>>
>>>>
>>>>> I get no results. I get no exception. This is the output from tdbloader.
>>>>>
>>>>> 19:24:45 INFO  loader               :: -- Start triples data phase
>>>>> 19:24:45 INFO  loader               :: ** Load empty triples table
>>>>> 19:24:45 INFO  loader               :: -- Start quads data phase
>>>>> 19:24:45 INFO  loader               :: ** Load empty quads table
>>>>> 19:24:45 INFO  loader               :: Load:
>>>>> $BACKUP_DIR/backups/myapp_2015-03-06_17-03-52.nq.gz -- 2015/03/07
>>>>> 19:24:45
>>>>> EST
>>>>> 19:24:45 INFO  loader               :: -- Finish triples data phase
>>>>> 19:24:45 INFO  loader               :: -- Finish quads data phase
>>>>> 19:24:45 INFO  loader               :: -- Finish triples load
>>>>> 19:24:45 INFO  loader               :: -- Finish quads load
>>>>>
>>>>>
>>>>> On Sat, Mar 7, 2015 at 1:03 PM, Trevor Donaldson <tm...@gmail.com>
>>>>> wrote:
>>>>>
>>>>>   Ok haven't  had a chance to check the exception. Thanks
>>>>>> On Mar 7, 2015 12:34 PM, "Andy Seaborne" <an...@apache.org> wrote:
>>>>>>
>>>>>>   On 07/03/15 10:46, Andy Seaborne wrote:
>>>>>>>
>>>>>>>   On 06/03/15 22:31, Trevor Donaldson wrote:
>>>>>>>>
>>>>>>>>   so not seeing data. I may have done something incorrect.
>>>>>>>>>
>>>>>>>>>
>>>>>>>> No, you're not ... :-(
>>>>>>>>
>>>>>>>> Is there an exception in log file?
>>>>>>>>
>>>>>>>> ------------------
>>>>>>>> [2015-03-07 10:20:49] Backup     INFO  [11] **** Exception in backup
>>>>>>>> com.hp.hpl.jena.tdb.transaction.TDBTransactionException: Not in a
>>>>>>>> transaction
>>>>>>>> ------------------
>>>>>>>>
>>>>>>>>
>>>>>>>> Recorded as JENA-895
>>>>>>>>
>>>>>>>> (either there has been a regression in the code or all the
>>>>>>>> development
>>>>>>>> work happen to find a timing hole whereby it can work if the backup
>>>>>>>> happens very early in a server's life)
>>>>>>>>
>>>>>>>>        Andy
>>>>>>>>
>>>>>>>>
>>>>>>> Assuming you were getting the same exception as I found, this should
>>>>>>> be
>>>>>>> fixed. I've done a "deploy" as well so built development binaries
>>>>>>> are up to
>>>>>>> date.
>>>>>>>
>>>>>>>           Andy
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>>   1. Backed up dataset
>>>>>>>>> 2. Deleted all files in ($FUSEKI_HOME/run/databases/myapp)
>>>>>>>>> 3. tdbloader --loc=$FUSEKI_HOME/run/databases/myapp backup.nq.gz
>>>>>>>>> 4. restarted fuseki.
>>>>>>>>> 5. went to count triples on fuseki web page. Counts are all 0.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On Fri, Mar 6, 2015 at 3:28 PM, Andy Seaborne <an...@apache.org>
>>>>>>>>> wrote:
>>>>>>>>>
>>>>>>>>>    On 06/03/15 18:10, Trevor Donaldson wrote:
>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>    Thanks Andy the link is very helpful. I am assuming that in
>>>>>>>>>> order to
>>>>>>>>>>
>>>>>>>>>>> reimport I would use tdbloader. Is this right?
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>   yes - backups are compressed n-quads, .nq.gz
>>>>>>>>>>
>>>>>>>>>>            Andy
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>    On Fri, Mar 6, 2015 at 12:47 PM, Andy Seaborne <an...@apache.org>
>>>>>>>>>>
>>>>>>>>>>> wrote:
>>>>>>>>>>>
>>>>>>>>>>>     On 06/03/15 16:29, Trevor Donaldson wrote:
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>>     Hi all,
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>>       I was wondering if there is a way to programmatically
>>>>>>>>>>>>> backup
>>>>>>>>>>>>> the tdb
>>>>>>>>>>>>> instance? I found this question
>>>>>>>>>>>>> http://webcache.googleusercontent.com/search?
>>>>>>>>>>>>> q=cache:0whNmMD65OcJ:answers.semanticweb.com/questions/
>>>>>>>>>>>>> 24740/how-do-you-create-and-restore-backups-with-fuseki-
>>>>>>>>>>>>> and-tdb+&cd=3&hl=en&ct=clnk&gl=us
>>>>>>>>>>>>> but it is referencing fuseki 1 (i.e. --mgtPort=port). Is there
>>>>>>>>>>>>> another
>>>>>>>>>>>>> way
>>>>>>>>>>>>> that a backup and a restore should be handled in fuseki2?
>>>>>>>>>>>>>
>>>>>>>>>>>>> Thanks in advance,
>>>>>>>>>>>>>
>>>>>>>>>>>>> Trevor
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>     See staging documentation:
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>> http://jena.staging.apache.org/documentation/fuseki2/
>>>>>>>>>>>> fuseki-server-
>>>>>>>>>>>>
>>>>>>>>>>>> protocol.html
>>>>>>>>>>>>
>>>>>>>>>>>> POST /$/backup/{name}
>>>>>>>>>>>>
>>>>>>>>>>>> The admin interface has to be on the same port (WAR file
>>>>>>>>>>>> deployment) and
>>>>>>>>>>>> it's under /$/, protected by Shiro (this is what the UI does
>>>>>>>>>>>> when you
>>>>>>>>>>>> press
>>>>>>>>>>>> the backup button)
>>>>>>>>>>>>
>>>>>>>>>>>> There was a very recent bug fix (a few days ago) - the backup was
>>>>>>>>>>>> written
>>>>>>>>>>>> to the wrong place. The latest build, it's written to
>>>>>>>>>>>> $FUSEKI_BASE/backups/
>>>>>>>>>>>>
>>>>>>>>>>>>             Andy
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>
>>>>
>>>
>>
>


Re: Backup and Restore TDB using Fuseki2

Posted by Trevor Donaldson <tm...@gmail.com>.
Andy,

Question, does fuseki2 have a tdbloader script equivalent in it or is it
only in the apache jena distro?

On Sun, Mar 8, 2015 at 7:25 PM, Trevor Donaldson <tm...@gmail.com>
wrote:

> Andy, WOOHOO!!!, it worked. Thanks man. I should have known something was
> up when the backup file was 20 bytes. SMH!!! Everything is good. Thanks
>
> On Sun, Mar 8, 2015 at 12:43 PM, Andy Seaborne <an...@apache.org> wrote:
>
>> PS The development version is now 2.0.1-SNAPSHOT
>>
>>
>> On 08/03/15 09:05, Andy Seaborne wrote:
>>
>>> Trevor,
>>>
>>> Sorry - I wasn't clear.  The exception would be in the Fuseki logs.
>>>
>>> The problem [*] was that the backup process was breaking as it started
>>> to write the backup but it cleared up cleanly.  Net result - a valid
>>> .nq.gz file of zero quads.
>>>
>>> [*] https://issues.apache.org/jira/browse/JENA-895
>>> shows the exception.
>>>
>>> You need the latest Fuseki build and perform another backup.  Last
>>> timne, it would have happened rather quickly.
>>>
>>> The sequence I used was:
>>> 1/ Clear $FUSEKI_BASE
>>> 2/ Start Fuseki2
>>> 3/ Create database
>>> 4/ Load data via the UI
>>> 5/ Query to check the data
>>> 6/ Perform backup
>>> 7/ Wait for backup to finish
>>>     (it is done async so look in the Fuseki logs)
>>> 8/ Stop fuseki
>>> 9/ Clean database location
>>> 10/ Load with data tdbloader
>>> 11/ Restart Fuseki
>>>
>>> Your sequence for loading the data is fine.
>>>
>>>      Andy
>>>
>>> On 08/03/15 00:34, Trevor Donaldson wrote:
>>>
>>>> Andy I don't see any exception when I run tdbloader but I data still
>>>> isn't
>>>> being imported. Should I try to get another backup using version
>>>> 2015-03-07
>>>> build? I just used the same backup version I already had. Just to make
>>>> sure
>>>> I am doing it correctly. This is my process.
>>>>
>>>> 1. Click backup from fuseki ui
>>>> 2. remove all files in (rm -rf $FUSEKI_HOME/databases/myapp/*)
>>>> 3. downloaded apache-jena-2.12.1
>>>> 4. ran bin/tdbloader --loc=$FUSEKI_HOME/databases/myapp
>>>> backups/backup_file.nq.gz
>>>> 5. restart fuseki
>>>> 6. SELECT (COUNT(*) as ?no) ?g
>>>> WHERE {
>>>>    GRAPH ?g {?s ?p ?o}
>>>> }
>>>>
>>>
>>>
>>>
>>>
>>>> I get no results. I get no exception. This is the output from tdbloader.
>>>>
>>>> 19:24:45 INFO  loader               :: -- Start triples data phase
>>>> 19:24:45 INFO  loader               :: ** Load empty triples table
>>>> 19:24:45 INFO  loader               :: -- Start quads data phase
>>>> 19:24:45 INFO  loader               :: ** Load empty quads table
>>>> 19:24:45 INFO  loader               :: Load:
>>>> $BACKUP_DIR/backups/myapp_2015-03-06_17-03-52.nq.gz -- 2015/03/07
>>>> 19:24:45
>>>> EST
>>>> 19:24:45 INFO  loader               :: -- Finish triples data phase
>>>> 19:24:45 INFO  loader               :: -- Finish quads data phase
>>>> 19:24:45 INFO  loader               :: -- Finish triples load
>>>> 19:24:45 INFO  loader               :: -- Finish quads load
>>>>
>>>>
>>>> On Sat, Mar 7, 2015 at 1:03 PM, Trevor Donaldson <tm...@gmail.com>
>>>> wrote:
>>>>
>>>>  Ok haven't  had a chance to check the exception. Thanks
>>>>> On Mar 7, 2015 12:34 PM, "Andy Seaborne" <an...@apache.org> wrote:
>>>>>
>>>>>  On 07/03/15 10:46, Andy Seaborne wrote:
>>>>>>
>>>>>>  On 06/03/15 22:31, Trevor Donaldson wrote:
>>>>>>>
>>>>>>>  so not seeing data. I may have done something incorrect.
>>>>>>>>
>>>>>>>>
>>>>>>> No, you're not ... :-(
>>>>>>>
>>>>>>> Is there an exception in log file?
>>>>>>>
>>>>>>> ------------------
>>>>>>> [2015-03-07 10:20:49] Backup     INFO  [11] **** Exception in backup
>>>>>>> com.hp.hpl.jena.tdb.transaction.TDBTransactionException: Not in a
>>>>>>> transaction
>>>>>>> ------------------
>>>>>>>
>>>>>>>
>>>>>>> Recorded as JENA-895
>>>>>>>
>>>>>>> (either there has been a regression in the code or all the
>>>>>>> development
>>>>>>> work happen to find a timing hole whereby it can work if the backup
>>>>>>> happens very early in a server's life)
>>>>>>>
>>>>>>>       Andy
>>>>>>>
>>>>>>>
>>>>>> Assuming you were getting the same exception as I found, this should
>>>>>> be
>>>>>> fixed. I've done a "deploy" as well so built development binaries
>>>>>> are up to
>>>>>> date.
>>>>>>
>>>>>>          Andy
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>>  1. Backed up dataset
>>>>>>>> 2. Deleted all files in ($FUSEKI_HOME/run/databases/myapp)
>>>>>>>> 3. tdbloader --loc=$FUSEKI_HOME/run/databases/myapp backup.nq.gz
>>>>>>>> 4. restarted fuseki.
>>>>>>>> 5. went to count triples on fuseki web page. Counts are all 0.
>>>>>>>>
>>>>>>>>
>>>>>>>> On Fri, Mar 6, 2015 at 3:28 PM, Andy Seaborne <an...@apache.org>
>>>>>>>> wrote:
>>>>>>>>
>>>>>>>>   On 06/03/15 18:10, Trevor Donaldson wrote:
>>>>>>>>
>>>>>>>>>
>>>>>>>>>   Thanks Andy the link is very helpful. I am assuming that in
>>>>>>>>> order to
>>>>>>>>>
>>>>>>>>>> reimport I would use tdbloader. Is this right?
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>  yes - backups are compressed n-quads, .nq.gz
>>>>>>>>>
>>>>>>>>>           Andy
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>   On Fri, Mar 6, 2015 at 12:47 PM, Andy Seaborne <an...@apache.org>
>>>>>>>>>
>>>>>>>>>> wrote:
>>>>>>>>>>
>>>>>>>>>>    On 06/03/15 16:29, Trevor Donaldson wrote:
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>>    Hi all,
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>>      I was wondering if there is a way to programmatically
>>>>>>>>>>>> backup
>>>>>>>>>>>> the tdb
>>>>>>>>>>>> instance? I found this question
>>>>>>>>>>>> http://webcache.googleusercontent.com/search?
>>>>>>>>>>>> q=cache:0whNmMD65OcJ:answers.semanticweb.com/questions/
>>>>>>>>>>>> 24740/how-do-you-create-and-restore-backups-with-fuseki-
>>>>>>>>>>>> and-tdb+&cd=3&hl=en&ct=clnk&gl=us
>>>>>>>>>>>> but it is referencing fuseki 1 (i.e. --mgtPort=port). Is there
>>>>>>>>>>>> another
>>>>>>>>>>>> way
>>>>>>>>>>>> that a backup and a restore should be handled in fuseki2?
>>>>>>>>>>>>
>>>>>>>>>>>> Thanks in advance,
>>>>>>>>>>>>
>>>>>>>>>>>> Trevor
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>    See staging documentation:
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>> http://jena.staging.apache.org/documentation/fuseki2/
>>>>>>>>>>> fuseki-server-
>>>>>>>>>>>
>>>>>>>>>>> protocol.html
>>>>>>>>>>>
>>>>>>>>>>> POST /$/backup/{name}
>>>>>>>>>>>
>>>>>>>>>>> The admin interface has to be on the same port (WAR file
>>>>>>>>>>> deployment) and
>>>>>>>>>>> it's under /$/, protected by Shiro (this is what the UI does
>>>>>>>>>>> when you
>>>>>>>>>>> press
>>>>>>>>>>> the backup button)
>>>>>>>>>>>
>>>>>>>>>>> There was a very recent bug fix (a few days ago) - the backup was
>>>>>>>>>>> written
>>>>>>>>>>> to the wrong place. The latest build, it's written to
>>>>>>>>>>> $FUSEKI_BASE/backups/
>>>>>>>>>>>
>>>>>>>>>>>            Andy
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>
>>>>
>>>
>>
>

Re: Backup and Restore TDB using Fuseki2

Posted by Andy Seaborne <an...@apache.org>.
At the moment, in Fuseki2, the upload interface prints the number of 
triples/quads loaded and a record goes in the server log file as well.

In this case, Trevor was loading offline with tdbloder which prints out 
what it is doing.

	Andy

On 09/03/15 10:35, Rob Vesse wrote:
> Andy
>
> Is there scope for an enhancement request here?
>
> Maybe Fuseki should print a WARNING when asked to load an empty data file
>
> Rob
>
> On 08/03/2015 23:25, "Trevor Donaldson" <tm...@gmail.com> wrote:
>
>> Andy, WOOHOO!!!, it worked. Thanks man. I should have known something was
>> up when the backup file was 20 bytes. SMH!!! Everything is good. Thanks
>>
>> On Sun, Mar 8, 2015 at 12:43 PM, Andy Seaborne <an...@apache.org> wrote:
>>
>>> PS The development version is now 2.0.1-SNAPSHOT


Re: Backup and Restore TDB using Fuseki2

Posted by Rob Vesse <rv...@dotnetrdf.org>.
Andy

Is there scope for an enhancement request here?

Maybe Fuseki should print a WARNING when asked to load an empty data file

Rob

On 08/03/2015 23:25, "Trevor Donaldson" <tm...@gmail.com> wrote:

>Andy, WOOHOO!!!, it worked. Thanks man. I should have known something was
>up when the backup file was 20 bytes. SMH!!! Everything is good. Thanks
>
>On Sun, Mar 8, 2015 at 12:43 PM, Andy Seaborne <an...@apache.org> wrote:
>
>> PS The development version is now 2.0.1-SNAPSHOT
>>
>>
>> On 08/03/15 09:05, Andy Seaborne wrote:
>>
>>> Trevor,
>>>
>>> Sorry - I wasn't clear.  The exception would be in the Fuseki logs.
>>>
>>> The problem [*] was that the backup process was breaking as it started
>>> to write the backup but it cleared up cleanly.  Net result - a valid
>>> .nq.gz file of zero quads.
>>>
>>> [*] https://issues.apache.org/jira/browse/JENA-895
>>> shows the exception.
>>>
>>> You need the latest Fuseki build and perform another backup.  Last
>>> timne, it would have happened rather quickly.
>>>
>>> The sequence I used was:
>>> 1/ Clear $FUSEKI_BASE
>>> 2/ Start Fuseki2
>>> 3/ Create database
>>> 4/ Load data via the UI
>>> 5/ Query to check the data
>>> 6/ Perform backup
>>> 7/ Wait for backup to finish
>>>     (it is done async so look in the Fuseki logs)
>>> 8/ Stop fuseki
>>> 9/ Clean database location
>>> 10/ Load with data tdbloader
>>> 11/ Restart Fuseki
>>>
>>> Your sequence for loading the data is fine.
>>>
>>>      Andy
>>>
>>> On 08/03/15 00:34, Trevor Donaldson wrote:
>>>
>>>> Andy I don't see any exception when I run tdbloader but I data still
>>>> isn't
>>>> being imported. Should I try to get another backup using version
>>>> 2015-03-07
>>>> build? I just used the same backup version I already had. Just to make
>>>> sure
>>>> I am doing it correctly. This is my process.
>>>>
>>>> 1. Click backup from fuseki ui
>>>> 2. remove all files in (rm -rf $FUSEKI_HOME/databases/myapp/*)
>>>> 3. downloaded apache-jena-2.12.1
>>>> 4. ran bin/tdbloader --loc=$FUSEKI_HOME/databases/myapp
>>>> backups/backup_file.nq.gz
>>>> 5. restart fuseki
>>>> 6. SELECT (COUNT(*) as ?no) ?g
>>>> WHERE {
>>>>    GRAPH ?g {?s ?p ?o}
>>>> }
>>>>
>>>
>>>
>>>
>>>
>>>> I get no results. I get no exception. This is the output from
>>>>tdbloader.
>>>>
>>>> 19:24:45 INFO  loader               :: -- Start triples data phase
>>>> 19:24:45 INFO  loader               :: ** Load empty triples table
>>>> 19:24:45 INFO  loader               :: -- Start quads data phase
>>>> 19:24:45 INFO  loader               :: ** Load empty quads table
>>>> 19:24:45 INFO  loader               :: Load:
>>>> $BACKUP_DIR/backups/myapp_2015-03-06_17-03-52.nq.gz -- 2015/03/07
>>>> 19:24:45
>>>> EST
>>>> 19:24:45 INFO  loader               :: -- Finish triples data phase
>>>> 19:24:45 INFO  loader               :: -- Finish quads data phase
>>>> 19:24:45 INFO  loader               :: -- Finish triples load
>>>> 19:24:45 INFO  loader               :: -- Finish quads load
>>>>
>>>>
>>>> On Sat, Mar 7, 2015 at 1:03 PM, Trevor Donaldson <tm...@gmail.com>
>>>> wrote:
>>>>
>>>>  Ok haven't  had a chance to check the exception. Thanks
>>>>> On Mar 7, 2015 12:34 PM, "Andy Seaborne" <an...@apache.org> wrote:
>>>>>
>>>>>  On 07/03/15 10:46, Andy Seaborne wrote:
>>>>>>
>>>>>>  On 06/03/15 22:31, Trevor Donaldson wrote:
>>>>>>>
>>>>>>>  so not seeing data. I may have done something incorrect.
>>>>>>>>
>>>>>>>>
>>>>>>> No, you're not ... :-(
>>>>>>>
>>>>>>> Is there an exception in log file?
>>>>>>>
>>>>>>> ------------------
>>>>>>> [2015-03-07 10:20:49] Backup     INFO  [11] **** Exception in
>>>>>>>backup
>>>>>>> com.hp.hpl.jena.tdb.transaction.TDBTransactionException: Not in a
>>>>>>> transaction
>>>>>>> ------------------
>>>>>>>
>>>>>>>
>>>>>>> Recorded as JENA-895
>>>>>>>
>>>>>>> (either there has been a regression in the code or all the
>>>>>>>development
>>>>>>> work happen to find a timing hole whereby it can work if the backup
>>>>>>> happens very early in a server's life)
>>>>>>>
>>>>>>>       Andy
>>>>>>>
>>>>>>>
>>>>>> Assuming you were getting the same exception as I found, this
>>>>>>should be
>>>>>> fixed. I've done a "deploy" as well so built development binaries
>>>>>> are up to
>>>>>> date.
>>>>>>
>>>>>>          Andy
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>>  1. Backed up dataset
>>>>>>>> 2. Deleted all files in ($FUSEKI_HOME/run/databases/myapp)
>>>>>>>> 3. tdbloader --loc=$FUSEKI_HOME/run/databases/myapp backup.nq.gz
>>>>>>>> 4. restarted fuseki.
>>>>>>>> 5. went to count triples on fuseki web page. Counts are all 0.
>>>>>>>>
>>>>>>>>
>>>>>>>> On Fri, Mar 6, 2015 at 3:28 PM, Andy Seaborne <an...@apache.org>
>>>>>>>> wrote:
>>>>>>>>
>>>>>>>>   On 06/03/15 18:10, Trevor Donaldson wrote:
>>>>>>>>
>>>>>>>>>
>>>>>>>>>   Thanks Andy the link is very helpful. I am assuming that in
>>>>>>>>> order to
>>>>>>>>>
>>>>>>>>>> reimport I would use tdbloader. Is this right?
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>  yes - backups are compressed n-quads, .nq.gz
>>>>>>>>>
>>>>>>>>>           Andy
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>   On Fri, Mar 6, 2015 at 12:47 PM, Andy Seaborne
>>>>>>>>><an...@apache.org>
>>>>>>>>>
>>>>>>>>>> wrote:
>>>>>>>>>>
>>>>>>>>>>    On 06/03/15 16:29, Trevor Donaldson wrote:
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>>    Hi all,
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>>      I was wondering if there is a way to programmatically
>>>>>>>>>>>>backup
>>>>>>>>>>>> the tdb
>>>>>>>>>>>> instance? I found this question
>>>>>>>>>>>> http://webcache.googleusercontent.com/search?
>>>>>>>>>>>> q=cache:0whNmMD65OcJ:answers.semanticweb.com/questions/
>>>>>>>>>>>> 24740/how-do-you-create-and-restore-backups-with-fuseki-
>>>>>>>>>>>> and-tdb+&cd=3&hl=en&ct=clnk&gl=us
>>>>>>>>>>>> but it is referencing fuseki 1 (i.e. --mgtPort=port). Is there
>>>>>>>>>>>> another
>>>>>>>>>>>> way
>>>>>>>>>>>> that a backup and a restore should be handled in fuseki2?
>>>>>>>>>>>>
>>>>>>>>>>>> Thanks in advance,
>>>>>>>>>>>>
>>>>>>>>>>>> Trevor
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>    See staging documentation:
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>> http://jena.staging.apache.org/documentation/fuseki2/
>>>>>>>>>>> fuseki-server-
>>>>>>>>>>>
>>>>>>>>>>> protocol.html
>>>>>>>>>>>
>>>>>>>>>>> POST /$/backup/{name}
>>>>>>>>>>>
>>>>>>>>>>> The admin interface has to be on the same port (WAR file
>>>>>>>>>>> deployment) and
>>>>>>>>>>> it's under /$/, protected by Shiro (this is what the UI does
>>>>>>>>>>> when you
>>>>>>>>>>> press
>>>>>>>>>>> the backup button)
>>>>>>>>>>>
>>>>>>>>>>> There was a very recent bug fix (a few days ago) - the backup
>>>>>>>>>>>was
>>>>>>>>>>> written
>>>>>>>>>>> to the wrong place. The latest build, it's written to
>>>>>>>>>>> $FUSEKI_BASE/backups/
>>>>>>>>>>>
>>>>>>>>>>>            Andy
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>
>>>>
>>>
>>





Re: Backup and Restore TDB using Fuseki2

Posted by Trevor Donaldson <tm...@gmail.com>.
Andy, WOOHOO!!!, it worked. Thanks man. I should have known something was
up when the backup file was 20 bytes. SMH!!! Everything is good. Thanks

On Sun, Mar 8, 2015 at 12:43 PM, Andy Seaborne <an...@apache.org> wrote:

> PS The development version is now 2.0.1-SNAPSHOT
>
>
> On 08/03/15 09:05, Andy Seaborne wrote:
>
>> Trevor,
>>
>> Sorry - I wasn't clear.  The exception would be in the Fuseki logs.
>>
>> The problem [*] was that the backup process was breaking as it started
>> to write the backup but it cleared up cleanly.  Net result - a valid
>> .nq.gz file of zero quads.
>>
>> [*] https://issues.apache.org/jira/browse/JENA-895
>> shows the exception.
>>
>> You need the latest Fuseki build and perform another backup.  Last
>> timne, it would have happened rather quickly.
>>
>> The sequence I used was:
>> 1/ Clear $FUSEKI_BASE
>> 2/ Start Fuseki2
>> 3/ Create database
>> 4/ Load data via the UI
>> 5/ Query to check the data
>> 6/ Perform backup
>> 7/ Wait for backup to finish
>>     (it is done async so look in the Fuseki logs)
>> 8/ Stop fuseki
>> 9/ Clean database location
>> 10/ Load with data tdbloader
>> 11/ Restart Fuseki
>>
>> Your sequence for loading the data is fine.
>>
>>      Andy
>>
>> On 08/03/15 00:34, Trevor Donaldson wrote:
>>
>>> Andy I don't see any exception when I run tdbloader but I data still
>>> isn't
>>> being imported. Should I try to get another backup using version
>>> 2015-03-07
>>> build? I just used the same backup version I already had. Just to make
>>> sure
>>> I am doing it correctly. This is my process.
>>>
>>> 1. Click backup from fuseki ui
>>> 2. remove all files in (rm -rf $FUSEKI_HOME/databases/myapp/*)
>>> 3. downloaded apache-jena-2.12.1
>>> 4. ran bin/tdbloader --loc=$FUSEKI_HOME/databases/myapp
>>> backups/backup_file.nq.gz
>>> 5. restart fuseki
>>> 6. SELECT (COUNT(*) as ?no) ?g
>>> WHERE {
>>>    GRAPH ?g {?s ?p ?o}
>>> }
>>>
>>
>>
>>
>>
>>> I get no results. I get no exception. This is the output from tdbloader.
>>>
>>> 19:24:45 INFO  loader               :: -- Start triples data phase
>>> 19:24:45 INFO  loader               :: ** Load empty triples table
>>> 19:24:45 INFO  loader               :: -- Start quads data phase
>>> 19:24:45 INFO  loader               :: ** Load empty quads table
>>> 19:24:45 INFO  loader               :: Load:
>>> $BACKUP_DIR/backups/myapp_2015-03-06_17-03-52.nq.gz -- 2015/03/07
>>> 19:24:45
>>> EST
>>> 19:24:45 INFO  loader               :: -- Finish triples data phase
>>> 19:24:45 INFO  loader               :: -- Finish quads data phase
>>> 19:24:45 INFO  loader               :: -- Finish triples load
>>> 19:24:45 INFO  loader               :: -- Finish quads load
>>>
>>>
>>> On Sat, Mar 7, 2015 at 1:03 PM, Trevor Donaldson <tm...@gmail.com>
>>> wrote:
>>>
>>>  Ok haven't  had a chance to check the exception. Thanks
>>>> On Mar 7, 2015 12:34 PM, "Andy Seaborne" <an...@apache.org> wrote:
>>>>
>>>>  On 07/03/15 10:46, Andy Seaborne wrote:
>>>>>
>>>>>  On 06/03/15 22:31, Trevor Donaldson wrote:
>>>>>>
>>>>>>  so not seeing data. I may have done something incorrect.
>>>>>>>
>>>>>>>
>>>>>> No, you're not ... :-(
>>>>>>
>>>>>> Is there an exception in log file?
>>>>>>
>>>>>> ------------------
>>>>>> [2015-03-07 10:20:49] Backup     INFO  [11] **** Exception in backup
>>>>>> com.hp.hpl.jena.tdb.transaction.TDBTransactionException: Not in a
>>>>>> transaction
>>>>>> ------------------
>>>>>>
>>>>>>
>>>>>> Recorded as JENA-895
>>>>>>
>>>>>> (either there has been a regression in the code or all the development
>>>>>> work happen to find a timing hole whereby it can work if the backup
>>>>>> happens very early in a server's life)
>>>>>>
>>>>>>       Andy
>>>>>>
>>>>>>
>>>>> Assuming you were getting the same exception as I found, this should be
>>>>> fixed. I've done a "deploy" as well so built development binaries
>>>>> are up to
>>>>> date.
>>>>>
>>>>>          Andy
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>>  1. Backed up dataset
>>>>>>> 2. Deleted all files in ($FUSEKI_HOME/run/databases/myapp)
>>>>>>> 3. tdbloader --loc=$FUSEKI_HOME/run/databases/myapp backup.nq.gz
>>>>>>> 4. restarted fuseki.
>>>>>>> 5. went to count triples on fuseki web page. Counts are all 0.
>>>>>>>
>>>>>>>
>>>>>>> On Fri, Mar 6, 2015 at 3:28 PM, Andy Seaborne <an...@apache.org>
>>>>>>> wrote:
>>>>>>>
>>>>>>>   On 06/03/15 18:10, Trevor Donaldson wrote:
>>>>>>>
>>>>>>>>
>>>>>>>>   Thanks Andy the link is very helpful. I am assuming that in
>>>>>>>> order to
>>>>>>>>
>>>>>>>>> reimport I would use tdbloader. Is this right?
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>  yes - backups are compressed n-quads, .nq.gz
>>>>>>>>
>>>>>>>>           Andy
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>   On Fri, Mar 6, 2015 at 12:47 PM, Andy Seaborne <an...@apache.org>
>>>>>>>>
>>>>>>>>> wrote:
>>>>>>>>>
>>>>>>>>>    On 06/03/15 16:29, Trevor Donaldson wrote:
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>>    Hi all,
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>>      I was wondering if there is a way to programmatically backup
>>>>>>>>>>> the tdb
>>>>>>>>>>> instance? I found this question
>>>>>>>>>>> http://webcache.googleusercontent.com/search?
>>>>>>>>>>> q=cache:0whNmMD65OcJ:answers.semanticweb.com/questions/
>>>>>>>>>>> 24740/how-do-you-create-and-restore-backups-with-fuseki-
>>>>>>>>>>> and-tdb+&cd=3&hl=en&ct=clnk&gl=us
>>>>>>>>>>> but it is referencing fuseki 1 (i.e. --mgtPort=port). Is there
>>>>>>>>>>> another
>>>>>>>>>>> way
>>>>>>>>>>> that a backup and a restore should be handled in fuseki2?
>>>>>>>>>>>
>>>>>>>>>>> Thanks in advance,
>>>>>>>>>>>
>>>>>>>>>>> Trevor
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>    See staging documentation:
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>> http://jena.staging.apache.org/documentation/fuseki2/
>>>>>>>>>> fuseki-server-
>>>>>>>>>>
>>>>>>>>>> protocol.html
>>>>>>>>>>
>>>>>>>>>> POST /$/backup/{name}
>>>>>>>>>>
>>>>>>>>>> The admin interface has to be on the same port (WAR file
>>>>>>>>>> deployment) and
>>>>>>>>>> it's under /$/, protected by Shiro (this is what the UI does
>>>>>>>>>> when you
>>>>>>>>>> press
>>>>>>>>>> the backup button)
>>>>>>>>>>
>>>>>>>>>> There was a very recent bug fix (a few days ago) - the backup was
>>>>>>>>>> written
>>>>>>>>>> to the wrong place. The latest build, it's written to
>>>>>>>>>> $FUSEKI_BASE/backups/
>>>>>>>>>>
>>>>>>>>>>            Andy
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>
>>>>>
>>>
>>
>

Re: Backup and Restore TDB using Fuseki2

Posted by Andy Seaborne <an...@apache.org>.
PS The development version is now 2.0.1-SNAPSHOT

On 08/03/15 09:05, Andy Seaborne wrote:
> Trevor,
>
> Sorry - I wasn't clear.  The exception would be in the Fuseki logs.
>
> The problem [*] was that the backup process was breaking as it started
> to write the backup but it cleared up cleanly.  Net result - a valid
> .nq.gz file of zero quads.
>
> [*] https://issues.apache.org/jira/browse/JENA-895
> shows the exception.
>
> You need the latest Fuseki build and perform another backup.  Last
> timne, it would have happened rather quickly.
>
> The sequence I used was:
> 1/ Clear $FUSEKI_BASE
> 2/ Start Fuseki2
> 3/ Create database
> 4/ Load data via the UI
> 5/ Query to check the data
> 6/ Perform backup
> 7/ Wait for backup to finish
>     (it is done async so look in the Fuseki logs)
> 8/ Stop fuseki
> 9/ Clean database location
> 10/ Load with data tdbloader
> 11/ Restart Fuseki
>
> Your sequence for loading the data is fine.
>
>      Andy
>
> On 08/03/15 00:34, Trevor Donaldson wrote:
>> Andy I don't see any exception when I run tdbloader but I data still
>> isn't
>> being imported. Should I try to get another backup using version
>> 2015-03-07
>> build? I just used the same backup version I already had. Just to make
>> sure
>> I am doing it correctly. This is my process.
>>
>> 1. Click backup from fuseki ui
>> 2. remove all files in (rm -rf $FUSEKI_HOME/databases/myapp/*)
>> 3. downloaded apache-jena-2.12.1
>> 4. ran bin/tdbloader --loc=$FUSEKI_HOME/databases/myapp
>> backups/backup_file.nq.gz
>> 5. restart fuseki
>> 6. SELECT (COUNT(*) as ?no) ?g
>> WHERE {
>>    GRAPH ?g {?s ?p ?o}
>> }
>
>
>
>>
>> I get no results. I get no exception. This is the output from tdbloader.
>>
>> 19:24:45 INFO  loader               :: -- Start triples data phase
>> 19:24:45 INFO  loader               :: ** Load empty triples table
>> 19:24:45 INFO  loader               :: -- Start quads data phase
>> 19:24:45 INFO  loader               :: ** Load empty quads table
>> 19:24:45 INFO  loader               :: Load:
>> $BACKUP_DIR/backups/myapp_2015-03-06_17-03-52.nq.gz -- 2015/03/07
>> 19:24:45
>> EST
>> 19:24:45 INFO  loader               :: -- Finish triples data phase
>> 19:24:45 INFO  loader               :: -- Finish quads data phase
>> 19:24:45 INFO  loader               :: -- Finish triples load
>> 19:24:45 INFO  loader               :: -- Finish quads load
>>
>>
>> On Sat, Mar 7, 2015 at 1:03 PM, Trevor Donaldson <tm...@gmail.com>
>> wrote:
>>
>>> Ok haven't  had a chance to check the exception. Thanks
>>> On Mar 7, 2015 12:34 PM, "Andy Seaborne" <an...@apache.org> wrote:
>>>
>>>> On 07/03/15 10:46, Andy Seaborne wrote:
>>>>
>>>>> On 06/03/15 22:31, Trevor Donaldson wrote:
>>>>>
>>>>>> so not seeing data. I may have done something incorrect.
>>>>>>
>>>>>
>>>>> No, you're not ... :-(
>>>>>
>>>>> Is there an exception in log file?
>>>>>
>>>>> ------------------
>>>>> [2015-03-07 10:20:49] Backup     INFO  [11] **** Exception in backup
>>>>> com.hp.hpl.jena.tdb.transaction.TDBTransactionException: Not in a
>>>>> transaction
>>>>> ------------------
>>>>>
>>>>>
>>>>> Recorded as JENA-895
>>>>>
>>>>> (either there has been a regression in the code or all the development
>>>>> work happen to find a timing hole whereby it can work if the backup
>>>>> happens very early in a server's life)
>>>>>
>>>>>       Andy
>>>>>
>>>>
>>>> Assuming you were getting the same exception as I found, this should be
>>>> fixed. I've done a "deploy" as well so built development binaries
>>>> are up to
>>>> date.
>>>>
>>>>          Andy
>>>>
>>>>
>>>>
>>>>>
>>>>>> 1. Backed up dataset
>>>>>> 2. Deleted all files in ($FUSEKI_HOME/run/databases/myapp)
>>>>>> 3. tdbloader --loc=$FUSEKI_HOME/run/databases/myapp backup.nq.gz
>>>>>> 4. restarted fuseki.
>>>>>> 5. went to count triples on fuseki web page. Counts are all 0.
>>>>>>
>>>>>>
>>>>>> On Fri, Mar 6, 2015 at 3:28 PM, Andy Seaborne <an...@apache.org>
>>>>>> wrote:
>>>>>>
>>>>>>   On 06/03/15 18:10, Trevor Donaldson wrote:
>>>>>>>
>>>>>>>   Thanks Andy the link is very helpful. I am assuming that in
>>>>>>> order to
>>>>>>>> reimport I would use tdbloader. Is this right?
>>>>>>>>
>>>>>>>>
>>>>>>> yes - backups are compressed n-quads, .nq.gz
>>>>>>>
>>>>>>>           Andy
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>   On Fri, Mar 6, 2015 at 12:47 PM, Andy Seaborne <an...@apache.org>
>>>>>>>> wrote:
>>>>>>>>
>>>>>>>>    On 06/03/15 16:29, Trevor Donaldson wrote:
>>>>>>>>
>>>>>>>>>
>>>>>>>>>    Hi all,
>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>      I was wondering if there is a way to programmatically backup
>>>>>>>>>> the tdb
>>>>>>>>>> instance? I found this question
>>>>>>>>>> http://webcache.googleusercontent.com/search?
>>>>>>>>>> q=cache:0whNmMD65OcJ:answers.semanticweb.com/questions/
>>>>>>>>>> 24740/how-do-you-create-and-restore-backups-with-fuseki-
>>>>>>>>>> and-tdb+&cd=3&hl=en&ct=clnk&gl=us
>>>>>>>>>> but it is referencing fuseki 1 (i.e. --mgtPort=port). Is there
>>>>>>>>>> another
>>>>>>>>>> way
>>>>>>>>>> that a backup and a restore should be handled in fuseki2?
>>>>>>>>>>
>>>>>>>>>> Thanks in advance,
>>>>>>>>>>
>>>>>>>>>> Trevor
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>    See staging documentation:
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>> http://jena.staging.apache.org/documentation/fuseki2/fuseki-server-
>>>>>>>>>
>>>>>>>>> protocol.html
>>>>>>>>>
>>>>>>>>> POST /$/backup/{name}
>>>>>>>>>
>>>>>>>>> The admin interface has to be on the same port (WAR file
>>>>>>>>> deployment) and
>>>>>>>>> it's under /$/, protected by Shiro (this is what the UI does
>>>>>>>>> when you
>>>>>>>>> press
>>>>>>>>> the backup button)
>>>>>>>>>
>>>>>>>>> There was a very recent bug fix (a few days ago) - the backup was
>>>>>>>>> written
>>>>>>>>> to the wrong place. The latest build, it's written to
>>>>>>>>> $FUSEKI_BASE/backups/
>>>>>>>>>
>>>>>>>>>            Andy
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>
>>>>>
>>>>
>>
>


Re: Backup and Restore TDB using Fuseki2

Posted by Andy Seaborne <an...@apache.org>.
Trevor,

Sorry - I wasn't clear.  The exception would be in the Fuseki logs.

The problem [*] was that the backup process was breaking as it started 
to write the backup but it cleared up cleanly.  Net result - a valid 
.nq.gz file of zero quads.

[*] https://issues.apache.org/jira/browse/JENA-895
shows the exception.

You need the latest Fuseki build and perform another backup.  Last 
timne, it would have happened rather quickly.

The sequence I used was:
1/ Clear $FUSEKI_BASE
2/ Start Fuseki2
3/ Create database
4/ Load data via the UI
5/ Query to check the data
6/ Perform backup
7/ Wait for backup to finish
    (it is done async so look in the Fuseki logs)
8/ Stop fuseki
9/ Clean database location
10/ Load with data tdbloader
11/ Restart Fuseki

Your sequence for loading the data is fine.

	Andy

On 08/03/15 00:34, Trevor Donaldson wrote:
> Andy I don't see any exception when I run tdbloader but I data still isn't
> being imported. Should I try to get another backup using version 2015-03-07
> build? I just used the same backup version I already had. Just to make sure
> I am doing it correctly. This is my process.
>
> 1. Click backup from fuseki ui
> 2. remove all files in (rm -rf $FUSEKI_HOME/databases/myapp/*)
> 3. downloaded apache-jena-2.12.1
> 4. ran bin/tdbloader --loc=$FUSEKI_HOME/databases/myapp
> backups/backup_file.nq.gz
> 5. restart fuseki
> 6. SELECT (COUNT(*) as ?no) ?g
> WHERE {
>    GRAPH ?g {?s ?p ?o}
> }



>
> I get no results. I get no exception. This is the output from tdbloader.
>
> 19:24:45 INFO  loader               :: -- Start triples data phase
> 19:24:45 INFO  loader               :: ** Load empty triples table
> 19:24:45 INFO  loader               :: -- Start quads data phase
> 19:24:45 INFO  loader               :: ** Load empty quads table
> 19:24:45 INFO  loader               :: Load:
> $BACKUP_DIR/backups/myapp_2015-03-06_17-03-52.nq.gz -- 2015/03/07 19:24:45
> EST
> 19:24:45 INFO  loader               :: -- Finish triples data phase
> 19:24:45 INFO  loader               :: -- Finish quads data phase
> 19:24:45 INFO  loader               :: -- Finish triples load
> 19:24:45 INFO  loader               :: -- Finish quads load
>
>
> On Sat, Mar 7, 2015 at 1:03 PM, Trevor Donaldson <tm...@gmail.com>
> wrote:
>
>> Ok haven't  had a chance to check the exception. Thanks
>> On Mar 7, 2015 12:34 PM, "Andy Seaborne" <an...@apache.org> wrote:
>>
>>> On 07/03/15 10:46, Andy Seaborne wrote:
>>>
>>>> On 06/03/15 22:31, Trevor Donaldson wrote:
>>>>
>>>>> so not seeing data. I may have done something incorrect.
>>>>>
>>>>
>>>> No, you're not ... :-(
>>>>
>>>> Is there an exception in log file?
>>>>
>>>> ------------------
>>>> [2015-03-07 10:20:49] Backup     INFO  [11] **** Exception in backup
>>>> com.hp.hpl.jena.tdb.transaction.TDBTransactionException: Not in a
>>>> transaction
>>>> ------------------
>>>>
>>>>
>>>> Recorded as JENA-895
>>>>
>>>> (either there has been a regression in the code or all the development
>>>> work happen to find a timing hole whereby it can work if the backup
>>>> happens very early in a server's life)
>>>>
>>>>       Andy
>>>>
>>>
>>> Assuming you were getting the same exception as I found, this should be
>>> fixed. I've done a "deploy" as well so built development binaries are up to
>>> date.
>>>
>>>          Andy
>>>
>>>
>>>
>>>>
>>>>> 1. Backed up dataset
>>>>> 2. Deleted all files in ($FUSEKI_HOME/run/databases/myapp)
>>>>> 3. tdbloader --loc=$FUSEKI_HOME/run/databases/myapp backup.nq.gz
>>>>> 4. restarted fuseki.
>>>>> 5. went to count triples on fuseki web page. Counts are all 0.
>>>>>
>>>>>
>>>>> On Fri, Mar 6, 2015 at 3:28 PM, Andy Seaborne <an...@apache.org> wrote:
>>>>>
>>>>>   On 06/03/15 18:10, Trevor Donaldson wrote:
>>>>>>
>>>>>>   Thanks Andy the link is very helpful. I am assuming that in order to
>>>>>>> reimport I would use tdbloader. Is this right?
>>>>>>>
>>>>>>>
>>>>>> yes - backups are compressed n-quads, .nq.gz
>>>>>>
>>>>>>           Andy
>>>>>>
>>>>>>
>>>>>>
>>>>>>   On Fri, Mar 6, 2015 at 12:47 PM, Andy Seaborne <an...@apache.org>
>>>>>>> wrote:
>>>>>>>
>>>>>>>    On 06/03/15 16:29, Trevor Donaldson wrote:
>>>>>>>
>>>>>>>>
>>>>>>>>    Hi all,
>>>>>>>>
>>>>>>>>>
>>>>>>>>>      I was wondering if there is a way to programmatically backup
>>>>>>>>> the tdb
>>>>>>>>> instance? I found this question
>>>>>>>>> http://webcache.googleusercontent.com/search?
>>>>>>>>> q=cache:0whNmMD65OcJ:answers.semanticweb.com/questions/
>>>>>>>>> 24740/how-do-you-create-and-restore-backups-with-fuseki-
>>>>>>>>> and-tdb+&cd=3&hl=en&ct=clnk&gl=us
>>>>>>>>> but it is referencing fuseki 1 (i.e. --mgtPort=port). Is there
>>>>>>>>> another
>>>>>>>>> way
>>>>>>>>> that a backup and a restore should be handled in fuseki2?
>>>>>>>>>
>>>>>>>>> Thanks in advance,
>>>>>>>>>
>>>>>>>>> Trevor
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>    See staging documentation:
>>>>>>>>>
>>>>>>>>
>>>>>>>> http://jena.staging.apache.org/documentation/fuseki2/fuseki-server-
>>>>>>>> protocol.html
>>>>>>>>
>>>>>>>> POST /$/backup/{name}
>>>>>>>>
>>>>>>>> The admin interface has to be on the same port (WAR file
>>>>>>>> deployment) and
>>>>>>>> it's under /$/, protected by Shiro (this is what the UI does when you
>>>>>>>> press
>>>>>>>> the backup button)
>>>>>>>>
>>>>>>>> There was a very recent bug fix (a few days ago) - the backup was
>>>>>>>> written
>>>>>>>> to the wrong place. The latest build, it's written to
>>>>>>>> $FUSEKI_BASE/backups/
>>>>>>>>
>>>>>>>>            Andy
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>
>>>>>
>>>>
>>>
>


Re: Backup and Restore TDB using Fuseki2

Posted by Trevor Donaldson <tm...@gmail.com>.
Andy I don't see any exception when I run tdbloader but I data still isn't
being imported. Should I try to get another backup using version 2015-03-07
build? I just used the same backup version I already had. Just to make sure
I am doing it correctly. This is my process.

1. Click backup from fuseki ui
2. remove all files in (rm -rf $FUSEKI_HOME/databases/myapp/*)
3. downloaded apache-jena-2.12.1
4. ran bin/tdbloader --loc=$FUSEKI_HOME/databases/myapp
backups/backup_file.nq.gz
5. restart fuseki
6. SELECT (COUNT(*) as ?no) ?g
WHERE {
  GRAPH ?g {?s ?p ?o}
}

I get no results. I get no exception. This is the output from tdbloader.

19:24:45 INFO  loader               :: -- Start triples data phase
19:24:45 INFO  loader               :: ** Load empty triples table
19:24:45 INFO  loader               :: -- Start quads data phase
19:24:45 INFO  loader               :: ** Load empty quads table
19:24:45 INFO  loader               :: Load:
$BACKUP_DIR/backups/myapp_2015-03-06_17-03-52.nq.gz -- 2015/03/07 19:24:45
EST
19:24:45 INFO  loader               :: -- Finish triples data phase
19:24:45 INFO  loader               :: -- Finish quads data phase
19:24:45 INFO  loader               :: -- Finish triples load
19:24:45 INFO  loader               :: -- Finish quads load


On Sat, Mar 7, 2015 at 1:03 PM, Trevor Donaldson <tm...@gmail.com>
wrote:

> Ok haven't  had a chance to check the exception. Thanks
> On Mar 7, 2015 12:34 PM, "Andy Seaborne" <an...@apache.org> wrote:
>
>> On 07/03/15 10:46, Andy Seaborne wrote:
>>
>>> On 06/03/15 22:31, Trevor Donaldson wrote:
>>>
>>>> so not seeing data. I may have done something incorrect.
>>>>
>>>
>>> No, you're not ... :-(
>>>
>>> Is there an exception in log file?
>>>
>>> ------------------
>>> [2015-03-07 10:20:49] Backup     INFO  [11] **** Exception in backup
>>> com.hp.hpl.jena.tdb.transaction.TDBTransactionException: Not in a
>>> transaction
>>> ------------------
>>>
>>>
>>> Recorded as JENA-895
>>>
>>> (either there has been a regression in the code or all the development
>>> work happen to find a timing hole whereby it can work if the backup
>>> happens very early in a server's life)
>>>
>>>      Andy
>>>
>>
>> Assuming you were getting the same exception as I found, this should be
>> fixed. I've done a "deploy" as well so built development binaries are up to
>> date.
>>
>>         Andy
>>
>>
>>
>>>
>>>> 1. Backed up dataset
>>>> 2. Deleted all files in ($FUSEKI_HOME/run/databases/myapp)
>>>> 3. tdbloader --loc=$FUSEKI_HOME/run/databases/myapp backup.nq.gz
>>>> 4. restarted fuseki.
>>>> 5. went to count triples on fuseki web page. Counts are all 0.
>>>>
>>>>
>>>> On Fri, Mar 6, 2015 at 3:28 PM, Andy Seaborne <an...@apache.org> wrote:
>>>>
>>>>  On 06/03/15 18:10, Trevor Donaldson wrote:
>>>>>
>>>>>  Thanks Andy the link is very helpful. I am assuming that in order to
>>>>>> reimport I would use tdbloader. Is this right?
>>>>>>
>>>>>>
>>>>> yes - backups are compressed n-quads, .nq.gz
>>>>>
>>>>>          Andy
>>>>>
>>>>>
>>>>>
>>>>>  On Fri, Mar 6, 2015 at 12:47 PM, Andy Seaborne <an...@apache.org>
>>>>>> wrote:
>>>>>>
>>>>>>   On 06/03/15 16:29, Trevor Donaldson wrote:
>>>>>>
>>>>>>>
>>>>>>>   Hi all,
>>>>>>>
>>>>>>>>
>>>>>>>>     I was wondering if there is a way to programmatically backup
>>>>>>>> the tdb
>>>>>>>> instance? I found this question
>>>>>>>> http://webcache.googleusercontent.com/search?
>>>>>>>> q=cache:0whNmMD65OcJ:answers.semanticweb.com/questions/
>>>>>>>> 24740/how-do-you-create-and-restore-backups-with-fuseki-
>>>>>>>> and-tdb+&cd=3&hl=en&ct=clnk&gl=us
>>>>>>>> but it is referencing fuseki 1 (i.e. --mgtPort=port). Is there
>>>>>>>> another
>>>>>>>> way
>>>>>>>> that a backup and a restore should be handled in fuseki2?
>>>>>>>>
>>>>>>>> Thanks in advance,
>>>>>>>>
>>>>>>>> Trevor
>>>>>>>>
>>>>>>>>
>>>>>>>>   See staging documentation:
>>>>>>>>
>>>>>>>
>>>>>>> http://jena.staging.apache.org/documentation/fuseki2/fuseki-server-
>>>>>>> protocol.html
>>>>>>>
>>>>>>> POST /$/backup/{name}
>>>>>>>
>>>>>>> The admin interface has to be on the same port (WAR file
>>>>>>> deployment) and
>>>>>>> it's under /$/, protected by Shiro (this is what the UI does when you
>>>>>>> press
>>>>>>> the backup button)
>>>>>>>
>>>>>>> There was a very recent bug fix (a few days ago) - the backup was
>>>>>>> written
>>>>>>> to the wrong place. The latest build, it's written to
>>>>>>> $FUSEKI_BASE/backups/
>>>>>>>
>>>>>>>           Andy
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>
>>>>
>>>
>>

Re: Backup and Restore TDB using Fuseki2

Posted by Trevor Donaldson <tm...@gmail.com>.
Ok haven't  had a chance to check the exception. Thanks
On Mar 7, 2015 12:34 PM, "Andy Seaborne" <an...@apache.org> wrote:

> On 07/03/15 10:46, Andy Seaborne wrote:
>
>> On 06/03/15 22:31, Trevor Donaldson wrote:
>>
>>> so not seeing data. I may have done something incorrect.
>>>
>>
>> No, you're not ... :-(
>>
>> Is there an exception in log file?
>>
>> ------------------
>> [2015-03-07 10:20:49] Backup     INFO  [11] **** Exception in backup
>> com.hp.hpl.jena.tdb.transaction.TDBTransactionException: Not in a
>> transaction
>> ------------------
>>
>>
>> Recorded as JENA-895
>>
>> (either there has been a regression in the code or all the development
>> work happen to find a timing hole whereby it can work if the backup
>> happens very early in a server's life)
>>
>>      Andy
>>
>
> Assuming you were getting the same exception as I found, this should be
> fixed. I've done a "deploy" as well so built development binaries are up to
> date.
>
>         Andy
>
>
>
>>
>>> 1. Backed up dataset
>>> 2. Deleted all files in ($FUSEKI_HOME/run/databases/myapp)
>>> 3. tdbloader --loc=$FUSEKI_HOME/run/databases/myapp backup.nq.gz
>>> 4. restarted fuseki.
>>> 5. went to count triples on fuseki web page. Counts are all 0.
>>>
>>>
>>> On Fri, Mar 6, 2015 at 3:28 PM, Andy Seaborne <an...@apache.org> wrote:
>>>
>>>  On 06/03/15 18:10, Trevor Donaldson wrote:
>>>>
>>>>  Thanks Andy the link is very helpful. I am assuming that in order to
>>>>> reimport I would use tdbloader. Is this right?
>>>>>
>>>>>
>>>> yes - backups are compressed n-quads, .nq.gz
>>>>
>>>>          Andy
>>>>
>>>>
>>>>
>>>>  On Fri, Mar 6, 2015 at 12:47 PM, Andy Seaborne <an...@apache.org>
>>>>> wrote:
>>>>>
>>>>>   On 06/03/15 16:29, Trevor Donaldson wrote:
>>>>>
>>>>>>
>>>>>>   Hi all,
>>>>>>
>>>>>>>
>>>>>>>     I was wondering if there is a way to programmatically backup
>>>>>>> the tdb
>>>>>>> instance? I found this question
>>>>>>> http://webcache.googleusercontent.com/search?
>>>>>>> q=cache:0whNmMD65OcJ:answers.semanticweb.com/questions/
>>>>>>> 24740/how-do-you-create-and-restore-backups-with-fuseki-
>>>>>>> and-tdb+&cd=3&hl=en&ct=clnk&gl=us
>>>>>>> but it is referencing fuseki 1 (i.e. --mgtPort=port). Is there
>>>>>>> another
>>>>>>> way
>>>>>>> that a backup and a restore should be handled in fuseki2?
>>>>>>>
>>>>>>> Thanks in advance,
>>>>>>>
>>>>>>> Trevor
>>>>>>>
>>>>>>>
>>>>>>>   See staging documentation:
>>>>>>>
>>>>>>
>>>>>> http://jena.staging.apache.org/documentation/fuseki2/fuseki-server-
>>>>>> protocol.html
>>>>>>
>>>>>> POST /$/backup/{name}
>>>>>>
>>>>>> The admin interface has to be on the same port (WAR file
>>>>>> deployment) and
>>>>>> it's under /$/, protected by Shiro (this is what the UI does when you
>>>>>> press
>>>>>> the backup button)
>>>>>>
>>>>>> There was a very recent bug fix (a few days ago) - the backup was
>>>>>> written
>>>>>> to the wrong place. The latest build, it's written to
>>>>>> $FUSEKI_BASE/backups/
>>>>>>
>>>>>>           Andy
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>
>>>
>>
>

Re: Backup and Restore TDB using Fuseki2

Posted by Andy Seaborne <an...@apache.org>.
On 07/03/15 10:46, Andy Seaborne wrote:
> On 06/03/15 22:31, Trevor Donaldson wrote:
>> so not seeing data. I may have done something incorrect.
>
> No, you're not ... :-(
>
> Is there an exception in log file?
>
> ------------------
> [2015-03-07 10:20:49] Backup     INFO  [11] **** Exception in backup
> com.hp.hpl.jena.tdb.transaction.TDBTransactionException: Not in a
> transaction
> ------------------
>
>
> Recorded as JENA-895
>
> (either there has been a regression in the code or all the development
> work happen to find a timing hole whereby it can work if the backup
> happens very early in a server's life)
>
>      Andy

Assuming you were getting the same exception as I found, this should be 
fixed. I've done a "deploy" as well so built development binaries are up 
to date.

	Andy


>
>>
>> 1. Backed up dataset
>> 2. Deleted all files in ($FUSEKI_HOME/run/databases/myapp)
>> 3. tdbloader --loc=$FUSEKI_HOME/run/databases/myapp backup.nq.gz
>> 4. restarted fuseki.
>> 5. went to count triples on fuseki web page. Counts are all 0.
>>
>>
>> On Fri, Mar 6, 2015 at 3:28 PM, Andy Seaborne <an...@apache.org> wrote:
>>
>>> On 06/03/15 18:10, Trevor Donaldson wrote:
>>>
>>>> Thanks Andy the link is very helpful. I am assuming that in order to
>>>> reimport I would use tdbloader. Is this right?
>>>>
>>>
>>> yes - backups are compressed n-quads, .nq.gz
>>>
>>>          Andy
>>>
>>>
>>>
>>>> On Fri, Mar 6, 2015 at 12:47 PM, Andy Seaborne <an...@apache.org> wrote:
>>>>
>>>>   On 06/03/15 16:29, Trevor Donaldson wrote:
>>>>>
>>>>>   Hi all,
>>>>>>
>>>>>>     I was wondering if there is a way to programmatically backup
>>>>>> the tdb
>>>>>> instance? I found this question
>>>>>> http://webcache.googleusercontent.com/search?
>>>>>> q=cache:0whNmMD65OcJ:answers.semanticweb.com/questions/
>>>>>> 24740/how-do-you-create-and-restore-backups-with-fuseki-
>>>>>> and-tdb+&cd=3&hl=en&ct=clnk&gl=us
>>>>>> but it is referencing fuseki 1 (i.e. --mgtPort=port). Is there
>>>>>> another
>>>>>> way
>>>>>> that a backup and a restore should be handled in fuseki2?
>>>>>>
>>>>>> Thanks in advance,
>>>>>>
>>>>>> Trevor
>>>>>>
>>>>>>
>>>>>>   See staging documentation:
>>>>>
>>>>> http://jena.staging.apache.org/documentation/fuseki2/fuseki-server-
>>>>> protocol.html
>>>>>
>>>>> POST /$/backup/{name}
>>>>>
>>>>> The admin interface has to be on the same port (WAR file
>>>>> deployment) and
>>>>> it's under /$/, protected by Shiro (this is what the UI does when you
>>>>> press
>>>>> the backup button)
>>>>>
>>>>> There was a very recent bug fix (a few days ago) - the backup was
>>>>> written
>>>>> to the wrong place. The latest build, it's written to
>>>>> $FUSEKI_BASE/backups/
>>>>>
>>>>>           Andy
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>
>>
>


Re: Backup and Restore TDB using Fuseki2

Posted by Andy Seaborne <an...@apache.org>.
On 06/03/15 22:31, Trevor Donaldson wrote:
> so not seeing data. I may have done something incorrect.

No, you're not ... :-(

Is there an exception in log file?

------------------
[2015-03-07 10:20:49] Backup     INFO  [11] **** Exception in backup
com.hp.hpl.jena.tdb.transaction.TDBTransactionException: Not in a 
transaction
------------------


Recorded as JENA-895

(either there has been a regression in the code or all the development 
work happen to find a timing hole whereby it can work if the backup 
happens very early in a server's life)

	Andy

>
> 1. Backed up dataset
> 2. Deleted all files in ($FUSEKI_HOME/run/databases/myapp)
> 3. tdbloader --loc=$FUSEKI_HOME/run/databases/myapp backup.nq.gz
> 4. restarted fuseki.
> 5. went to count triples on fuseki web page. Counts are all 0.
>
>
> On Fri, Mar 6, 2015 at 3:28 PM, Andy Seaborne <an...@apache.org> wrote:
>
>> On 06/03/15 18:10, Trevor Donaldson wrote:
>>
>>> Thanks Andy the link is very helpful. I am assuming that in order to
>>> reimport I would use tdbloader. Is this right?
>>>
>>
>> yes - backups are compressed n-quads, .nq.gz
>>
>>          Andy
>>
>>
>>
>>> On Fri, Mar 6, 2015 at 12:47 PM, Andy Seaborne <an...@apache.org> wrote:
>>>
>>>   On 06/03/15 16:29, Trevor Donaldson wrote:
>>>>
>>>>   Hi all,
>>>>>
>>>>>     I was wondering if there is a way to programmatically backup the tdb
>>>>> instance? I found this question
>>>>> http://webcache.googleusercontent.com/search?
>>>>> q=cache:0whNmMD65OcJ:answers.semanticweb.com/questions/
>>>>> 24740/how-do-you-create-and-restore-backups-with-fuseki-
>>>>> and-tdb+&cd=3&hl=en&ct=clnk&gl=us
>>>>> but it is referencing fuseki 1 (i.e. --mgtPort=port). Is there another
>>>>> way
>>>>> that a backup and a restore should be handled in fuseki2?
>>>>>
>>>>> Thanks in advance,
>>>>>
>>>>> Trevor
>>>>>
>>>>>
>>>>>   See staging documentation:
>>>>
>>>> http://jena.staging.apache.org/documentation/fuseki2/fuseki-server-
>>>> protocol.html
>>>>
>>>> POST /$/backup/{name}
>>>>
>>>> The admin interface has to be on the same port (WAR file deployment) and
>>>> it's under /$/, protected by Shiro (this is what the UI does when you
>>>> press
>>>> the backup button)
>>>>
>>>> There was a very recent bug fix (a few days ago) - the backup was written
>>>> to the wrong place. The latest build, it's written to
>>>> $FUSEKI_BASE/backups/
>>>>
>>>>           Andy
>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>
>


Re: Backup and Restore TDB using Fuseki2

Posted by Trevor Donaldson <tm...@gmail.com>.
so not seeing data. I may have done something incorrect.

1. Backed up dataset
2. Deleted all files in ($FUSEKI_HOME/run/databases/myapp)
3. tdbloader --loc=$FUSEKI_HOME/run/databases/myapp backup.nq.gz
4. restarted fuseki.
5. went to count triples on fuseki web page. Counts are all 0.


On Fri, Mar 6, 2015 at 3:28 PM, Andy Seaborne <an...@apache.org> wrote:

> On 06/03/15 18:10, Trevor Donaldson wrote:
>
>> Thanks Andy the link is very helpful. I am assuming that in order to
>> reimport I would use tdbloader. Is this right?
>>
>
> yes - backups are compressed n-quads, .nq.gz
>
>         Andy
>
>
>
>> On Fri, Mar 6, 2015 at 12:47 PM, Andy Seaborne <an...@apache.org> wrote:
>>
>>  On 06/03/15 16:29, Trevor Donaldson wrote:
>>>
>>>  Hi all,
>>>>
>>>>    I was wondering if there is a way to programmatically backup the tdb
>>>> instance? I found this question
>>>> http://webcache.googleusercontent.com/search?
>>>> q=cache:0whNmMD65OcJ:answers.semanticweb.com/questions/
>>>> 24740/how-do-you-create-and-restore-backups-with-fuseki-
>>>> and-tdb+&cd=3&hl=en&ct=clnk&gl=us
>>>> but it is referencing fuseki 1 (i.e. --mgtPort=port). Is there another
>>>> way
>>>> that a backup and a restore should be handled in fuseki2?
>>>>
>>>> Thanks in advance,
>>>>
>>>> Trevor
>>>>
>>>>
>>>>  See staging documentation:
>>>
>>> http://jena.staging.apache.org/documentation/fuseki2/fuseki-server-
>>> protocol.html
>>>
>>> POST /$/backup/{name}
>>>
>>> The admin interface has to be on the same port (WAR file deployment) and
>>> it's under /$/, protected by Shiro (this is what the UI does when you
>>> press
>>> the backup button)
>>>
>>> There was a very recent bug fix (a few days ago) - the backup was written
>>> to the wrong place. The latest build, it's written to
>>> $FUSEKI_BASE/backups/
>>>
>>>          Andy
>>>
>>>
>>>
>>>
>>>
>>
>

Re: Backup and Restore TDB using Fuseki2

Posted by Andy Seaborne <an...@apache.org>.
On 06/03/15 18:10, Trevor Donaldson wrote:
> Thanks Andy the link is very helpful. I am assuming that in order to
> reimport I would use tdbloader. Is this right?

yes - backups are compressed n-quads, .nq.gz

	Andy

>
> On Fri, Mar 6, 2015 at 12:47 PM, Andy Seaborne <an...@apache.org> wrote:
>
>> On 06/03/15 16:29, Trevor Donaldson wrote:
>>
>>> Hi all,
>>>
>>>    I was wondering if there is a way to programmatically backup the tdb
>>> instance? I found this question
>>> http://webcache.googleusercontent.com/search?
>>> q=cache:0whNmMD65OcJ:answers.semanticweb.com/questions/
>>> 24740/how-do-you-create-and-restore-backups-with-fuseki-
>>> and-tdb+&cd=3&hl=en&ct=clnk&gl=us
>>> but it is referencing fuseki 1 (i.e. --mgtPort=port). Is there another way
>>> that a backup and a restore should be handled in fuseki2?
>>>
>>> Thanks in advance,
>>>
>>> Trevor
>>>
>>>
>> See staging documentation:
>>
>> http://jena.staging.apache.org/documentation/fuseki2/fuseki-server-
>> protocol.html
>>
>> POST /$/backup/{name}
>>
>> The admin interface has to be on the same port (WAR file deployment) and
>> it's under /$/, protected by Shiro (this is what the UI does when you press
>> the backup button)
>>
>> There was a very recent bug fix (a few days ago) - the backup was written
>> to the wrong place. The latest build, it's written to $FUSEKI_BASE/backups/
>>
>>          Andy
>>
>>
>>
>>
>


Re: Backup and Restore TDB using Fuseki2

Posted by Trevor Donaldson <tm...@gmail.com>.
Thanks Andy the link is very helpful. I am assuming that in order to
reimport I would use tdbloader. Is this right?

On Fri, Mar 6, 2015 at 12:47 PM, Andy Seaborne <an...@apache.org> wrote:

> On 06/03/15 16:29, Trevor Donaldson wrote:
>
>> Hi all,
>>
>>   I was wondering if there is a way to programmatically backup the tdb
>> instance? I found this question
>> http://webcache.googleusercontent.com/search?
>> q=cache:0whNmMD65OcJ:answers.semanticweb.com/questions/
>> 24740/how-do-you-create-and-restore-backups-with-fuseki-
>> and-tdb+&cd=3&hl=en&ct=clnk&gl=us
>> but it is referencing fuseki 1 (i.e. --mgtPort=port). Is there another way
>> that a backup and a restore should be handled in fuseki2?
>>
>> Thanks in advance,
>>
>> Trevor
>>
>>
> See staging documentation:
>
> http://jena.staging.apache.org/documentation/fuseki2/fuseki-server-
> protocol.html
>
> POST /$/backup/{name}
>
> The admin interface has to be on the same port (WAR file deployment) and
> it's under /$/, protected by Shiro (this is what the UI does when you press
> the backup button)
>
> There was a very recent bug fix (a few days ago) - the backup was written
> to the wrong place. The latest build, it's written to $FUSEKI_BASE/backups/
>
>         Andy
>
>
>
>

Re: Backup and Restore TDB using Fuseki2

Posted by Andy Seaborne <an...@apache.org>.
On 06/03/15 16:29, Trevor Donaldson wrote:
> Hi all,
>
>   I was wondering if there is a way to programmatically backup the tdb
> instance? I found this question
> http://webcache.googleusercontent.com/search?q=cache:0whNmMD65OcJ:answers.semanticweb.com/questions/24740/how-do-you-create-and-restore-backups-with-fuseki-and-tdb+&cd=3&hl=en&ct=clnk&gl=us
> but it is referencing fuseki 1 (i.e. --mgtPort=port). Is there another way
> that a backup and a restore should be handled in fuseki2?
>
> Thanks in advance,
>
> Trevor
>

See staging documentation:

http://jena.staging.apache.org/documentation/fuseki2/fuseki-server-
protocol.html

POST /$/backup/{name}

The admin interface has to be on the same port (WAR file deployment) and 
it's under /$/, protected by Shiro (this is what the UI does when you 
press the backup button)

There was a very recent bug fix (a few days ago) - the backup was 
written to the wrong place. The latest build, it's written to 
$FUSEKI_BASE/backups/

	Andy