Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 10 of 16 total
Thread Backup using Client/Server
Mon, Aug 20 2018 2:01 PMPermanent Link

Lance Rasmussen

CDE Software

Avatar

Team Elevate Team Elevate

Apologies if asked and answered on a different thread.

Using as a client/server.  In the majority of cases, the client is installed on the same computer as the server.  So when doing the backup, I have it backup to the Windows Temp folder using a time stamp as part of the file name, then copy it from that folder to the destination the customers chose in a File Save dialog.   No problem.

However, it seems that when customers are running the client on a computer that is different than the server, the backup procedure doesn't work and they get a 3431 error.

Any suggestions?

I'm using build 6 with the current (as of today) EDB on Delphi 10.2.3.
Tue, Aug 21 2018 2:21 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Lance


I don't think the error is an ElevateDB number (can't find it in the manual) but I'm guessing that its either because you're mixing up the server viewpoint and the client viewpoint or AV related.

The server looks at everything from its directory structure, clients use their directory structure and you have to adapt to this or use UNC paths (works pretty much all of the time).

What you may want to consider is using ElevateDB's stores and simply create one from the user folder selection rather than writing the backup and then moving it.

I've attached the form I use in case its any help.

Roy Lambert






Attachments: Backup.dfm Backup.pas
Tue, Aug 21 2018 1:41 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Lance,

<< Using as a client/server.  In the majority of cases, the client is installed on the same computer as the server.  So when doing the backup, I have it backup to the Windows Temp folder using a time stamp as part of the file name, then copy it from that folder to the destination the customers chose in a File Save dialog.   No problem.

However, it seems that when customers are running the client on a computer that is different than the server, the backup procedure doesn't work and they get a 3431 error. >>

That's not an EDB error code.  Are you using the EDB COPY FILE statement to copy the file to a known store, or are you trying to do a raw file copy ?  If the latter, then Roy is correct - you can't do that unless the client's view of the server machine is consistent.  This is pretty much why we added the store functionality to EDB - it gives your client applications a stable, virtual set of stores, even when the actual physical locations on the server machine are different.

Tim Young
Elevate Software
www.elevatesoft.com
Tue, Oct 30 2018 7:49 PMPermanent Link

Lance Rasmussen

CDE Software

Avatar

Team Elevate Team Elevate

Sorry for the delay - And thank you Roy for the sample code.

I'm still not getting this to work when the server is not on the local machine. I'm sure I'm missing something simple.

           try
             UserSession.Execute('DROP STORE "MBDIIBACKUPS" KEEP CONTENTS');
           except
           end;

           sqlCmd :=  'CREATE STORE "MBDIIBACKUPS" AS LOCAL PATH ' + QuotedStr(TPath.GetTempPath);
           UserSession.Execute(sqlCmd);

          sqlCmd := 'BACKUP DATABASE ' + DATABASE_NAME + ' AS ' + '"' + copy(
             ExtractFileName( SaveDialog.FileName ), 0,
             length( ExtractFileName( SaveDialog.FileName ) ) - length( ExtractFileExt( ExtractFileName(
               SaveDialog.FileName ) ) ) ) + '"' +
             ' TO STORE "MBDIIBACKUPS" INCLUDE CATALOG ';

            UserQuery.ExecSQL;
            TFile.Copy(TPath.GetTempPath+ExtractFileName(SaveDialog.FileName), SaveDialog.FileName);
            UserSession.Execute('DROP STORE "MBDIIBACKUPS" KEEP CONTENTS');

I'm attempting to backup to User temp folder of local machine then copying to where they want locally.

So do I have to set up Remote store, then do the copy?  When I changed the Windows Temp path to be "C:\Temp\" and set up a C:\Temp on the IDE VM and on the real machine where the server is on, I noticed it created the backup file on the computer the server is on, not the VM with Delphi that I'm testing this.
Tue, Oct 30 2018 8:15 PMPermanent Link

Lance Rasmussen

CDE Software

Avatar

Team Elevate Team Elevate

Out of curiosity, I opened the ElevateDB Manager inside the Delphi VM and created a new session pointing to the remote DB on the host machine.  Connected, everything fine.
I created a local store pointing to my VM's C:\Temp folder.
I then backed up the DB to the store.
My expectation is that the backup file is in the VM, yet it's on the host.  Am I wrong in my expectation?  

The SQL History:

CREATE STORE "REMOTEMBDBACKUP"
AS LOCAL PATH 'C:\Temp'

BACKUP DATABASE "MBDII"
AS "MBDII Backup On 2018-10-30"
TO STORE "REMOTEMBDBACKUP"
DESCRIPTION ''
COMPRESSION 6
INCLUDE CATALOG
Wed, Oct 31 2018 3:58 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Lance


In c/s operation the paths are all for the server's machine, not the client's. If you want them on the client you'll need to use UNC paths.

Roy Lambert
Wed, Oct 31 2018 4:24 AMPermanent Link

Malcolm Taylor

Roy Lambert wrote:

> Lance
>
>
> In c/s operation the paths are all for the server's machine, not the
> client's. If you want them on the client you'll need to use UNC paths.
>
> Roy Lambert

Or do what I have devised in a 3 step process to avoid using shares
(remember those!):

1. Run the backup - saved in a known store on server
2. Call a (Delphi) procedure on the server host which takes the
client's IP and detination path then does a TCP file copy to the client
3. On the Client, do whatever I want with the backup file

I have to run on ad hoc LANs so I decided that 'proper' things like
replication and remote stores were impractical - different every week.
Horses and courses.

Malcolm
Wed, Oct 31 2018 1:07 PMPermanent Link

Lance Rasmussen

CDE Software

Avatar

Team Elevate Team Elevate

I guess the problem I see with that is that if I had an EDB server hosted on an Amazon EC2 machine behind their firewall, I would have to go to extra steps to get that backup and UNC would not work.

At least from the functionality of the EDB Manager, it may need to be adjusted to take into consideration that the session is remote and prevent being able to choose the local store path, if in c/s sessions, the Local Path is considered local to the server, not the client.



Roy Lambert wrote:

Lance


In c/s operation the paths are all for the server's machine, not the client's. If you want them on the client you'll need to use UNC paths.

Roy Lambert
Wed, Oct 31 2018 1:50 PMPermanent Link

Lance Rasmussen

CDE Software

Avatar

Team Elevate Team Elevate

I'm wondering if I may have to look at something like Remobject Remoting SDK (I have license) to transfer file over network streaming, not caring about UNC,  Then do the backup on the server, then use the SDK to transfer the file after creation.
Wed, Oct 31 2018 5:26 PMPermanent Link

Raul

Team Elevate Team Elevate

On 10/31/2018 1:50 PM, Lance Rasmussen wrote:
> I'm wondering if I may have to look at something like Remobject Remoting SDK (I have license) to transfer file over network streaming, not caring about UNC,  Then do the backup on the server, then use the SDK to transfer the file after creation.
>

Are you running any kind of a web server on the server side ?

it does introduce some security issues but assuming your web server does
not allow file browsing and you use a complex URL (like GUID in folder
name) you could do
1. have a file store pointing to a folder that is web server published
(with guid name or such to make it hard to guess/scan for)
2. once backup is done you launch a browser from app to download file
(or simple to download from delphi app once you know what the url looks
like)

Raul
Page 1 of 2Next Page »
Jump to Page:  1 2
Image