[GNC] Relocating user specific application data to another directory

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

[GNC] Relocating user specific application data to another directory

mark101
Hi

For easier backup, I wish to relocate my user specific application data in
the default directory to another directory on my PC. My operating system is
Windows 10 and I’m using Gnucash v3.7.

Documentation suggests this can be achieved by creating an
'environment.local' file in the same location as the 'environment' file, and
adding to it, the GNC_DATA_HOME variable to override the default location.

Could someone show how the syntax should look in the environment.local file,
if I want to relocate to the data, to say
"C:\Users\Mark\OneDrive\Documents\Gnucash_data\GnuCash". I’ve had a number
of goes at the syntax but to no avail… it keeps using the default directory.

For those interested, as well as the text in the environment.local file,
here are the wiki links which have helped so far:

https://wiki.gnucash.org/wiki/Configuration_Diagrams_-_Windows
https://wiki.gnucash.org/wiki/Configuration_Locations

Many thanks and please excuse my ignorance as I’m new to GnuCash.

Mark




--
Sent from: http://gnucash.1415818.n4.nabble.com/GnuCash-User-f1415819.html
_______________________________________________
gnucash-user mailing list
[hidden email]
To update your subscription preferences or to unsubscribe:
https://lists.gnucash.org/mailman/listinfo/gnucash-user
If you are using Nabble or Gmane, please see https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
-----
Please remember to CC this list on all your replies.
You can do this by using Reply-To-List or Reply-All.
Reply | Threaded
Open this post in threaded view
|

Re: [GNC] Relocating user specific application data to another directory

Adrien Monteleone-2
To be clear, that variable is not for your accounting books, (user data files) that is for things like user prefs, CSS or .ini based UI customizations and saved report configurations.

If all you want to do is move your data file, just move it. And since you are on Windows, you get the luxury (I’m pretty sure) of just double-clicking the data file once from the new location to open it and then GnuCash will look for it in this new location from there on out.

In a worst, case, you’ll need to do a File > Open and navigate to the new location, though, I’m also pretty sure that a File > Save As (and then delete the old copy) would probably accomplish the same.

If however, you are truly intending to migrate your config stuff to some other location than the default, that *might* involve messing with environment variables.

That would be GNC_CONFIG_HOME in that case, if I understand the wiki correctly.

Regards,
Adrien

> On Sep 27, 2019 w39d270, at 7:20 PM, mark101 <[hidden email]> wrote:
>
> Hi
>
> For easier backup, I wish to relocate my user specific application data in
> the default directory to another directory on my PC. My operating system is
> Windows 10 and I’m using Gnucash v3.7.
>
> Documentation suggests this can be achieved by creating an
> 'environment.local' file in the same location as the 'environment' file, and
> adding to it, the GNC_DATA_HOME variable to override the default location.
>
> Could someone show how the syntax should look in the environment.local file,
> if I want to relocate to the data, to say
> "C:\Users\Mark\OneDrive\Documents\Gnucash_data\GnuCash". I’ve had a number
> of goes at the syntax but to no avail… it keeps using the default directory.
>
> For those interested, as well as the text in the environment.local file,
> here are the wiki links which have helped so far:
>
> https://wiki.gnucash.org/wiki/Configuration_Diagrams_-_Windows
> https://wiki.gnucash.org/wiki/Configuration_Locations
>
> Many thanks and please excuse my ignorance as I’m new to GnuCash.
>
> Mark

_______________________________________________
gnucash-user mailing list
[hidden email]
To update your subscription preferences or to unsubscribe:
https://lists.gnucash.org/mailman/listinfo/gnucash-user
If you are using Nabble or Gmane, please see https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
-----
Please remember to CC this list on all your replies.
You can do this by using Reply-To-List or Reply-All.
Reply | Threaded
Open this post in threaded view
|

Re: [GNC] Relocating user specific application data to another directory

mark101
Thanks Adrien for your reply.

Yes, in Windows, the financial data file (e.g johndoe.gnucash) is easily
saved in the location of choice.

What I want to work out is how to relocate (migrate) the user data files
(particularly the 'saved-reports' file), which in my Windows 10, are in
their default directory: '(%APPDATA%)\GnuCash'.

