Welcome to the nuBuilder Forums!

Register and log in to access exclusive forums and content available only to registered users.

Backup Procedure

Questions related to using nuBuilder Forte.
Post Reply
Mr71
Posts: 41
Joined: Thu Sep 30, 2021 10:32 am

Backup Procedure

Unread post by Mr71 »

I've inserted a button that successfully performs the procedure of back-up of the database.
Two questions:
1) is it possible to assign for other users the backup procedure in "access level"?! (and avoid "Access Denied"?!)
2) would it be possible to download the gzip backup file instead of keeping it on the server!?

Thanks ...
kev1n
nuBuilder Team
Posts: 4297
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 444 times
Contact:

Re: Backup Procedure

Unread post by kev1n »

Hi,


Create a new Procedure that will run nuBuilder's backup procedure and assign access levels.

Code: Select all

$p = nuProcedure('nubackup');
eval($p);
The variable $dump_file contains the path to the file. Use readfile() to download it to the browser.
Mr71
Posts: 41
Joined: Thu Sep 30, 2021 10:32 am

Re: Backup Procedure

Unread post by Mr71 »

I created the procedure with your code, tested.... works, assigned to userA, login with the userA, click on the button and ... Access To Procedure Denied... (nubackup)

it's seems only for the administrator....
kev1n
nuBuilder Team
Posts: 4297
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 444 times
Contact:

Re: Backup Procedure

Unread post by kev1n »

What code does the button run?

It's supposed to run

Code: Select all

nuRunPHPHidden('create_backup',0)
Mr71
Posts: 41
Joined: Thu Sep 30, 2021 10:32 am

Re: Backup Procedure

Unread post by Mr71 »

Now works Kevin!!! Thanks!
oli
Posts: 118
Joined: Sat Mar 20, 2021 3:22 pm
Has thanked: 4 times

Re: Backup Procedure

Unread post by oli »

Hello,
I tried to use the var $dump_file to get the filename but it seems this is not working for me.

Here's the value of "$dump_file" after creating a dump file (the file was created on the server):

Code: Select all

L21udC93ZWIxMDMvZDAvODIvNTcwMDg4Mi9odGRvY3Mvd2ViYXBwL2NvcmUvbGlicy9teXNxbGR1bXAvZHVtcHMvMTEtMjYtMjAyMV8wODozMjo0Ml9udUJ1aWxkZXJfYmFja3VwLnNxbC5nemlw
Any idea what I'm doing wrong here?

Thanks in advance,
Oli
kev1n
nuBuilder Team
Posts: 4297
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 444 times
Contact:

Re: Backup Procedure

Unread post by kev1n »

It's base 64 encoded, try decoding it:

Code: Select all

base64_decode($dump_file);
oli
Posts: 118
Joined: Sat Mar 20, 2021 3:22 pm
Has thanked: 4 times

Re: Backup Procedure

Unread post by oli »

Thanks a lot kev!n !
kev1n wrote:It's base 64 encoded, try decoding it:

Code: Select all

base64_decode($dump_file);
Post Reply