Forums / Addon Admin Tools / Backup MySQL Database

Backup MySQL Database

Views: 87,454

Results 161 to 180 of 327
19 May 2017, 7:38 PM
#161
pubaolao avatar

pubaolao

New Zenner

Join Date:
Jun 2016
Location:
Denmark
Posts:
17
Plugin Contributions:
0

Backup MySQL Database

Hi, when I want to make a backup with "backup mysql" plugin, I get following messges.
"You do not have SSL enabled. Any downloads you do from this page will not be encrypted. Doing backups and restores will be fine, but download/upload of files from/to the server presents a security risk".
I have SSL-certificate installed on my webhost server, so what could be the reason why I get that message?
I will appreciate any help with this problem please.

https://gaigear.com
Zen-Cart v. 1.5
Template: Mobishop Blue, from
backup mysql
Populat 4
ZX Slideshow
Ckeditor
Google Language
Php v. 5.6.24

20 May 2017, 12:54 PM
#162
pubaolao avatar

pubaolao

New Zenner

Join Date:
Jun 2016
Location:
Denmark
Posts:
17
Plugin Contributions:
0

Re: Backup MySQL Database

Hi, I have a problem with a security message. When I want to make a backup with "backup mysql" plugin, I get following messge:
"You do not have SSL enabled. Any downloads you do from this page will not be encrypted. Doing backups and restores will be fine, but download/upload of files from/to the server presents a security risk".
The thing is, I have SSL installed, and I had it confirmed yesterday, that the "SSL-certificate" is installed correct.
I would appreciate it very much, if someone in here could help me, how i can fix this problem please.

Zen Cart v. 1.5.5
Easy Populate 4
Google Language
CKeditor
ZX-Slideshow
and of course backup mysql
Tempate: Mobishop from 12leaves.com

20 May 2017, 4:36 PM
#163
lankeeyankee avatar

lankeeyankee

Totally Zenned

Join Date:
Jan 2007
Posts:
1,514
Plugin Contributions:
1

Re: Backup MySQL Database

Do you have SSL enabled in the configure files?


Zen Cart and it's community are the best!!

20 May 2017, 6:08 PM
#164
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: Backup MySQL Database

pubaolao:

Any downloads you do from this page will not be encrypted. Doing backups and restores will be fine, but download/upload of files from/to the server presents a security risk"

  1. As the message said, doing backups and restores will be fine.

  2. The entire message will disappear once you fix the SSL issues you have with your site. You're already discussing them in another thread, so let's leave that discussion over there. Securing your Admin is as simple as using https URLs in your admin configure.php. Again, discuss it in the OTHER thread where you're already sorting that out.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

12 Jul 2017, 1:48 PM
#165
lopi avatar

lopi

New Zenner

Join Date:
Jan 2009
Posts:
45
Plugin Contributions:
0

Re: Backup MySQL Database

Hi, after install I have this problem
Result code: 1
0 => '"mysqldump"' is not recognized as an internal or external command,
1 => operable program or batch file.
Failure: The database has NOT been saved.
zen 1.5.5.e any idea ?

16 Jul 2017, 9:55 PM
#166
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: Backup MySQL Database

Lopi:

Hi, after install I have this problem
Result code: 1
0 => '"mysqldump"' is not recognized as an internal or external command,
1 => operable program or batch file.
Failure: The database has NOT been saved.
zen 1.5.5.e any idea ?
That suggests that the server doesn't have the mysqldump binary installed. Your hosting company may not have installed it.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

23 Nov 2017, 5:01 PM
#167
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Backup MySQL Database

idtags:

I installed BACKUP_MYSQL Admin Tool Designed for: Zen Cart v1.3.x and 1.5.x series on my 1.5.5. Zen Cart.

Everything appears is working fine.

But I have 2 questions:

  1. Admin->Tool menu shows sub menu "DataBase BACKUP_MYSQL" 2 times:

[Attachment no longer available]

  1. When I use both options **No Compression (Pure SQL) ** and Use GZIP generating backup is compressed in both cases.

Is this issue of installation of web hosting server software?

Any suggestions are appreciated.

I've finally gotten around to again needing to get this to work on a particular host because I have some specific database testing to perform and after a good bit of review and minor modification I came across the above issue (which actually was the problem to begin with).