My basic understanding of the documentation is that relocation is achievable
in GnuCash V3.x  by creating an 'enviroment.local' file and writing a
GNC_DATA_HOME environmetal variable entry with the appropriate syntax. I
haven’t, as yet, been successful in working out this syntax.

My terminology is likely inaccurate, so I do appreciate your patience.

Mark



--
Sent from: http://gnucash.1415818.n4.nabble.com/GnuCash-User-f1415819.html
_______________________________________________
gnucash-user mailing list
[hidden email]
To update your subscription preferences or to unsubscribe:
https://lists.gnucash.org/mailman/listinfo/gnucash-user
If you are using Nabble or Gmane, please see https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
-----
Please remember to CC this list on all your replies.
You can do this by using Reply-To-List or Reply-All.
Reply | Threaded
Open this post in threaded view
|

Re: [GNC] Relocating user specific application data to another directory

Adrien Monteleone-2
Understood, and thanks for the clarification.

I could be misreading the wiki.

Perhaps someone more familiar with the environment variables specifically on Windows could chime in.


Regards,
Adrien

> On Sep 27, 2019 w39d270, at 11:46 PM, mark101 <[hidden email]> wrote:
>
> Thanks Adrien for your reply.
>
> Yes, in Windows, the financial data file (e.g johndoe.gnucash) is easily
> saved in the location of choice.
>
> What I want to work out is how to relocate (migrate) the user data files
> (particularly the 'saved-reports' file), which in my Windows 10, are in
> their default directory: '(%APPDATA%)\GnuCash'.
>
> My basic understanding of the documentation is that relocation is achievable
> in GnuCash V3.x  by creating an 'enviroment.local' file and writing a
> GNC_DATA_HOME environmetal variable entry with the appropriate syntax. I
> haven’t, as yet, been successful in working out this syntax.
>
> My terminology is likely inaccurate, so I do appreciate your patience.
>
> Mark

_______________________________________________
gnucash-user mailing list
[hidden email]
To update your subscription preferences or to unsubscribe:
https://lists.gnucash.org/mailman/listinfo/gnucash-user
If you are using Nabble or Gmane, please see https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
-----
Please remember to CC this list on all your replies.
You can do this by using Reply-To-List or Reply-All.
Reply | Threaded
Open this post in threaded view
|

Re: [GNC] Relocating user specific application data to another directory

Geert Janssens-4
It would require to set both environment variables:
GNC_DATA_HOME
GNC_CONFIG_HOME

On Windows they happen to point at the same directory but it's two different
locations what GnuCash is concerned.

Can you post the environment.local file you tried to achieve this with ?

Regards,

Geert

Op zaterdag 28 september 2019 10:10:17 CEST schreef Adrien Monteleone:

> Understood, and thanks for the clarification.
>
> I could be misreading the wiki.
>
> Perhaps someone more familiar with the environment variables specifically on
> Windows could chime in.
>
>
> Regards,
> Adrien
>
> > On Sep 27, 2019 w39d270, at 11:46 PM, mark101
> > <[hidden email]> wrote:
> >
> > Thanks Adrien for your reply.
> >
> > Yes, in Windows, the financial data file (e.g johndoe.gnucash) is easily
> > saved in the location of choice.
> >
> > What I want to work out is how to relocate (migrate) the user data files
> > (particularly the 'saved-reports' file), which in my Windows 10, are in
> > their default directory: '(%APPDATA%)\GnuCash'.
> >
> > My basic understanding of the documentation is that relocation is
> > achievable in GnuCash V3.x  by creating an 'enviroment.local' file and
> > writing a GNC_DATA_HOME environmetal variable entry with the appropriate
> > syntax. I haven’t, as yet, been successful in working out this syntax.
> >
> > My terminology is likely inaccurate, so I do appreciate your patience.
> >
> > Mark
>
> _______________________________________________
> gnucash-user mailing list
> [hidden email]
> To update your subscription preferences or to unsubscribe:
> https://lists.gnucash.org/mailman/listinfo/gnucash-user
> If you are using Nabble or Gmane, please see
> https://wiki.gnucash.org/wiki/Mailing_Lists for more information. -----
> Please remember to CC this list on all your replies.
> You can do this by using Reply-To-List or Reply-All.




