PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV Mobile 23 → [WM23] Backup
[WM23] Backup
Débuté par ARV, 25 sep. 2018 17:37 - 9 réponses
Membre enregistré
245 messages
Posté le 25 septembre 2018 - 17:37
Hi all

Look I have really problems with HFSQL Classic files.
Theres an app that I create this app could be used offline for a really good reason, the user not always have an internet connection, so it was create it like this just that the user could use it anywhere he wants.

The app have a button to send everything to the server when the user have internet.

Because for my exp I have really bad situations that I lost everything the device have for the same reason I don't have all the exp on this scenarios.

So I want to know if there's a way to do some backup of the data files of HFSQL Classic, I want to have backups everytime I send updateds, or when the device it's on my hands could have a button with a function or something to do some local backups before the app crash for some reason and the only option it's to delete the app.

I search on PCsoft documents but didn't find anything right now...

they have functions of HBackup but only for Client/Server....

please help!
Thanks!


PD: I tried to use fDataDir on my app but doesn't exist my file for some reason, also I use fExeDir or fCurrentDir and Can't get the file on my app (I do not use another app to access these files).

I use these just to tried to copy the .Fic file but I can't get it...

--
Best Regards
ARV
Message modifié, 25 septembre 2018 - 17:38
Membre enregistré
245 messages
Posté le 25 septembre 2018 - 18:36
Hi all

I finally did it~
like this:

fCopyFile(fDataDir()+fSep()+"tablea.fic",gspath+gsPathBackup)
fCopyFile(fDataDir()+fSep()+"tablea.ndx",gspath+gsPathBackup)


I was doing like this:
fCopyFile(fDataDir()+fSep()+"TableA.fic",gspath+gsPathBackup)
fCopyFile(fDataDir()+fSep()+"TableA.ndx",gspath+gsPathBackup)


for some reason the upper case can't let the device find the name of the table, I don't know why but it's like that.
maybe it's the name that have the description of the analysis I still don't know...

now I have the .fic for some backup files when I have the device of the user on my hands, the user can't get this function unless He know what password I use for access this option.

cya!

--
Best Regards
ARV
Message modifié, 25 septembre 2018 - 18:36
Posté le 25 septembre 2018 - 20:17
Hello Arv,

there are several answers to your question... First, my preferred
method: WXReplication.

This is an open source project available on y web site, able to
replicate the data between mobile, windows app, and a server, in BOTH
direction...

So every time there is internet access, the new/modified stuff is send
back and forth.

This is similar in theory with what you are describing, but my system
has never lost any data.

Second; yes of course you can copy your file on another place on the
mobile before sending data to the server (or at any other time)

By default, your DB is in the program directory, and the reason you
can't see the files is because that area is protected by the android OS.

What you can see is the public space (real or emulated sdcard)...

So you CAN copy your files from their current directory
(filename..directory should give it to you, or frepexe) to the sdcard
(and back if needed)

I have to say that even though it's possible, it shouldn't be necessary
and you should investigate what is happening that makes you want to do
that. It seems to me that your time would be better spent solving the
problem than coding something that would only alleviate the symptoms


best regards

--
Fabrice Harari
International WinDev, WebDev and WinDev mobile Consulting

Free Video Courses, free WXShowroom.com, open source WXReplication, open
source WXEDM.

More information on http://www.fabriceharari.com


On 9/25/2018 9:37 AM, ARV wrote:
Hi all

Look I have really problems with HFSQL Classic files.
Theres an app that I create this app could be used offline for a really
good reason, the user not always have an internet connection, so it was
create it like this just that the user could use it anywhere he wants.

The app have a button to send everything to the server when the user
have internet.

Because for my exp I have really bad situations that I lost everything
the device have for the same reason I don't have all the exp on this
scenarios.

So I want to know if there's a way to do some backup of the data files
of HFSQL Classic, I want to have backups everytime I send updateds, or
when the device it's on my hands could have a button with a function or
something to do some local backups before the app crash for some reason
and the only option it's to delete the app.

I search on PCsoft documents but didn't find anything right now...

they have functions of HBackup but only for Client/Server....

please help!
Thanks!


PD: I tried to use fDataDir on my app but doesn't exist my file for some
reason, also I use fExeDir or fCurrentDir and Can't get the file on my
app (I do not use another app to access these files).

