[GNC] How to move my Windows 10 2.6.17 to a new Windows, 10 machine?

Dick Gardner rbg1943 at gmail.com
Fri Jul 13 12:39:15 EDT 2018


Stan, thanks. With my small account it wasn't much of a problem to do it
all manually (once I knew where and what needed to be done!), but I'm sure
your batch file is a great tool for higher volume situations.

I do agree with everyone that help for 'just-a user' folks like me is
important.  I know enough to be dangerous, but fortunately (at least I
think) I  know it. For me, instructions that clearly explain how *and why*
give me the most confidence to go DIY.  I think before I would be
comfortable using somebody's (black-box to me) tool I'd want to have an
imprimatur from, like, GNUcash and more documentation.

Adrien's answer of using an established tool like Windows BU sounds easy
and reliable, but you have to tell me exactly what *are* the "relevant
file(s)"? -- I didn't think one 218kb file could possibly be big enough to
hold 7 years of transactions, customers, vendors, etc. and I was sure I
*had* to regedit the Preferences (I *knew* that was dangerous for me) --
that is until Dave explained it plain and simple and gave me the confidence.

Thanks again everybody.

Dick



On Thu, Jul 12, 2018 at 6:29 PM Stan Brown <the_stan_brown at fastmail.fm>
wrote:

