Where does Gnucash save it backup files when using mysql data source

L. D. James ljames at apollo3.com
Sun Jul 5 11:43:19 EDT 2015



On 07/05/2015 10:21 AM, Colin Law wrote:
> On 5 July 2015 at 10:47, L. D. James <ljames at apollo3.com> wrote:
>> When I first started using Peachtree, as far as I know, it was a bunch of
>> local files very similar to the way Gnucash started out. Eventually they
>> incorporated a database engine.  It's a very powerful engine.  I can
>> research and give you the name of it.  The Linux version of the engine is
>> extremely expensive.
> If that comment is in answer to my request for examples of
> applications that use mySQL and do database backups within the apps, I
> am not particularly familiar with Peachtree but I don't think it uses
> mySQL.  I think it uses the Pervasive database which is a very
> different beast to mySQL.  A big difference I think is that Pervasive
> is intended to be embedded within an app, whereas mySQL uses an
> external server over which gnucash has little control.

I started to send an addendum to my message.  First right after I 
clicked sent I realized I used the word "mysql" when I meant to use 
"database".  Also, I looked up the name of the database, which is as you 
mentioned pervasive.  And you're right.  The use builtin api's to the 
database for the Windows version.  They don't for the Linux version.  I 
would have had to pay $1500.00 to use my Linux machine for my Peachtree 
software, of which I felt was too much.  I retained up until this month 
a Windows machine in my network specifically for my accounting 
software.  I have sense retired this for Gnucash.  I tinkered and tested 
Gnucash for about two years before I finally started to replace 
Peachtree this month.  My biggest problem with Gnucash if the lack of 
multi-user capacity.

And yes, just as there is api for Pervasive, there also is API for SQL 
which will also interface with mysql.  I have been doing this for years 
with Microsoft applications for my clients.
>
>> They didn't place a requisite that their users go to school and learn the
>> new engine.  The people just used the facilities of Peachtree as they always
>> did.  Peachtree continued to routinely backup the data to the local drive as
>> always for the user.
>>
>> I believe Gnucash should do the same.
>>
>> Many people are using Wordpress.  They have no clue what a mysql database
>> engine is.  The developers of wordpress decided to take a very powerful
>> facility (mysql) and incorporate it into their program.  The have very
>> simple install procedures, and the program just works.  It works very
>> efficiently because of the time and attention that the developers put into
>> making the application easy to use.
> Users of Wordpress may have little knowledge of mySQL but whoever sets
> up the wordpress installation must know about it.  Does Wordpress have
> a built in backup feature available to the end user?  You might find
> this simple explanation of backing up a Wordpress database
> interesting:
> https://codex.wordpress.org/Backing_Up_Your_Database
Right.  Many users of Wordpress, including a lawyer client of mind have 
little knowledge of mysql database concepts.  If you mentioned mysql 
they would have no idea what you're talking about.  And yes, it setup by 
someone. It's setup by the developers of Wordpress. They place buttons 
for the users to click on and form fields for them to put in their 
information.  The maintenance and setup is done by the software.  The 
same is currently done in Gnucash.  All you have to do is type in there 
database address, the database name, your user name and password and 
it's all done.

The backup feature is already incorporated by a different name. "save 
as".  All that is needed is what John suggested in this thread, is to 
change the "save as" to "export" and it's done.  Just as simple as that.

By the way the Gnucash documentation looks just as complicated to most 
people as the documentation that you linked to for Wordpress. If the 
person is interested they would do it.  There are many detailed and 
manual options included in the link you gave.  Very few people would use 
those manual options.

And, again, I am not suggesting that the developers of Gnucash go the 
route that you are suggesting.  I'm suggesting that the data be saved 
(exported) to the local hard drive, a feature that is very easy to use, 
and already used today.  Having the power of an SQL interface is just an 
added benefit and facility to the developers. The users don't really 
need to know, or to care what an SQL engine is.  You'd be surprised at 
the many applications on your windows machine would be broken if you 
removed all the SQL engines off your machine.  People use it for mail 
merge all the time.  They have no idea they are using SQL.  They just 
click on the features to add or remove fields and are on their way.