So here's thing and I'll address the above first:
Starting on line 209 of admin/backup_mysql.php:

          switch ($_POST['compress'] && file_exists(DIR_FS_BACKUP . $backup_file)) {
            case 'gzip':
              @exec(LOCAL_EXE_GZIP . ' ' . DIR_FS_BACKUP . $backup_file);
              if (file_exists(DIR_FS_BACKUP . $backup_file)) @exec('gzip ' . DIR_FS_BACKUP . $backup_file);
              break;
            case 'zip':
              @exec(LOCAL_EXE_ZIP . ' -j ' . DIR_FS_BACKUP . $backup_file . '.zip ' . DIR_FS_BACKUP . $backup_file);
              if (file_exists(DIR_FS_BACKUP . $backup_file) && file_exists(DIR_FS_BACKUP . $backup_file . 'zip')) unlink(DIR_FS_BACKUP . $backup_file);
          }

The test to the right of the word switch: $_POST['compress'] && file_exists(DIR_FS_BACKUP . $backup_file) Well... by checking the radio button for "NOT" compressing (or to compress) well that results in the post to contain some text (even if it is the word no) and then that is && with the existence of the file which should basically be true at least when submitted through the admin screen interface. Well, the post of text that is not false && with a true condition evaluates to true. Then case 'gzip' is evaluated against a statement of true and since gzip isn't false or NULL it evaluates as true and the code within the case 'gzip' area is executed. During that execution (which is how I found the solution to my problems) the gzip function is attempted any number of ways. First by use of the software as identified in LOCAL_EXE_GZIP (defined in admin/includes/init_includes/init_gzip.php) and then basically if that doesn't work directly by use of gzip. What this also means though is that the 'zip' code never gets executed...

So I made the following changes in this area:

          switch ($_POST['compress'] [B]. ([/B]file_exists(DIR_FS_BACKUP . $backup_file)[B] ? 'true' : '')[/B]) {
            [B]case 'notrue':
              break;[/B]
            case 'gzip[B]true[/B]':
              @exec(LOCAL_EXE_GZIP . ' ' . DIR_FS_BACKUP . $backup_file);
              if (file_exists(DIR_FS_BACKUP . $backup_file)) @exec('gzip ' . DIR_FS_BACKUP . $backup_file);
              break;
            case 'zip[B]true[/B]':
              @exec(LOCAL_EXE_ZIP . ' -j ' . DIR_FS_BACKUP . $backup_file . '.zip ' . DIR_FS_BACKUP . $backup_file);
              if (file_exists(DIR_FS_BACKUP . $backup_file) && file_exists(DIR_FS_BACKUP . $backup_file . 'zip')) unlink(DIR_FS_BACKUP . $backup_file);
          }

But... There's something about it all... There is just enough functionality in here to support a compressed backup, which could unfortunately also not be decompressed if several things do not line up correctly. I later found that I had to either modify the setting for LOCAL_EXE_GUNZIP to just be gunzip instead of some file path or modify the command for unzipping so that it referenced gunzip directly rather than with LOCAL_EXE_GUNZIP... Problem being that the decompressed file would get generated but have no content in it and because it exists that there was an attempt to restore the "nothing" which "succeeded" though made no changes.

Anyways, had the above "mistake" not existed, then I wouldn't have known that the system supported gzip (install seemed to indicate that it didn't exist, but when running the backup of this site, a file was successfully gziped even when the request was to not do so... Ie. a whole mess of confusion, but finally sorted out... Now though, if nothing else is done to attempt to override the compression, every backup would be non-compressed and still would not know that the system supported compression... Little bit of a round robin, no? Obviously a little additional checking here or there might make it easier/faster to resolve, but...

The above may or may not help someone, I don't really suggest making the changes in the base code without first incorporating some sort of additional testing/checking that gzip isn't an available option. I can safely make the above change(s) the the plugin's file, identify to the plugin to override compression, and modify the path to the compression/decompression programs and now have the option to export compressed or not, and can restore either a compressed or non-compressed file.
Total changes:
Above code changes.
in: admin/includes/extra_datafiles/backup_mysql.php
changed:

define('COMPRESS_OVERRIDE',false);
//define('COMPRESS_OVERRIDE',true);

to:

//define('COMPRESS_OVERRIDE',false);
define('COMPRESS_OVERRIDE',true);

