Zen Cart Logo
Forums / All Other Contributions/Addons / I'd like to change Backup MySQL

I'd like to change Backup MySQL

Views: 737

Results 1 to 4 of 4
18 Oct 2017, 10:03 PM
#1
feznizzle avatar

feznizzle

Totally Zenned

Join Date:
Apr 2010
Posts:
900
Plugin Contributions:
0

I'd like to change Backup MySQL

Hi,

I have a fresh install of zc155e and Backup MySQL v1.5c.

I'd like to alter Backup MySQL such that I can name my own files as I'm backing up.

**MY PROPOSAL
**I envision something like this:

Attachment 17369

If the "Name the file" box is left empty, Backup MySQL uses it's normal routine to automatically name the file. If the box is not empty, then auto routine is bypassed for whatever file name is given.

**POSSIBLE PROBLEMS
**#1. What if the file name already exists?
Maybe a quick check should occur, giving the user the option to overwrite or rename.
FAIL PROMPT: This file name already exists. Either rename the new file, or click "overwrite" to delete the existing file and replace it with this backup.

#2. What if the user puts in bad characters?
Users should be allowed only alphanumeric characters, plus hyphen and underscore, no spaces.
FAIL PROMPT: Your file name cannot contain spaces, only alphanumeric characters ( AbC123 ), hyphens ( - ), and underscores ( _ ).

**THOUGHTS?
**How hard would it be to do this? The two checks mentioned above would have to be added, but they seem simple enough. Personally, I don't need those. I'd be happy being careful not to use bad characters, and if I use the same name twice it will only be because I want to overwrite anyhow.

++++
**EXPLANATION
**When I'm doing intensive work on a site, I back up frequently. To keep up with all the backups, I rename each one. Usually I prepend with a two digit number to keep the steps in order, then I add a short note to remind myself what I backed up.

Additionally, when I've made changes to php, I will zip my catalog folder and rename the zip file to the same as whatever my last Backup MySQL file was named. Then if I need to go back, all I have to do is delete the contents of my catalog folder, unzip my files, and restore my db backup.

The problem is that constantly renaming Backup MySQL files becomes a disruption. Typically it's quick, but if I don't happen to have my FTP client up and running, it can take a minute or two to open it up, log in, navigate to the folder, find the file, and rename. And even when that's not the case, it's still an unnecessary extra effort.

Btw, this is not an entirely new desire. I tried to do it a few years ago:
https://www.zen-cart.com/showthread.php?205770-I-would-like-to-change-Backup-mySQL

In that thread, it looks like torvista suggested some code alterations but I only just saw them. The mod has been updated since then, so I'm leery to test that. Really though, I want the ability to completely circumvent the auto naming process and give it my own name.

18 Oct 2017, 10:16 PM
#2
torvista avatar

torvista

Totally Zenned

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

Re: I'd like to change Backup MySQL

I already did all this ages ago, plus other minor changes to the plugin, see my Github.

19 Oct 2017, 1:02 PM
#3
feznizzle avatar

feznizzle

Totally Zenned

Join Date:
Apr 2010
Posts:
900
Plugin Contributions:
0

Re: I'd like to change Backup MySQL

Sweeeeeet!

I checked out your Github, looks like I can add a suffix to the name? That's short of what I want, but sounds like there are some other improvements as well so I'll install it and play around. If you added notes in the code, hopefully I can use them to at least identify target spots for building a version that will allow me to name my own files.

Btw... APSONA! Oh man, I loved that mod. I always thought that the reason Apsona went obsolete is that the mod had to communicate with Apsona's server or something. So when they stopped supporting, the mod couldn't work.

Is Apsona a complete standalone? No communication outside of your own server? I may have to install that one as well.

Thank you!

19 Oct 2017, 1:36 PM
#4
torvista avatar

torvista

Totally Zenned

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

Re: I'd like to change Backup MySQL

Offtopic Apsona
It is not obsolete at all, just unsupported by Apsona. The folks behind Apsona are alive and very well, but busy with projects that make them money.
The code is downloaded from their servers each time you use it and still works fine with the php7 mods I have done to the local code. It IS possible to make it standalone by just making local files from that code and modifying the necessary links to use it locally, it's not encoded.