Forums / Addon Admin Tools / Backup MySQL Database

Backup MySQL Database

Views: 87,443

Results 301 to 320 of 327
1 Feb 2025, 5:37 PM
#301
nwce avatar

nwce

Zen Follower

Join Date:
Oct 2009
Posts:
444
Plugin Contributions:
0

Backup MySQL Database

My current live site database that I have imported into my development cart is:

MariaDB dump 10.19 Distrib 10.6.19-MariaDB, for Linux (x86_64)

MySQL version in my WAMP is 8.3

Thanks again for your continued help.

1 Feb 2025, 10:18 PM
#303
nwce avatar

nwce

Zen Follower

Join Date:
Oct 2009
Posts:
444
Plugin Contributions:
0

Re: Backup MySQL Database

Thanks Steve....I will give this a go and let you know!

3 Feb 2025, 3:12 PM
#304
nwce avatar

nwce

Zen Follower

Join Date:
Oct 2009
Posts:
444
Plugin Contributions:
0

Re: Backup MySQL Database

Hi Steve,

I tried the newest branch this morning. Before installing the newest version, I Uninstalled the previous version using both the Uninstall and Clean Up functions through the Admin->Modules->Plugin Mgr and verified this by looking in the zc_plugin folder and saw the empty BackupMySQL folder.

I then uploaded this newest branch version to the zc_plugins folder, and installed it through the Admin->Modules->Plugin Mgr

I backed up my current live site, placed this gzip file in my development site Admin/backups folder and then went to the plugin in Admin.

I selected this database file, used the Restore button and it began whirring....but did not insert the new database. I received this error at the top of my Admin panel:
ERROR: FILE NOT FOUND: [C:\Windows\Temp\php7FB4.tmp]

And this error in my Debug logs:

PHP Warning: rename(C:\Windows\Temp\16787D3.tmp,C:\Windows\Temp\php7FB4.tmp): Access is denied (code: 5) in C:\wamp64\www\new2121\zc_plugins\BackupMySQL\v2.0.0\admin\backup_mysql.php on line 666.

Is there an adjustment I need to make??

3 Feb 2025, 3:16 PM
#305
torvista avatar

torvista

Totally Zenned

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

Re: Backup MySQL Database

You don't need to uninstall/install...but you need to get the update I did this morning when I found that issue!

Always worth having a GitHub account if only to "watch" the repositories of all the plugins you have, to get updates hot off the press.
And, see the activity in Zen Cart, most of which does not get a mention in the forum.

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

3 Feb 2025, 3:26 PM
#306
nwce avatar

nwce

Zen Follower

Join Date:
Oct 2009
Posts:
444
Plugin Contributions:
0

Re: Backup MySQL Database

Thanks for the heads up on the newer-newer version!

I just downloaded, installed and ran it. You did it!

I successfully uploaded my current live site database as a gzip file.....perfect!

Thank you for your continued work to make this plugin work.

Much Appreciated!!

3 Feb 2025, 3:44 PM
#307
torvista avatar

torvista

Totally Zenned

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

Re: Backup MySQL Database

About time!

FYI all this out of memory stuff was due to the solution I'd arrived at to deal with this bug:

https://github.com/torvista/Zen_Cart-Backup_MYSQL_Plugin/issues/6

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

3 Feb 2025, 4:23 PM
#308
nwce avatar

nwce

Zen Follower

Join Date:
Oct 2009
Posts:
444
Plugin Contributions:
0

Re: Backup MySQL Database

Ha,ha....not at all!

It takes time to work through the variables. Thanks for sticking with it!

3 Feb 2025, 10:55 PM
#309
nwce avatar

nwce

Zen Follower

Join Date:
Oct 2009
Posts:
444
Plugin Contributions:
0

Re: Backup MySQL Database

I had one more error crop up.....

I have now moved my development site to my server (under a subfolder)...copies the database from my development site (using PhPmyAdmin->Import).

When I log into my Admin the plugin is uninstalled. I then installed it and received the confirmation in the green bar in my Admin panel. When I go to test it, I click on it in Admin->Tools and I get a white screen and here is my Debug Log error:

