Re: Duplicate HSQLDB - Export/Import from one instance to a new instance.
Andrew Richardson <[email protected]> Tue, 9 Jul 2024 07:14:31 -0400
| Newsgroups | gmane.comp.java.hsqldb.user |
|---|---|
| Message-ID | <CAAeTkou4d4YB9JDy=5KYPwBg=NxOhwS-zsj_rqRxVVW2m8zNVQ@mail.gmail.com> |
--===============2607094035253244720== Content-Type: multipart/alternative; boundary="000000000000ef8429061ccea299" --000000000000ef8429061ccea299 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Per the help text, the tool only supports the switches specified. Thus the " --database1 jdbc:hsqldb:hsql:/path/to/prod/db/hsql;user=3Dsa;password=3D = " text is a problem. Suspect command line use is not supported presently...you might need to add that support yourself, the source code is there. I was able to get the dump file generated using the GUI, but did not try the restore function. I do not have any further input for you. Good luck with your project! On Mon, Jul 8, 2024 at 8:59=E2=80=AFPM Ken Lemoine <[email protected]= m> wrote: > Thanks for the timely response, Andrew. > > I've got a shiny new transfer tool (hsqldbutil.jar) compiled and tried it > every which way to no avail. > > Here's my last attempt, with the response - I'm sure there's something I'= m > missing still. The hsqldbutil.jar is in my local directory. > > java -cp hsqldbutil.jar org.hsqldb.util.Transfer --database1 > jdbc:hsqldb:hsql:/path/to/prod/db/hsql;user=3Dsa;password=3D --dump > > > Wondering if I need to change the jdbc connection to use 'file' vice > 'hsql' since we're using a .script file, but I can't seem to get past thi= s > message, as if it doesn't know what the --dump parameter is: > > *Exception in thread "main" java.lang.IllegalArgumentException: Try: jav= a > org.hsqldb.util.Transfer --help* > * at org.hsqldb.util.Transfer.main(Unknown Source)* > *-bash: --dump: command not found* > > All the --help gives me is the usage (-help,-dump,-restore). It also > seems to sometimes complain of the lack of X11 since it can also be run > graphically, but I do not want that, the goal here is to have a script th= at > can export data frequently, xfer it to another machine and have another > script to import it. > > Appreciate any help you can provide, and happy Monday! > > Regards, > > ------------------------------ > *From:* Andrew Richardson <[email protected]> > *Sent:* Saturday, July 6, 2024 1:57 PM > *To:* User discussions about HyperSQL Database Engine. < > [email protected]> > *Subject:* Re: [Hsqldb-user] Duplicate HSQLDB - Export/Import from one > instance to a new instance. > > Hello again <sorry for the spam> > Out of curiosity, I looked into how to generate the Transfer Tool. Here > is what worked for me on Windows. > > cd hsqldb-2.7.3\hsqldb\build > gradlew hsqldbutil > java -cp ..\lib\hsqldbutil.jar org.hsqldb.util.Transfer --dump > > Maybe this saves you a little time. > Cheers! > > On Sat, Jul 6, 2024 at 12:59=E2=80=AFPM Andrew Richardson <[email protected]= om> > wrote: > > Hello Ken > Not sure if this will cover all your requirements, but have a look at the > "Transfer Tool" utility. Might be a place to start. > https://hsqldb.org/doc/2.0/util-guide/transfer-tool-chapt.html > > Cheers, > Andrew Richardson > > On Fri, Jul 5, 2024 at 4:18=E2=80=AFPM Ken Lemoine <ken.lemoine@cyberzek.= com> > wrote: > > Hello, > > Apologies in advance if this has been asked before, I'm just not finding > much information in the archives. > > We have a hsqldb instance that needs to be replicated to a secondary. > I've tried and failed 3 different methods, mostly using the sqltool.jar a= nd > once by simply copying over the hsql.script file and crossing my fingers. > The final attempt I just completed does seemingly create a valid > 'exporteddata.sql' file, I can see it in there. Then when I import it on > the second machine, it also seemingly imports it - it outputs to stdout s= o > I know it did SOMEthing. But, the data is not showing up in the > application. > > This is the latest hsqldb, running on latest FreeBSD 14. > > I'll also be needing a way of fully automating this, to keep a second > machine up to date, and have struggled also getting a script to do this, > but at this point, I really just want to see if I can get this working > manually. > > Any tips or hints, or a point in the right direction would > be appreciated. > > Thanks! > > Ken > > *Ken Lemoine* | Deployment Manager > > (614) 344-6500 > > www.cyberzek.com > _______________________________________________ > Hsqldb-user mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/hsqldb-user > > *Ken Lemoine* | Deployment Manager > > (614) 344-6500 > > www.cyberzek.com > _______________________________________________ > Hsqldb-user mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/hsqldb-user > --000000000000ef8429061ccea299 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr"><div>Per the help text, the tool only supports the switche= s specified.=C2=A0 Thus the " --database1 jdbc:hsqldb:hsql:/path/to/prod/db/hsql;user=3Dsa;password=3D " text is a problem.=C2=A0 <br></div><div>Suspect command line use is = not supported presently...you might need to add that support yourself, the = source code is there.<br></div><div> I was able to get the dump file generated using the GUI, but did not try th= e restore function.=20 </div><div>I do not have any further input for you.=C2=A0=C2=A0</div><div>G= ood luck with your project!</div><div></div></div><br><div class=3D"gmail_q= uote"><div dir=3D"ltr" class=3D"gmail_attr">On Mon, Jul 8, 2024 at 8:59=E2= =80=AFPM Ken Lemoine <<a href=3D"mailto:[email protected]">ken.le= [email protected]</a>> wrote:<br></div><blockquote class=3D"gmail_quote= " style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);= padding-left:1ex"><div class=3D"msg3172342521405161930"> <div dir=3D"ltr"> <div style=3D"font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Cali= bri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)"> Thanks for the timely response, Andrew.</div> <div style=3D"font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Cali= bri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)"> <br> </div> <div style=3D"font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Cali= bri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)"> I've got a shiny new transfer tool (hsqldbutil.jar) compiled and tried = it every which way to no avail.</div> <div style=3D"font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Cali= bri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)"> <br> </div> <div style=3D"font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Cali= bri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)"> Here's my last attempt, with the response - I'm sure there's so= mething I'm missing still. The hsqldbutil.jar is in my local directory.= </div> <div style=3D"font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Cali= bri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)"> <br> </div> <blockquote style=3D"margin-left:0.8ex;padding-left:1ex;border-left:3px sol= id rgb(200,200,200)"> <div style=3D"font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Cali= bri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)"> java -cp hsqldbutil.jar org.hsqldb.util.Transfer --database1 jdbc:hsqldb:hs= ql:/path/to/prod/db/hsql;user=3Dsa;password=3D =C2=A0--dump</div> </blockquote> <div style=3D"font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Cali= bri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)"> <br> </div> <div style=3D"font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Cali= bri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)"> Wondering if I need to change the jdbc connection to use 'file' vic= e 'hsql' since we're using a .script file, but I can't seem= to get past this message, as if it doesn't know what the --dump parame= ter is:</div> <div style=3D"font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Cali= bri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)"> <br> </div> <div style=3D"font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Cali= bri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)"> <b>Exception in thread "main" java.lang.IllegalArgumentException:= Try: =C2=A0java org.hsqldb.util.Transfer --help</b></div> <div style=3D"font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Cali= bri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)"> <b>=E2=80=82=E2=80=82=E2=80=82=E2=80=82=E2=80=82=E2=80=82at org.hsqldb.util= .Transfer.main(Unknown Source)</b></div> <div style=3D"font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Cali= bri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)"> <b>-bash: --dump: command not found</b></div> <div id=3D"m_3172342521405161930appendonsend"></div> <div style=3D"font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Cali= bri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)"> <br> </div> <div style=3D"font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Cali= bri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)"> All the --help gives me is the usage (-help,-dump,-restore).=C2=A0 It also = seems to sometimes complain of the lack of X11 since it can also be run gra= phically, but I do not want that, the goal here is to have a script that ca= n export data frequently, xfer it to another machine and have another script to import it.</div> <div style=3D"font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Cali= bri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)"> <br> </div> <div style=3D"font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Cali= bri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)"> Appreciate any help you can=C2=A0provide, and happy Monday!</div> <div style=3D"font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Cali= bri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)"> <br> </div> <div style=3D"font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Cali= bri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)"> Regards,=C2=A0</div> <div style=3D"font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Cali= bri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)"> <br> </div> <hr style=3D"display:inline-block;width:98%"> <div id=3D"m_3172342521405161930divRplyFwdMsg" dir=3D"ltr"><span style=3D"f= ont-family:Calibri,sans-serif;font-size:11pt;color:rgb(0,0,0)"><b>From:</b>= =C2=A0Andrew Richardson <<a href=3D"mailto:[email protected]" target=3D"_= blank">[email protected]</a>><br> <b>Sent:</b>=C2=A0Saturday, July 6, 2024 1:57 PM<br> <b>To:</b>=C2=A0User discussions about HyperSQL Database Engine. <<a hre= f=3D"mailto:[email protected]" target=3D"_blank">hsqldb-use= [email protected]</a>><br> <b>Subject:</b>=C2=A0Re: [Hsqldb-user] Duplicate HSQLDB - Export/Import fro= m one instance to a new instance.</span> <div>=C2=A0</div> </div> <div style=3D"direction:ltr">Hello again <sorry for the spam></div> <div style=3D"direction:ltr">Out of curiosity, I looked into how to generat= e the Transfer Tool.=C2=A0 Here is what worked for me on Windows.</div> <div style=3D"direction:ltr;margin-left:40px"><br> </div> <div style=3D"direction:ltr;margin-left:40px">cd hsqldb-2.7.3\hsqldb\build<= br> gradlew hsqldbutil<br> java -cp ..\lib\hsqldbutil.jar org.hsqldb.util.Transfer --dump</div> <div style=3D"direction:ltr"><br> </div> <div style=3D"direction:ltr">Maybe this saves you a little time.</div> <div style=3D"direction:ltr">Cheers!</div> <div style=3D"direction:ltr"><br> </div> <div style=3D"direction:ltr">On Sat, Jul 6, 2024 at 12:59=E2=80=AFPM Andrew= Richardson <<a href=3D"mailto:[email protected]" id=3D"m_317234252140516= 1930OWA306b6136-9f8f-3096-9d7e-6b2960390427" target=3D"_blank">spun69@gmail= .com</a>> wrote:</div> <blockquote style=3D"margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left:= 1px solid rgb(204,204,204)"> <div style=3D"direction:ltr">Hello Ken</div> <div style=3D"direction:ltr">Not sure if this will cover all your requireme= nts, but have a look at the "Transfer Tool" utility.=C2=A0 Might = be a place to start.</div> <div style=3D"direction:ltr"><a href=3D"https://hsqldb.org/doc/2.0/util-gui= de/transfer-tool-chapt.html" id=3D"m_3172342521405161930OWAabb790ad-0195-e8= 82-41db-f0a43c7d9775" target=3D"_blank">https://hsqldb.org/doc/2.0/util-gui= de/transfer-tool-chapt.html</a></div> <div style=3D"direction:ltr"><br> </div> <div style=3D"direction:ltr">Cheers,</div> <div style=3D"direction:ltr">Andrew Richardson</div> <div style=3D"direction:ltr"><br> </div> <div style=3D"direction:ltr">On Fri, Jul 5, 2024 at 4:18=E2=80=AFPM Ken Lem= oine <<a href=3D"mailto:[email protected]" id=3D"m_31723425214051= 61930OWAb9398c0f-4a80-5176-3963-8b0913dbfc92" target=3D"_blank">ken.lemoine= @cyberzek.com</a>> wrote:</div> <blockquote style=3D"margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left:= 1px solid rgb(204,204,204)"> <div style=3D"direction:ltr;font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFo= ntService,Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)"> Hello,</div> <div style=3D"direction:ltr;font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFo= ntService,Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)"> <br> </div> <div style=3D"direction:ltr;font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFo= ntService,Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)"> Apologies in advance=C2=A0if this has been asked before, I'm just not f= inding much information in the archives.=C2=A0</div> <div style=3D"direction:ltr;font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFo= ntService,Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)"> <br> </div> <div style=3D"direction:ltr;font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFo= ntService,Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)"> We have a hsqldb instance that needs=C2=A0to be replicated to a secondary.= =C2=A0 I've tried and failed 3 different methods, mostly using the sqlt= ool.jar and once by simply copying over the hsql.script file and crossing m= y fingers.=C2=A0 The final attempt I just completed does seemingly create a valid 'exporteddata.sql' file, I can see i= t in there.=C2=A0 Then when I import it on the second machine, it also seem= ingly imports it - it outputs to stdout so I know it did SOMEthing.=C2=A0 B= ut, the data is not showing up in the application.</div> <div style=3D"direction:ltr;font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFo= ntService,Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)"> <br> </div> <div style=3D"direction:ltr;font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFo= ntService,Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)"> This is the latest hsqldb, running on latest FreeBSD 14.=C2=A0=C2=A0</div> <div style=3D"direction:ltr;font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFo= ntService,Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)"> <br> </div> <div style=3D"direction:ltr;font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFo= ntService,Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)"> I'll also be needing a way of fully automating this, to keep a second m= achine up to date, and have struggled also getting a script to do this, but= at this point, I really just want to see if I can get this working manuall= y.</div> <div style=3D"direction:ltr;font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFo= ntService,Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)"> <br> </div> <div style=3D"direction:ltr;font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFo= ntService,Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)"> Any tips or hints, or a point in the right direction would be=C2=A0apprecia= ted.=C2=A0=C2=A0</div> <div style=3D"direction:ltr;font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFo= ntService,Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)"> <br> </div> <div style=3D"direction:ltr;font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFo= ntService,Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)"> Thanks!</div> <div style=3D"direction:ltr;font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFo= ntService,Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)"> <br> </div> <div style=3D"direction:ltr;font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFo= ntService,Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)"> Ken</div> <p style=3D"direction:ltr"><b>Ken Lemoine</b>=C2=A0| Deployment Manager</p> <p style=3D"direction:ltr">(614) 344-6500</p> <p style=3D"direction:ltr"><a href=3D"http://www.cyberzek.com" id=3D"m_3172= 342521405161930OWA3e01027d-970f-6ad5-d4d5-019821d2ee6b" style=3D"margin-top= :0px;margin-bottom:0px" target=3D"_blank">www.cyberzek.com</a></p> <div style=3D"direction:ltr"><span><img width=3D"222" height=3D"50" style= =3D"width: 222px; height: 50px;" src=3D"https://static.wixstatic.com/media/= 7044be_7929e43cb3664f7f87bd4b5d091e73f5~mv2.png/v1/fill/w_282,h_68,al_c,q_8= 5,usm_0.66_1.00_0.01,enc_auto/CYBERZEK%20Logo%20-%20Color%20-%20Horizontal.= png"></span></div> <div style=3D"direction:ltr">______________________________________________= _<br> Hsqldb-user mailing list<br> <a href=3D"mailto:[email protected]" id=3D"m_31723425214051= 61930OWA3ff44f31-9c3c-53c8-800b-3a2e9a4321b4" target=3D"_blank">Hsqldb-user= @lists.sourceforge.net</a><br> <a href=3D"https://lists.sourceforge.net/lists/listinfo/hsqldb-user" id=3D"= m_3172342521405161930OWA2b747ac6-f359-bc8d-39f3-b366193a0292" target=3D"_bl= ank">https://lists.sourceforge.net/lists/listinfo/hsqldb-user</a></div> </blockquote> </blockquote> <p><strong>Ken Lemoine</strong> | Deployment Manager</p> <p>(614) 344-6500</p> <p><a href=3D"http://www.cyberzek.com" target=3D"_blank">www.cyberzek.com</= a></p> <img src=3D"https://static.wixstatic.com/media/7044be_7929e43cb3664f7f87bd4= b5d091e73f5~mv2.png/v1/fill/w_282,h_68,al_c,q_85,usm_0.66_1.00_0.01,enc_aut= o/CYBERZEK%20Logo%20-%20Color%20-%20Horizontal.png" width=3D"222" height=3D= "50"> </div> _______________________________________________<br> Hsqldb-user mailing list<br> <a href=3D"mailto:[email protected]" target=3D"_blank">Hsql= [email protected]</a><br> <a href=3D"https://lists.sourceforge.net/lists/listinfo/hsqldb-user" rel=3D= "noreferrer" target=3D"_blank">https://lists.sourceforge.net/lists/listinfo= /hsqldb-user</a><br> </div></blockquote></div> --000000000000ef8429061ccea299-- --===============2607094035253244720== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline --===============2607094035253244720== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Hsqldb-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/hsqldb-user --===============2607094035253244720==--