>> I don't suggest that Gnucash tries to backup the mysql database itself, but
>> I wouldn't fight against it.  I'm suggesting that Gnucash performs the
>> export which John mentioned as a feature to be considered, as a default
>> option when exiting the program.  I don't understand why you are animate
>> against this protection for the users' data.
> Looking back at the thread I see that I misunderstood what you were
> asking for, apologies for that.  I did indeed think you were asking
> for a backup of the database.
No.  I never once indicated that I thought the Mysql database should be 
backed up.  I was always speaking of the data.  Currently by default the 
data is in an XML file.  In all the XML programming I've done, the whole 
file has always been loaded into memory and dumped with the changes.  I 
have always been suggesting that when exiting out of Gnucash we have a 
feature to dump the data.  I referred to this dump as a backup feature.  
It'd really save a lot of people. It would make giving support extremely 
easy.  When someone says their data is corrupted as what we keep seeing 
repeatedly in this list, some novice like me can ask them to look in 
their backup directory, input one of their recent backups that isn't 
corrupted and replace their non-working active copy (which in my case 
would be the mysql version) with the most recent one that works.

I appreciate your taking the time to start to see what I'm explaining.  
I apologize for not making it clear enough in fewer words.

>> John mentioned, and I'm glad it's being considered, that the incorporation
>> of mysql is a preclude to what may progress into a multiuser system of
>> Gnucash.  When reviewing the list, when multi-user comes up many people
>> start to say, this is a small program, get an expensive program for
>> multi-users.  I'm glad that in spite of the nay's against Gnucash having
>> multi-user capability, it's actually being considered.
>>
>> Of course many people will have an IT person, even for their word processor
>> files.  But I hope Gnucash doesn't become a program where every time a
>> person has a problem, we suggest that it isn't for them, they need to go to
>> their IT.
>>
>> A person doesn't have to know anything about the engine an application is
>> using, to actually use it.  I was surprised and just noticed the mysql
>> option built into the latest version of Gnucash. It's not in the repository
>> version that is installed on my clients machines.  I'll be upgrading theirs
>> to the new Gnucash.  I never opted for the mysql version during the years of
>> my testing and considering Gnucash because of threads like this, that
>> suggested that it was something extremely time consuming and almost
>> impossible for a novice to use.  While I am very flush in SQL development
>> and usage, I wasn't anxious to get into a time consuming operation.  But
>> yesterday when I saw it as an option I clicked on it.  I was very surprised
>> at the ease in using it.  It asked for very simple things, the name of the
>> database and the username and password.
> In fact to use the mySQL backend requires much more than just entering
> the database name, user name and password.  It also requires
> installation and setup of a mySQL server, adding a user with
> appropriate permissions, an understanding of the security implications
> of access to the database.  Not something that a user who, to use your
> own words, does not truly understand what a database engine or xml
> file is, should be doing.

To use any feature of a computer has required some input from someone.  
That goes with Microsoft's SQL, Peachtree's Pervasive and all the other 
applications installed on the computer.

It would be just as easy for me to walk someone through the installation 
and setup of mysql (probably easier) than it has been to walk some of 
our users through upgrading Gnucash from version 2.6.6 to 2.6.7.

For Linux (Ubuntu) the command to install mysql on ones computer is:

sudo apt-get install mysql

Then follow the prompts.  It'll ask the user for a name and password for 
accessing and administrating the database.  They don't have to 
understand it, just answer the questions.  Then place the names and 
passwords into the fields already provided by and currently incorporated 
into Gnucash.  I understand that you think it's complicated.  But for me 
it's very simple and easy to support.

If a user forgets his installed passwords, it's extremely easy to 
recover.  I could give you a couple of lines that would change the names 
and passwords.  There's also simple commands that will reinitialize the 
install without touching the data, which would fix recovering the names 
and passwords.

It would be substantially easier for me to give support to the mysql 
data than spending a lot of time trying to help the users to find 
misplace *.gnucash files.