_______________________________________________
gnucash-user mailing list
[hidden email]
To update your subscription preferences or to unsubscribe:
https://lists.gnucash.org/mailman/listinfo/gnucash-user
If you are using Nabble or Gmane, please see https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
-----
Please remember to CC this list on all your replies.
You can do this by using Reply-To-List or Reply-All.
Reply | Threaded
Open this post in threaded view
|

Re: [GNC] Relocating user specific application data to another directory

Stan Brown
In reply to this post by Adrien Monteleone-2
On 2019-09-27 21:14, Adrien Monteleone wrote:
> If all you want to do is move your data file, just move it. And since
> you are on Windows, you get the luxury (I’m pretty sure) of just
> double-clicking the data file once from the new location to open it
> and then GnuCash will look for it in this new location from there on
> out.
You're 100% correct, Adrien. I'm on Windows and do this regularly.

It's also possible in Windows to "pin " a data file to the start menu,
so that you don't even have to navigate to it to double-click it. That
is what I do, because I have three data files (2001-2010, 2010-2017,
2018-present).

However, if the OP has only one data file, there's no reason to pin it.
He can just close GC, move the data file as you suggested, then
double-click it. GC remembers the most-recently-used file in its new
location, so next time he opens GC it will automatically open the file
for him.

--
Regards,
Stan Brown
Tompkins County, New York, USA
https://BrownMath.com
http://OakRoadSystems.com
_______________________________________________
gnucash-user mailing list
[hidden email]
To update your subscription preferences or to unsubscribe:
https://lists.gnucash.org/mailman/listinfo/gnucash-user
If you are using Nabble or Gmane, please see https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
-----
Please remember to CC this list on all your replies.
You can do this by using Reply-To-List or Reply-All.
Reply | Threaded
Open this post in threaded view
|

Re: [GNC] Relocating user specific application data to another directory

mark101
In reply to this post by Geert Janssens-4
Hi Geert

Following your post I did the following:
- Firstly, I created the following directory in my Windows system to
simplify the re-location path: C:\Users\Mark\AppData\Roaming\GnuCash\GnuCash
- I then edited my 'enviroment.local' file, using both GNC_DATA_HOME and
GNC_CONFIG_HOME as you advised, and had a number of attempts using different
syntax.
- Unfortunately, none were successful.

Here is my enviroment.local file.  environment.local
<http://gnucash.1415818.n4.nabble.com/file/t378751/environment.local>  
As you'll see:
1) I've retained each failed each attempt within the file by hashing each
out.
2) I've taken a 'dart-board' approach with my syntax attempts with no real
understanding of what it should be! Hope you get a chuckle out of it!

Regards

Mark




--
Sent from: http://gnucash.1415818.n4.nabble.com/GnuCash-User-f1415819.html
_______________________________________________
gnucash-user mailing list
[hidden email]
To update your subscription preferences or to unsubscribe:
https://lists.gnucash.org/mailman/listinfo/gnucash-user
If you are using Nabble or Gmane, please see https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
-----
Please remember to CC this list on all your replies.
You can do this by using Reply-To-List or Reply-All.
Reply | Threaded
Open this post in threaded view
|

Re: [GNC] Relocating user specific application data to another directory

mark101
In reply to this post by Geert Janssens-4
Hi Geert

Since my last post, and after scouring the forums, I've had some success.

I found that the following syntax worked in relocating my user data/config
files to: C:\Users\Mark\AppData\Roaming\GnuCash\GnuCash
GNC_DATA_HOME={Appdata}/Gnucash/GnuCash
GNC_CONFIG_HOME={Appdata}/Gnucash/GnuCash
Here's the enviroment.local file   environment.local
<http://gnucash.1415818.n4.nabble.com/file/t378751/environment.local>  


I also found that this syntax worked in relocating my user data/config files
to: C:\Users\Mark\OneDrive\Documents\Gnucash_data\GnuCash
GNC_DATA_HOME=C:/Users/Mark/OneDrive/Documents/Gnucash_data/GnuCash
GNC_CONFIG_HOME=C:/Users/Mark/OneDrive/Documents/Gnucash_data/GnuCash
Here's the enviroment.local file    environment.local
<http://gnucash.1415818.n4.nabble.com/file/t378751/environment.local>  