PHP Fatal error: Uncaught TypeError: trim(): Argument #1 ($string) must be of type string, null given in /home/mysite/public_html/new210/zc_plugins/BackupMySQL/v2.0.0/admin/backup_mysql.php:230
Stack trace:
#0 /home/mysite/public_html/new210/zc_plugins/BackupMySQL/v2.0.0/admin/backup_mysql.php(230): trim()
#1 /home/mysite/public_html/new210/admin/index.php(28): require('...')
#2 {main}
thrown in /home/mysite/public_html/new210/zc_plugins/BackupMySQL/v2.0.0/admin/backup_mysql.php on line 230.

Can this be as my test site in WAMP has PHP v.8.2.18 and SQL/Maria DB v.11.3.2 and my server subfolder site has PHP v 8.2.27 and SQL/MariaDB v. 10.6.19

Sorry about this go around....

I have uninstalled and reinstalled 3 times, just to insure its not user error. I have taken the folder from my test site (which we got working this morning) to place into zc_plugins to insure I have the newest, newest version and not a previous one. (Trying to rule out user error).

The one weird thing is in my Admin->Modules->Plugin Mgr in my test site, it shows this plug in file space as 78.56kB and on my server subfolder site the file space is 134.56kB. This never seems to change with all of the install and uninstalls that I have done. I have used the Clean Up Tool and Uninstall in Plugin Mgr and insure that it is completely removed from the folder before uploading the fileset once again and installing. This must have something to do with it?!

Any thoughts??

8 Feb 2025, 5:02 PM
#310
nwce avatar

nwce

Zen Follower

Join Date:
Oct 2009
Posts:
444
Plugin Contributions:
0

Re: Backup MySQL Database

Hi Steve,

Been working on getting this plugin working once again....and have inputted a newer version of my live site DB into this test site. I still have the latest version of this plugin installed (from 5 days ago on Github).

Once my DB is in and I've run the zc_installer to update the DB, I have tried..#1 just using the Install button in Admin->Plugin Mgr and #2 tried uninstalling the files via FTP and then reinstalling and then Installing the plugin via Plugin Mgr.

I get the green stmt at the top of my Admin saying it has been installed and good to go.

I then go to Admin->Tools to use/test it and when I click on it, I get an Admin white screen with the following error in my Debug Logs...

PHP Fatal error: Uncaught TypeError: trim(): Argument #1 ($string) must be of type string, null given in /home/mysite/public_html/new210/zc_plugins/BackupMySQL/v2.0.0/admin/backup_mysql.php:230

It also shows the file space in Plugin Mgr as 134.56kB...whereas when I got it running in my test site in my local computer...the file space was only 78.56kB It appears to have fragments of an older version. When in Admin->Plugin Mgr, when I choose Clean Up....the only option is remove this current plugin v2.0.0

Can you point me in the right direction as to where I've gone wrong???

Thanks!

8 Feb 2025, 10:33 PM
#311
torvista avatar

torvista

Totally Zenned

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

Re: Backup MySQL Database

There should not be any "going wrong".

I assume this is now happening on a unix server?

If Line 230 is
$paths_auto = str_replace('mysql', '', trim(shell_exec('which mysql')));

it's not finding the mysql tool.

You can trap the error at least with this.

change it to:

$which_mysql = @shell_exec('which mysql');
if ($which_mysql !== null && $which_mysql !== false) {
$paths_auto = str_replace('mysql', '', trim($which_mysql));
}

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

9 Feb 2025, 12:19 PM
#312
nwce avatar

nwce

Zen Follower

Join Date:
Oct 2009
Posts:
444
Plugin Contributions:
0

Re: Backup MySQL Database

Thanks for your reply Steve and help with this!

My server is a: Linux 4.18.0-553.8.1.el8_10.x86_64

I will try this code edit and post back once I've had the chance to give it go.

Thanks again...
Jeff

9 Feb 2025, 2:15 PM
#313
nwce avatar

nwce

Zen Follower