in admin/includes/init_includes/init_gzip.php
changed:

  define('LOCAL_EXE_GZIP', '/usr/bin/gzip');
  define('LOCAL_EXE_GUNZIP', '/usr/bin/gunzip');
  define('LOCAL_EXE_ZIP', '/usr/local/bin/zip');
  define('LOCAL_EXE_UNZIP', '/usr/local/bin/unzip');

to:

  define('LOCAL_EXE_GZIP', 'gzip');
  define('LOCAL_EXE_GUNZIP', 'gunzip');
  define('LOCAL_EXE_ZIP', 'zip');
  define('LOCAL_EXE_UNZIP', 'unzip');

though the changes made above won't really make the zip option available for selection. That requires some other modifications for that option to be displayed.

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

29 Aug 2018, 2:06 PM
#168
twitchtoo avatar

twitchtoo

Totally Zenned

Join Date:
Apr 2007
Location:
Ontario, Canada
Posts:
1,733
Plugin Contributions:
14

Re: Backup MySQL Database

idtags:

  1. When I use both options **No Compression (Pure SQL) ** and Use GZIP generating backup is compressed in both cases.

Is this issue of installation of web hosting server software?

Any suggestions are appreciated.

The radio button does not work correctly when saving to the server, it only uses the defaulted radio button - gzip regardless of the selection.

Select 'Download without...' and the radio buttons work.

Twitch.
https://www.twitchtoo.com Do you work for free? Please donate.
June 7.2026 - NOW AVAILABLE - Twitch Base8 - Obsidian

10 Sep 2018, 4:24 AM
#169
twitchtoo avatar

twitchtoo

Totally Zenned

Join Date:
Apr 2007
Location:
Ontario, Canada
Posts:
1,733
Plugin Contributions:
14

Re: Backup MySQL Database

The database went beyond 1MB and now this is the error when attempting to download the raw sql file:


[10-Sep-2018 04:05:01 UTC] PHP Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 14007287 bytes) in /home/hidden_name/public_html/shop/hidden_admin/backup_mysql.php on line 204

[10-Sep-2018 04:05:01 UTC] PHP Fatal error: Unknown: Cannot use output buffering in output buffering display handlers in Unknown on line 0


Note: Current database size is 13MB.

Other Conditions:
GZip save to server - not affected as the file is compressed to 1.07 MB
GZip save to file - not affected as the file is compressed to 1.07 MB

No Compression (Pure SQL)*** - using download or save to server

  • ***full screen error
  • /logs myDEBUG-adm-x.log error posted
  • **On return to the database backup manager home the raw .sql file has been saved to the server

**This behaviour needs some attention please.

Twitch.
https://www.twitchtoo.com Do you work for free? Please donate.
June 7.2026 - NOW AVAILABLE - Twitch Base8 - Obsidian

23 Sep 2018, 11:24 AM
#170
josh4u avatar

josh4u

New Zenner

Join Date:
Jan 2009
Posts:
14
Plugin Contributions:
0

Re: Backup MySQL Database

Hi Dr

Installed ok as per the instructions - goto the admin / database backup page and get this error:

ERROR: Your server's "exec()" command has been disabled. This script cannot run...

I can certainly do a manual mysql database backup by going to the cpanel on my hosting but through the admin page would obviously be a lot quicker:)

Any ideas?

Zen Cart 1.5.5f
PHP Version 7.2.10
Database: MySQL 10.0.36-MariaDB-cll-lve****

23 Sep 2018, 9:34 PM
#172
lankeeyankee avatar

lankeeyankee

Totally Zenned

Join Date:
Jan 2007
Posts:
1,514
Plugin Contributions:
1

Re: Backup MySQL Database

torvista:

Even quicker to automate it:
https://github.com/torvista/zen-cart_backup_MySQL_auto
Been using this for a while now, back up my site daily on a schedule, works flawlessly!


Zen Cart and it's community are the best!!

29 Oct 2018, 12:51 AM
#173
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,733
Plugin Contributions:
56

Re: Backup MySQL Database

Re: Backup MySQL Database Result code: 2 mysqldump Error 1045

DrByte:

Could be that your database password (in DB_PASSWORD) contains a special character that's not translating well when the backup drops out to the command-line and passes the password parameter to do the database export. Anything in there like a $ or # or back-tick or quote/apostrophe or * or & might be problematic, depending on your server operating system.