Whilst the syntax worked, do you have any suggestions on how this syntax may
be simplified/improved or references/links to help my understanding of it?

Thanks

Mark




--
Sent from: http://gnucash.1415818.n4.nabble.com/GnuCash-User-f1415819.html
_______________________________________________
gnucash-user mailing list
[hidden email]
To update your subscription preferences or to unsubscribe:
https://lists.gnucash.org/mailman/listinfo/gnucash-user
If you are using Nabble or Gmane, please see https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
-----
Please remember to CC this list on all your replies.
You can do this by using Reply-To-List or Reply-All.
Reply | Threaded
Open this post in threaded view
|

Re: [GNC] Relocating user specific application data to another directory

Geert Janssens-4
Op zondag 29 september 2019 13:11:30 CEST schreef mark101:

> Hi Geert
>
> Since my last post, and after scouring the forums, I've had some success.
>
> I found that the following syntax worked in relocating my user data/config
> files to: C:\Users\Mark\AppData\Roaming\GnuCash\GnuCash
> GNC_DATA_HOME={Appdata}/Gnucash/GnuCash
> GNC_CONFIG_HOME={Appdata}/Gnucash/GnuCash
> Here's the enviroment.local file   environment.local
> <http://gnucash.1415818.n4.nabble.com/file/t378751/environment.local>
>
>
> I also found that this syntax worked in relocating my user data/config files
> to: C:\Users\Mark\OneDrive\Documents\Gnucash_data\GnuCash
> GNC_DATA_HOME=C:/Users/Mark/OneDrive/Documents/Gnucash_data/GnuCash
> GNC_CONFIG_HOME=C:/Users/Mark/OneDrive/Documents/Gnucash_data/GnuCash
> Here's the enviroment.local file    environment.local
> <http://gnucash.1415818.n4.nabble.com/file/t378751/environment.local>
>
>
> Whilst the syntax worked, do you have any suggestions on how this syntax may
> be simplified/improved or references/links to help my understanding of it?
>
Hi Mark,

I'm glad it worked.

I'm not sure what you mean by "how this syntax may be simplified/improved".

As for references, the file format is based on GLib's Key File format
https://developer.gnome.org/glib/stable/glib-Key-value-file-parser.html#glib-Key-value-file-parser.description

It's simplified in that it won't use translated strings and GnuCash will
currently only interpret values in a "Variables" section.

Other than that, as the variables should be able to depend on system
environment variables, we have added a simple syntax extension to include the
names for system environment variables. Any bit of text enclosed in { and }
is interpreted as a system environment variable and will be expanded to the
value of that variable. On Windows there's the variable APPDATA (or appdata is
it's case insensitive). This variable is set by default by the system, and on
your system with user Mark will be set to
C:\Users\Mark\AppData\Roaming

Other variables could be used in the same way as well if they exist and make
sense. You'll find examples in the environment file itself, including a short
intro on what this file does and how to use it.

Note also that file paths on Windows can use either \ or / as path separator.
So as far as Windows is concerned
C:\Users\Mark\AppData\Roaming\GnuCash\GnuCash
and
C:/Users/Mark/AppData/Roaming/GnuCash/GnuCash
are the same directory.

And you can use either format in the environment file as well with one
important caveat: \ acts as escape character for the key file parser. So if
you want to use \ as path separator, you'll need to use its escaped form \\.
That is explained in the link I have pasted above as well.
So in the environment file these two are equivalent and both refer to
C:\Users\Mark\AppData\Roaming\GnuCash\GnuCash

* GNC_DATA_HOME={Appdata}\\Gnucash\\GnuCash
* GNC_DATA_HOME={Appdata}/Gnucash/GnuCash

Hope that helps,

Geert


_______________________________________________
gnucash-user mailing list
[hidden email]
To update your subscription preferences or to unsubscribe:
https://lists.gnucash.org/mailman/listinfo/gnucash-user
If you are using Nabble or Gmane, please see https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
-----
Please remember to CC this list on all your replies.
You can do this by using Reply-To-List or Reply-All.