>>   It was much easier than setting up
>> Wordpress which many novice users can do without know anything about mysql,
>> SQL, database engines, or a lot of basic computer operations.  They just run
>> the setup routine and follow the prompts and leave the technical stuff to
>> the program developers.
>>
>> I believe using mysql is something that will actually make developing and
>> supporting Gnucash easier for the developers and people giving support.  I
>> don't think the users actually have need to know anything about mysql or
>> concerned about it.  Just run the setup... put in their username and
>> password for the installed mysql and be on their way.  I always install
>> mysql on my clients computers, even though they don't know what it is.  When
>> they install an application that uses it, it simply asks them for
>> credentials and everything is automatically setup by the program.
> I think we are getting a bit off topic here, but I don't think it
> would be that simple for a novice user to install mySQL server on his
> PC, and set it up securely.  This is an interesting link:
> https://dev.mysql.com/doc/mysql-security-excerpt/5.0/en/security-guidelines.html

People are having problems with their PC's all the time no matter what 
method they use.  They already have the exploited and secret back-end 
holes of Microsoft SQL products which isn't updated as securely as the 
freeware foundation is.  Just about every component of Windows has 
exploits that you can bring up in this thread.  That shouldn't stop 
developments of the freeware foundation which has more security and is 
easier to control.

The exploits that might be in freeware is easily looked at and fixed.  
The exploits in all the other programs in the Windows environment is 
hidden from the public because the codes are so secretive.  Only the 
hackers and exploiters really know.  They are the ones who are getting 
into the banks, schools and all the other Windows based systems.

I really don't know why you are so animately against mysql.  But I'm 
glad the John has mentioned that it is the direction of Gnucash. I'm 
here to help work out any problems that might arise.  I'll gladly point 
out the benefits for people who for some reason have such strong 
feelings against it.
>> Currently Gnucash doesn't actually setup create the database.  But it would
>> be an extremely simple routine which I would gladly provide if the gnucah
>> developers wanted wanted to consider.  Creating an mysql database is as easy
>> as using a personal username and password to log into the OS (Windows or
>> their Mac computer).
> Gnucash does create the database for you, so I am not sure what you
> are saying.  Creating the database is simple, installing and setting
> up the server is not.

Actually Gnucash does not currently create the database.  That feature 
isn't implemented yet.  You have to manually create the database and 
give the name of the database you created to Gnucash. If you give a name 
that doesn't exist, you'd get an error.

In the current public version of Gnucash, you create the database. 
Gnucash populates the database you create.

Installing and setting up the server is extremely simple.  I give steps 
to hobbyist for doing this all the time.  You'd be surprised at how many 
people post messages on my server saying, they are a novice and don't 
know anything about computers.  I give them three or four steps to do 
and ask them to report back.  In a short period of time they report back 
in amazement at the simplicity.

It appears complicated to you.  For me it isn't.  It's so simple to me 
that I can easily make it simple to anyone that has a question or 
problem with it.

I usually work in Linux.  I believe Linux is many times easier than 
Windows for working.  But I still retain a Windows machine and give 
support for Windows.  I did install mysql on Windows and found it 
extremely simple.
>> So again, I really don't understand why you are so animate against this
>> extremely powerful, yet very easy to use and implement feature.  While I can
>> explore and use XML and Sqlite, I find mysql the easiest of all.
> mySQL requires installation of a server, sqlite does not.  Much
> simpler than mySQL.
Not to me.  Many people are using their Windows machine as servers. They 
are playing movies on their TV off their Windows servers.  They are 
playing music throughout their household and their businesses using 
their Windows machines as servers.  They already have the servers.  
Installing the software for the various components of their servers is 
as simple (to me) as installing Microsoft office or any other product.  
It's so simple to me, that I can make it simple to anyone else that 
cares to perform the steps.
>> The backup feature already exist in Gnucash.  It's called "save as".  All it
>> really takes is a rename from "save as" to "backup" or "export", provide
>> this as an exiting option and it's all done.  I can't imagine anything
>> simpler... and I really don't see where the need of an advance IT
>> professional should have to come into the picture.
> I agree that currently it may be that it would be very simple to
> automatically do an extra save as xml on exit to act as a backup and I
> would have not problems with that as an option.  I can see though that
> this might not be so simple in future when gnucash no longer keeps a
> complete copy of the data in memory but is using an sql database in
> the way it should be used.  Then I imagine a backup would have to lock
> the whole database in order to ensure that it not changed by another
> user while being backed up, then read the database and write the xml
> file.
>
> Colin
If we start out by having local backups in mind, it'll make it easier to 
retain it as the software develops.  I'm glad that you ultimately see 
benefits are may not be so animate against local backups.