This issue has been fixed in the latest version of Backup MySQL Database.

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.

10 Nov 2018, 6:31 AM
#174
twitchtoo avatar

twitchtoo

Totally Zenned

Join Date:
Apr 2007
Location:
Ontario, Canada
Posts:
1,733
Plugin Contributions:
14

Re: Backup MySQL Database

Zen Cart 1.55e, newest version available v5d of the plugin fails backup. It goes through the motions with any selected option or combination and a 58 byte properly named and saved file is created or downloaded depending on the selections. The files are all empty.

On page reload the 1045 error posts in the admin header.

Works less now on 1.55e than it did before the update also my previous posts #169 #168 have not been corrected.

Poses the question what does this actually work on and has it been properly tested?

Twitch.
https://www.twitchtoo.com Do you work for free? Please donate.
June 7.2026 - NOW AVAILABLE - Twitch Base8 - Obsidian

10 Nov 2018, 9:37 AM
#175
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,876
Plugin Contributions:
7

Re: Backup MySQL Database

has it been properly tested?
Couldn't say, I did a lot of changes to that a long time ago. As usual I got carried away and made so many changes I never got round to uploading it.
Works for me, on my Github. Comments welcome.

Steve
github.com/torvista: BackupMySQL, Structured Data, Multiple Copy-Move-Delete, Google reCaptcha, Image Checker, Spanish Language Pack and more...

10 Nov 2018, 11:48 AM
#176
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,733
Plugin Contributions:
56

Re: Backup MySQL Database

@twitchtoo Can you post some information on your environment? (OS, PHP version, MySQL version, etc.) I will check.
Are you saying 1.5c did work and 1.5d does not work?

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.

10 Nov 2018, 6:05 PM
#177
twitchtoo avatar

twitchtoo

Totally Zenned

Join Date:
Apr 2007
Location:
Ontario, Canada
Posts:
1,733
Plugin Contributions:
14

Re: Backup MySQL Database

swguy:

@twitchtoo Can you post some information on your environment? (OS, PHP version, MySQL version, etc.) I will check.
Are you saying 1.5c did work and 1.5d does not work?

Client one:
Zen Cart 1.55e
Linux 2.6
Php 5.6
MySQL 5.5
Backup MySQL Database version 1.5c - works in one button position only - referred to in previous post #168-169

Client two:
Zen Cart 1.55f
Linux 2.6
Php 7.1
MySQL 5.6
Backup MySQL Database version 1.5c - works in one button position only - referred to in previous post #168-169

Client one and two update to Backup MySQL Database version 1.5d

  • posts only 58 byte file backups

Twitch.
https://www.twitchtoo.com Do you work for free? Please donate.
June 7.2026 - NOW AVAILABLE - Twitch Base8 - Obsidian

11 Nov 2018, 12:41 PM
#178
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,733
Plugin Contributions:
56

Re: Backup MySQL Database

Then I guess I'm stumped. You can see that the differences between 5c (left) and 5d (right) are small.

125c125
<         $dump_params .= ' "--password=' . DB_SERVER_PASSWORD . '"';
---
>         $dump_params .= ' "--password=' . escapeshellcmd(DB_SERVER_PASSWORD) . '"';
258c258
<         $load_params .= ((DB_SERVER_PASSWORD =='') ? '' : ' "--password=' . DB_SERVER_PASSWORD . '"');
---
>         $load_params .= ((DB_SERVER_PASSWORD =='') ? '' : ' "--password=' . escapeshellcmd(DB_SERVER_PASSWORD) . '"');

Can you do some testing with escapeshellcmd on your system and check the results? This works fine for me in similar environments.

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.

11 Nov 2018, 10:06 PM
#179
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,733
Plugin Contributions:
56

Re: Backup MySQL Database

Maybe try changing it to escapeshellarg() but remove the single quotes around the argument.

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.

11 Dec 2018, 8:05 PM
#180
Join Date:
Aug 2010
Location:
US
Posts:
18
Plugin Contributions:
0

Re: Backup MySQL Database

Has anyone had any luck using this with the new release, 1.5.6? Just got it installed but it is not showing up under the Tools drop down.

T. Patterson
T
he Golden Kernal
Zen-Cart Version 2.2.2