I use these just to tried to copy the .Fic file but  I can't get it...

--
Best Regards
ARV
Membre enregistré
245 messages
Posté le 25 septembre 2018 - 23:19
Hi Fabrice Harari

Thanks for your reply

Yes I search about replication, it's a really good tool I can tell, but now this is not the case because that's only HFSQL C/S DB and no HFSQL Classic.

Now for my problem yes, I think it was when I update the Classic files I do not use HModifyStructure over my classic files (back in the day I was really naive about all of this stuff) so yes the app crash and I never knew how to solve it until now.

about HModifyStructure there's a lot of way to use it, over Classic files or HFSQL C/S files, the second one it's not really a good option because the lag of the start of my app so that moment in particular it needs to be coded in a special case.

About HFSQL Classic files doesn't care about time because it's really fast.

Now metion about HmodifyStructure I use the option of hmsNoCheck, I think it's the best option, because it doesn't matter if it's new or old it always update the file of the app. (If I'm wrong please correct me)

But because all of my exp about this really big problem (like 2 years with this **** problem) I want to be secure about everything that's why I want to do a backup, coping the file just in case everything get worse than ever (and be secure for my life too).

so in the end the problem was I never use HModifyStructure at the start of my app over my Classic files.
When the time pass I thought that using this fuction with "*" and the option Background like this

HModifyStructure("*", hmsBackgroundTask)


will affect all of my tables but I was wrong, the option hmsBackgroundTask only works on HFSQL C/S an not the Classics one so that's also why this function doesn't work on my tables on a local place...

so I ended typing all of my local tables with the option hmsNoCheck and if in the future I updated a HFSQL C/S file then I will write it for that updated and the next updated the code I will cut it out.

if something it's missing please let me know I will really appreciate it, in another time I really want to talk about Replication Server to Server I know a little stuff of this, sometime also I will see your Website about this topic.

Then again thanks for your reply.

--
Best Regards
ARV
Message modifié, 25 septembre 2018 - 23:24
Posté le 26 septembre 2018 - 13:46
Hi,

On 9/25/2018 3:19 PM, ARV wrote:
Hi Fabrice Harari

Thanks for your reply
Yes I search about replication, it's a really good tool I can tell, but
now this is not the case because that's only HFSQL C/S DB and no HFSQL
Classic.


WXReplication works for ALL DBs, as long as you have a native access
available for hadd/hdelete and hmodify to work. So HF classic et HF CS
are no problem

As for your case, you have HF classic on the mobile device and CS on the
server, so yes, it is perfectly adapted.

Now for my problem yes, I think it was when I update the Classic files I
do not use HModifyStructure over my classic files (back in the day I was
really naive about all of this stuff) so yes the app crash and I never
knew how to solve it until now.

about HModifyStructure there's a lot of way to use it, over Classic
files or HFSQL C/S files, the second one it's not really a good option
because the lag of the start of my app so that moment in particular it
needs to be coded in a special case.

About HFSQL Classic files doesn't care about time because it's really fast.