Join Date:
Oct 2009
Posts:
444
Plugin Contributions:
0

Re: Backup MySQL Database

Success!!

I applied this code change to zc_plugins/BackupMySQL/v2.0.0/admin/backup_mysql.php on line 230 and was successful in backing up my database! I tried the Restore and it worked too!

Thanks again for your continued help with this plugin....it is very much appreciated!

11 Feb 2025, 3:58 PM
#314
jodean avatar

jodean

Totally Zenned

Join Date:
May 2011
Location:
Tennessee
Posts:
511
Plugin Contributions:
0

Re: Backup MySQL Database

Is there a Backup Plugin for Zencart 2.1.0?

11 Feb 2025, 4:02 PM
#315
torvista avatar

torvista

Totally Zenned

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

Re: Backup MySQL Database

The version in my signature is compatible with the current version 2.1.0 and the development version.

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

11 Feb 2025, 5:39 PM
#316
jodean avatar

jodean

Totally Zenned

Join Date:
May 2011
Location:
Tennessee
Posts:
511
Plugin Contributions:
0

Re: Backup MySQL Database

Installed Zen_Cart-Backup_MYSQL_Plugin-main and it installed using your instructions but when I run it I get errors.

Result code: ($dump_results) 1
console $output: [0] => "'unknown' is not recognized as an internal or external command,

console $output: [1] => "operable program or batch file.

Failure: The database has NOT been saved.
2 debug-log files exist, click here to view.
MySQL tools (mysql, mysqldump) not found.

Error Log
[10-Feb-2025 21:25:33 Europe/Berlin] Request URI: /tennesseetraditionalflies.com/fishing/index.php?cmd=reviews&status=1&rID=62&action=delete, IP address: ::1, Language id 1
#0 C:\xampp\htdocs\tennesseetraditionalflies.com\fishing\reviews.php(390): zen_debug_error_handler()
#1 C:\xampp\htdocs\tennesseetraditionalflies.com\fishing\index.php(16): require('C:\xampp\htdocs...')
--> PHP Warning: Undefined variable $rInfo in C:\xampp\htdocs\tennesseetraditionalflies.com\fishing\reviews.php on line 390.

[10-Feb-2025 21:25:33 Europe/Berlin] Request URI: /tennesseetraditionalflies.com/fishing/index.php?cmd=reviews&status=1&rID=62&action=delete, IP address: ::1, Language id 1
#0 C:\xampp\htdocs\tennesseetraditionalflies.com\fishing\reviews.php(390): zen_debug_error_handler()
#1 C:\xampp\htdocs\tennesseetraditionalflies.com\fishing\index.php(16): require('C:\xampp\htdocs...')
--> PHP Warning: Attempt to read property "reviews_id" on null in C:\xampp\htdocs\tennesseetraditionalflies.com\fishing\reviews.php on line 390.

[10-Feb-2025 21:25:33 Europe/Berlin] Request URI: /tennesseetraditionalflies.com/fishing/index.php?cmd=reviews&status=1&rID=62&action=delete, IP address: ::1, Language id 1
#0 C:\xampp\htdocs\tennesseetraditionalflies.com\fishing\reviews.php(392): zen_debug_error_handler()
#1 C:\xampp\htdocs\tennesseetraditionalflies.com\fishing\index.php(16): require('C:\xampp\htdocs...')
--> PHP Warning: Undefined variable $rInfo in C:\xampp\htdocs\tennesseetraditionalflies.com\fishing\reviews.php on line 392.

[10-Feb-2025 21:25:33 Europe/Berlin] Request URI: /tennesseetraditionalflies.com/fishing/index.php?cmd=reviews&status=1&rID=62&action=delete, IP address: ::1, Language id 1
#0 C:\xampp\htdocs\tennesseetraditionalflies.com\fishing\reviews.php(392): zen_debug_error_handler()
#1 C:\xampp\htdocs\tennesseetraditionalflies.com\fishing\index.php(16): require('C:\xampp\htdocs...')
--> PHP Warning: Attempt to read property "products_name" on null in C:\xampp\htdocs\tennesseetraditionalflies.com\fishing\reviews.php on line 392.