> Dick, here is a batch file I use to save and restore my GnuCash settings
> and reports, for transferring them between machines.  You'd need to
> change my file names and paths to yours, but still it could save you
> some time.
>
> If you don't want to be elaborate as I am -- my batch files tend to be a
> bit over-engineered -- just look for the "reg" lines. Those are the ones
> that save or restore the settings and reports.
>
> > @set MYECHO=echo off
> > @%MYECHO
> > set RZIPNAME=_stanReports.zip
> > set GFILNAME=_stanSettings.reg
> > setlocal
> > set MYNAME=%@name[%0]
> > if "%1" ne "/?" .and. "%1" ne "-?" .and. "%1" ne "" goto 000_Start
> > echo off
> > echo.
> > echo %MYNAME: Save or restore GnuCash settings
> > echo.
> > echo options:
> > echo     /q     Quiet
> > echo     /v     Verbose
> > echo     /purge Delete saved log files (used with "save" or "apply")
> > echo     save   Save settings
> > echo     apply  Apply saved settings
> > echo     purge  Delete saved log files.
> > echo Just one of 'save', 'apply', 'purge' is required.
> > echo.
> > echo Settings are saved in %GFILNAME and %RZIPNAME, in the same
> > echo folder as the GnuCash accounting file.
> > quit
> >
> ********************************************************************************
> > 2018-02-25  new program
> > 2018-03-21  Add the purge option.
> > 2018-03-31  With 'purge', suppress error message if there are no files
> ...
> > 2018-04-01  ... and also delete GnuCash files in %TEMP%.
> > 2018-04-18  Add /purge as an option, used with "save" or "apply".
> > 2018-05-05  Program didn't abort after an an unknown option.
> >
> >     Copyright 2018 Stan Brown, Oak Road Systems
> http://oakroadsystems.com/
> >
> ********************************************************************************
> > :000_Start
> >
> > :: Scan the options.
> > set ACTION=none
> > set PURGING=0
> > set VERBOSE=1
> > do while "%1" ne ""
> >     iff %1 == save .or. %1 == apply .or. %1 == purge then
> >         iff %ACTION ne none then
> >             echo %MYNAME: Only one of 'save', 'apply', purge is allowed.
> >             cancel
> >         endiff
> >         set ACTION=%@lower[%1]
> >     elseiff %1 == /q then
> >         set VERBOSE=0
> >     elseiff %1 == /v then
> >         set VERBOSE=2
> >     elseiff %1 == /purge then
> >         set PURGING=1
> >     else
> >         echo %MYNAME: Unknown option '%1'.
> >         cancel 2
> >     endiff
> >     shift
> > enddo
> > iff %ACTION == none then
> >     echo %MYNAME: You need one of 'save', 'apply', or 'purge'.
> >     cancel
> > elseiff %VERBOSE == 2 then
> >     echo %MYNAME: Plaanning to %ACTION the %@if[%ACTION ==
> purge,files,settings].
> >     echo.
> > endiff
> >
> > :: Check existence of files and folders.
> >     set GDIR=e:\sb\$\GnuCash
> > iff not isdir "%GDIR" then
> >     echo %MYNAME: Financials folder '%GDIR' not found.
> >     cancel
> > elseiff not exist "%GDIR\Stan.gnucash" then
> >     echo %MYNAME: File Stan.gnucash not found in '%GDIR'.
> >     cancel
> > endiff
> > set RDIR=%USERPROFILE\.gnucash
> > set RZIP=%GDIR\%RZIPNAME
> > set GKEY=HKCU\Software\GSettings\org\gnucash
> > set GFIL=%GDIR\%GFILNAME
> > iff %VERBOSE == 2 then
> >     echo %MYNAME: Financial database is in folder '%GDIR'.
> >     echo %MYNAME: GnuCash reports are in folder '%RDIR'.
> >     echo %MYNAME: GnuCash reports are zipped in file '%RZIP'.
> >     echo %MYNAME: GnuCash settings are in '%GKEY'.
> >     echo %MYNAME: GnuCash settings are exported to file '%GFIL'.
> >     echo.
> > endiff
> >
> > iff %ACTION == save then
> >     if %PURGING == 1 gosub PurgeAction
> >     iff not isdir "%RDIR" then
> >         echo %MYNAME: Reports folder '%RDIR' not found.
> >         cancel
> >     endiff
> >     pushd "%RDIR"
> >     set ZIPOPT=
> >     set OPTS=-r -T -o
> >     if %VERBOSE lt 2 set OPTS=%OPTS -q
> >     @if %VERBOSE ge 1 echo on
> >     zip %OPTS "%RZIP" *
> >     @%MYECHO
> >     @echo.
> >     popd
> >     @if %VERBOSE ge 1 echo on
> >     reg export %GKEY "%GFIL" /y
> >     @%MYECHO
> >
> > elseiff %ACTION == apply then
> >     if %PURGING == 1 gosub PurgeAction
> >     iff not exist "%GFIL" then
> >         echo %MYNAME: Registy export file '%GFIL' not found.
> >         cancel
> >     endiff
> >     iff not exist "%RZIP" then
> >         echo %MYNAME: Reports ZIP file '%RZIP' not found.
> >         cancel
> >     endiff
> >     iff not isdir "%RDIR" then
> >         echo %MYNAME: Reports folder '%RDIR' not found.
> >         input /c /k"yYnN" /l1 Create it?^  %%X
> >         echo.
> >         if %X == N cancel
> >         md "%RDIR"
> >     endiff
> >     set OPTS=-uo
> >     if %VERBOSE == 0 set OPTS=%OPTS -q
> >     @if %VERBOSE ge 1 echo on
> >     unzip %OPTS "%RZIP" -d "%RDIR"
> >     @%MYECHO
> >     @echo.
> >     @if %VERBOSE ge 1 echo on
> >     reg delete %GKEY /f
> >     @echo.
> >     reg import "%GFIL"
> >     @%MYECHO
> >
> > elseiff %ACTION == purge then
> >     gosub PurgeAction
> >
> > else
> >     echo %MYNAME: Internal error: %%ACTION = '%ACTION'
> >     cancel
> > endiff
> > quit
> >
> > :PurgeAction
> >     set OPTS=/R /E
> >     if %VERBOSE lt 2 set OPTS=/T %OPTS
> >     echos %MYNAME: purging ... ``
> >     del %OPTS %GC\*.gnucash.20* %TEMP\gnc-report*html;gnucash*log
> >     return
>
>
> --
> Regards,
> Stan Brown
> Tompkins County, New York, USA
> http://BrownMath.com
> http://OakRoadSystems.com
>
>
>


More information about the gnucash-user mailing list