I understand what you're saying about the locked files and other data of 
the multiple users.  But again, I'm speaking of the current user 
actually backing up what he has worked with and what is current for 
him.  If and when Gnucash grows to a point where that isn't enough, I'm 
sure that can be dealt with.  I'll gladly be available to help with 
dealing with it as it comes.  I even have answers to how to deal with 
most of the problems that could arise.

I believe with the added ease of the SQL API, the developers might even 
find more time to deal with some of the issues you bring up. But so far, 
while I understand that you might not be able to see it, or believe it, 
but all the issues you have already mentioned, to me are really 
non-issues.  They already have easy resolutions, or maybe a 
misunderstanding on your part as for you having though I was suggesting 
that Gnucash backup mysql, rather than just export the data it has in 
memory.

>> -- L. James
>>
>>
>> On 07/05/2015 05:16 AM, Colin Law wrote:
>>> On 5 July 2015 at 10:02, L. D. James <ljames at apollo3.com> wrote:
>>>> On 07/05/2015 04:34 AM, Colin Law wrote:
>>>>> On 5 July 2015 at 09:18, L. D. James <ljames at apollo3.com> wrote:
>>>>>> ...
>>>>>> I've only worked with a
>>>>>> few accounting problems, I believe all of the ones I've seen perform a
>>>>>> backup when exiting.  It appears the developers have a lot of concern
>>>>>> for
>>>>>> the novice computer users who neglect to backup and are later crying
>>>>>> trying
>>>>>> to find a way to recover their precious data once the active version
>>>>>> becomes
>>>>>> corrupted... just like a number of users in previous different threads
>>>>>> have
>>>>>> been afraid to upgrade for fear of losing their data. I've told them in
>>>>>> each
>>>>>> case to just backup their data, or use one of the default backed up
>>>>>> versions.
>>>>> I don't think a novice computer user will be using mysql or
>>>>> postgreSQL.  A system administrator setting those up must understand
>>>>> how to maintain and back up the databases.  I don't think gnucash
>>>>> should get involved in that.
>>>>>
>>>>> For sqlite I believe the database is simply a single file, so I
>>>>> imagine in that case gnucash could use a similar backup strategy to
>>>>> the one it uses for xml files.
>>>>>
>>>>> Colin
>>>>
>>>> I am an IT professions.  All the people I work with are novice computer
>>>> users.  I don't know many doctors, lawyers, or other business
>>>> professional
>>>> and even accountants that are not novice computer users.  The normal
>>>> computer users depend on the facilities and features built into the
>>>> software
>>>> they use.
>>>>
>>>> Many of the people using this mailing list are not actually novice
>>>> computer
>>>> users.  However, even these people who are not novice computer users are
>>>> having lots of problems asking for support for doing very easy things.
>>>> Having the features I'm describing, of which you're saying an IT person
>>>> should get involved in are things that will make it easier for us helping
>>>> in
>>>> this list to give support to the users.
>>>> ...
>>>> I don't know who your clients are.  But none of my clients truly
>>>> understand
>>>> what a database engine or xml file is.  They barely understand what a zip
>>>> archive is.  The ones who has a clue for some of this couldn't put it
>>>> into
>>>> words.
>>> You are missing my point, I think.  No novice computer user is going
>>> to setup mySQL.  Where a novice computer user is using mySQL there
>>> will be a sys admin who setup the database for him/her.  I do not
>>> believe mySQL will ever be the default, possibly it may be sqlite.
>>> Gnucash cannot (I believe) be responsible for backup of a mySQL
>>> database, only the system administrator can be responsible for that.
>>> Can you suggest any other app that uses mySQL that handles database
>>> backups within the app?
>>>
>>> In the case of sqlite it may well be that your points are entirely
>>> valid, as I suggested in my previous post.
>>>
>>> Colin

-- L. James

-- 
L. D. James
ljames at apollo3.com
www.apollo3.com/~ljames


More information about the gnucash-user mailing list