Now metion about HmodifyStructure I use the option of hmsNoCheck, I
think it's the best option, because it doesn't matter if it's new or old
it always update the file of the app. (If I'm wrong please correct me)


In theory, this option is only for special cases where there was a
previous problem. If you want to ignore that previous proboem and just
treat the symptom (again, not my advice) then you can use that option
all the time.


But because all of my exp about this really big problem (like 2 years
with this **** problem) I want to be secure about everything that's why
I want to do a backup, coping the file just in case everything get worse
than ever (and be secure for my life too).

so in the end the problem was I never use HModifyStructure at the start
of my app over my Classic files.
When the time pass I thought that using this fuction with "*" and the
option Background like this

HModifyStructure("*", hmsBackgroundTask)


will affect all of my tables but I was wrong, the option
hmsBackgroundTask only works on HFSQL C/S an not the Classics one so
that's also why this function doesn't work on my tables on a local place...

so I ended typing all of my local tables with the option hmsNoCheck and
if in the future I updated a HFSQL C/S file then I will write it for
that updated and the next updated the code I will cut it out.


You can use the "*" on android, just don't use the background task
option on it, it's classic mode.

if something it's missing please let me know I will really appreciate
it, in another time I really want to talk about Replication Server to
Server I know a little stuff of this, sometime also I will see your
Website about this topic.


There is no difference between replication server to server and client
to server (at least not with wxreplication)...

Best regards

--
Fabrice Harari
International WinDev, WebDev and WinDev mobile Consulting

Free Video Courses, free WXShowroom.com, open source WXReplication, open
source WXEDM.

More information on http://www.fabriceharari.com

Then again thanks for your reply.

--
Best Regards
ARV
Membre enregistré
245 messages
Posté le 26 septembre 2018 - 21:36
Hi Fabrice Harari

Fabrice Harari wrote:
As for your case, you have HF classic on the mobile device and CS on the
server, so yes, it is perfectly adapted.


So this could work, thanks!
just having two tables with differents type of connections but also have all the same except the names (obvious for the analysis couldn't have two tables with the same name).

In theory, this option is only for special cases where there was a
previous problem. If you want to ignore that previous proboem and just
treat the symptom (again, not my advice) then you can use that option
all the time.


hmmm... Your advice, is it to use the WXReplication? or some other way?

You can use the "*" on android, just don't use the background task
option on it, it's classic mode.


I will give it a try the next update I have for my app, Did I use hmsNoCheck or the default one?

There is no difference between replication server to server and client
to server (at least not with wxreplication)...


Talking about the WXReplication I see it on your website but I have a problem, I open the TestAndroid one but I can't open the analysis for some reason, it launch me an info the first time I open the project on my WM23, it looks like want to search for one file and doesn't find it also including the querys.

--
Best Regards
ARV
Membre enregistré
245 messages
Posté le 26 septembre 2018 - 21:41
ARV wrote:
hmmm... Your advice, is it to use the WXReplication? or some other way?





Fabrice Harari wrote:
Hello Arv,

there are several answers to your question... First, my preferred
method: WXReplication.

This is an open source project available on y web site, able to
replicate the data between mobile, windows app, and a server, in BOTH
direction...

So every time there is internet access, the new/modified stuff is send
back and forth.

This is similar in theory with what you are describing, but my system
has never lost any data.



Sorry I see it now, well I can't open the analysis I miss something I still don't know what it is

Thanks!

--
Best Regards
ARV
Message modifié, 26 septembre 2018 - 21:49
Posté le 27 septembre 2018 - 12:59
Hi ARV,


On 9/26/2018 1:36 PM, ARV wrote:
Hi Fabrice Harari

Fabrice Harari wrote:
As for your case, you have HF classic on the mobile device and CS on the
server, so yes, it is perfectly adapted.

So this could work, thanks!
just having two tables with differents type of connections but also have
all the same except the names (obvious for the analysis couldn't have
two tables with the same name).


Wrong... You need to describe the files only ONCE; and I advise as HF
Classic, all the time... then, by code, on each machine, you ASSIGN to
the file it's connection type (so hf classic, hfCS, mysql, MSSql, etc)

In WXReplication, you need to have the SAME file on each side, not 2
files with different names and PERHAPS the same structure.



In theory, this option is only for special cases where there was a
previous problem. If you want to ignore that previous proboem and just
treat the symptom (again, not my advice) then you can use that option
all the time.

hmmm... Your advice, is it to use the WXReplication? or some other way?


Yep...

You can use the "*" on android, just don't use the background task
option on it, it's classic mode.

I will give it a try the next update I have for my app, Did I use
hmsNoCheck or the default one?


See answer above... (in theory, this option...)

There is no difference between replication server to server and client
to server (at least not with wxreplication)...

Talking about the WXReplication I see it on your website but I have a
problem, I open the TestAndroid one but I can't open the analysis for
some reason, it launch me an info the first time I open the project on
my WM23, it looks like want to search for one file and doesn't find it
also including the querys.


I certainly can't help if you are not giving me the messages... My
crystal ball is broken

Best regards

--
Fabrice Harari
International WinDev, WebDev and WinDev mobile Consulting

Free Video Courses, free WXShowroom.com, open source WXReplication, open
source WXEDM.

More information on http://www.fabriceharari.com


--
Best Regards
ARV
Membre enregistré
245 messages
Posté le 27 septembre 2018 - 15:50
Hi Fabrice

Fabrice Harari wrote:
Hi ARV,


On 9/26/2018 1:36 PM, ARV wrote:
Hi Fabrice Harari

Fabrice Harari wrote:
As for your case, you have HF classic on the mobile device and CS on the
server, so yes, it is perfectly adapted.

So this could work, thanks!
just having two tables with differents type of connections but also have
all the same except the names (obvious for the analysis couldn't have
two tables with the same name).


Wrong... You need to describe the files only ONCE; and I advise as HF
Classic, all the time... then, by code, on each machine, you ASSIGN to
the file it's connection type (so hf classic, hfCS, mysql, MSSql, etc)





Ok I see, like on WXReplication


You can use the "*" on android, just don't use the background task
option on it, it's classic mode.

I will give it a try the next update I have for my app, Did I use
hmsNoCheck or the default one?


See answer above... (in theory, this option...)




Ok I will put that option to you said before.


There is no difference between replication server to server and client
to server (at least not with wxreplication)...

Talking about the WXReplication I see it on your website but I have a
problem, I open the TestAndroid one but I can't open the analysis for
some reason, it launch me an info the first time I open the project on
my WM23, it looks like want to search for one file and doesn't find it
also including the querys.


I certainly can't help if you are not giving me the messages... My
crystal ball is broken




I see what the error was, I solve it don't worry, I'm looking on the project, there are a lot of stuff on that
I'm more searching the part to send or replicate the data from Classic to the Server
I see you use and URL an some stuff to connect not sure at all but I'm trying to understand.

but also I'm doing some other projects so I work and see your project time to time.

I'm really interesting on how to replicated from classic to the server, I have the same files on each side but with different names, back in the day I never knew how to send it and until now I use that method, to use querys and send it but if WXReplication can send it when the internet it's available then great! I need it to work on my projects.

Thanks for the idea and the reply

--
Best Regards
ARV
Posté le 27 septembre 2018 - 16:05
Hi ARV,

if you want to understand WXReplication, you need to:

1. Read ALL the pages in the BEFORE YOU DOWNLOAD chapter (35+ pages)
2. Watch the video courses on WXReplication (around 8 hours)

Without doing that, there is very little chance that you'll get what you
need from my project.

Best regards

--
Fabrice Harari
International WinDev, WebDev and WinDev mobile Consulting

Free Video Courses, free WXShowroom.com, open source WXReplication, open
source WXEDM.

More information on http://www.fabriceharari.com


On 9/27/2018 7:50 AM, ARV wrote:
Hi Fabrice

Fabrice Harari wrote:
Hi ARV,


On 9/26/2018 1:36 PM, ARV wrote:
Hi Fabrice Harari

Fabrice Harari wrote:
As for your case, you have HF classic on the mobile device and CS on the
server, so yes, it is perfectly adapted.

So this could work, thanks!
just having two tables with differents type of connections but also have
all the same except the names (obvious for the analysis couldn't have
two tables with the same name).


Wrong... You need to describe the files only ONCE; and I advise as HF
Classic, all the time... then, by code, on each machine, you ASSIGN to
the file it's connection type (so hf classic, hfCS, mysql, MSSql, etc)





Ok I see, like on WXReplication


You can use the "*" on android, just don't use the background task
option on it, it's classic mode.

I will give it a try the next update I have for my app, Did I use
hmsNoCheck or the default one?


See answer above... (in theory, this option...)




Ok I will put that option to you said before.


There is no difference between replication server to server and client
to server (at least not with wxreplication)...

Talking about the WXReplication I see it on your website but I have a
problem, I open the TestAndroid one but I can't open the analysis for
some reason, it launch me an info the first time I open the project on
my WM23, it looks like want to search for one file and doesn't find it
also including the querys.


I certainly can't help if you are not giving me the messages... My
crystal ball is broken




I see what the error was, I solve it don't worry, I'm looking on the
project, there are a lot of stuff on that
I'm more searching the part to send or replicate the data from Classic
to the Server
I see you use and URL an some stuff to connect not sure at all but I'm
trying to understand.

but also I'm doing some other projects so I work and see your project
time to time.

I'm really interesting on how to replicated from classic to the server,
I have the same files on each side but with different names, back in the
day I never knew how to send it and until now I use that method, to use
querys and send it but if WXReplication can send it when the internet
it's available then great! I need it to work on my projects.

Thanks for the idea and the reply

--
Best Regards
ARV