[10-Feb-2025 21:25:33 Europe/Berlin] Request URI: /tennesseetraditionalflies.com/fishing/index.php?cmd=reviews&status=1&rID=62&action=delete, IP address: ::1, Language id 1
#0 C:\xampp\htdocs\tennesseetraditionalflies.com\fishing\reviews.php(393): zen_debug_error_handler()
#1 C:\xampp\htdocs\tennesseetraditionalflies.com\fishing\index.php(16): require('C:\xampp\htdocs...')
--> PHP Warning: Undefined variable $rInfo in C:\xampp\htdocs\tennesseetraditionalflies.com\fishing\reviews.php on line 393.

[10-Feb-2025 21:25:33 Europe/Berlin] Request URI: /tennesseetraditionalflies.com/fishing/index.php?cmd=reviews&status=1&rID=62&action=delete, IP address: ::1, Language id 1
#0 C:\xampp\htdocs\tennesseetraditionalflies.com\fishing\reviews.php(393): zen_debug_error_handler()
#1 C:\xampp\htdocs\tennesseetraditionalflies.com\fishing\index.php(16): require('C:\xampp\htdocs...')
--> PHP Warning: Attempt to read property "reviews_id" on null in C:\xampp\htdocs\tennesseetraditionalflies.com\fishing\reviews.php on line 393.

11 Feb 2025, 5:53 PM
#317
torvista avatar

torvista

Totally Zenned

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

Re: Backup MySQL Database

Those error logs don't appear to have anything to do with the backup.

You are on a local server. Windows/Unix? What LAMP environment?

Add &debug=ON to the url and refresh the page, you'll see the list of places where the script is trying (and failing) to find the mysql tools.

You'll need to add the correct location on your server to the list in $pathsearch at line 254 \zc_plugins\BackupMySQL\v2.0.0\admin\backup_mysql.php

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

11 Feb 2025, 6:58 PM
#318
jodean avatar

jodean

Totally Zenned

Join Date:
May 2011
Location:
Tennessee
Posts:
511
Plugin Contributions:
0

Re: Backup MySQL Database

torvista:

Those error logs don't appear to have anything to do with the backup.

You are on a local server. Windows/Unix? What LAMP environment?

Add &debug=ON to the url and refresh the page, you'll see the list of places where the script is trying (and failing) to find the mysql tools.

You'll need to add the correct location on your server to the list in $pathsearch at line 254 \zc_plugins\BackupMySQL\v2.0.0\admin\backup_mysql.php

############################################################

I am running on XAMPP in development and production on SITEGROUND hosting.

11 Feb 2025, 7:32 PM
#319
jodean avatar

jodean

Totally Zenned

Join Date:
May 2011
Location:
Tennessee
Posts:
511
Plugin Contributions:
0

Re: Backup MySQL Database

The path for MYSQL is "C:\xampp\mysql". What would I change in line 254?

11 Feb 2025, 9:10 PM
#320
torvista avatar

torvista

Totally Zenned

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

Re: Backup MySQL Database

Change

$pathsearch = array_merge($possiblePaths, [
$paths_auto,
'/usr/bin/',
'/usr/local/bin/',
'/usr/local/mysql/bin/',
'c:/mysql/bin/',
'd:/mysql/bin/',
'e:/mysql/bin/',
'c:/server/mysql/bin/',
''c:/Program Files/MySQL/MySQL Server 5.0/bin/'',
''d:\Program Files\MySQL\MySQL Server 5.0\bin\''
]);

to

$pathsearch = array_merge($possiblePaths, [
$paths_auto,
'/usr/bin/',
'/usr/local/bin/',
'/usr/local/mysql/bin/',
'c:/mysql/bin/',
'd:/mysql/bin/',
'e:/mysql/bin/',
'c:/server/mysql/bin/',
''c:/Program Files/MySQL/MySQL Server 5.0/bin/'',
''d:\Program Files\MySQL\MySQL Server 5.0\bin\'',
'C:\xampp\mysql'
]);

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