Forums / General Questions / backup MySql - works fine but how to download via a https connection?

backup MySql - works fine but how to download via a https connection?

Locked

Views: 2,052

Results 1 to 3 of 3
This thread is locked. New replies are disabled.
11 Dec 2007, 10:00 AM
#1
loop4ever avatar

loop4ever

New Zenner

Join Date:
Apr 2006
Posts:
18
Plugin Contributions:
0

backup MySql - works fine but how to download via a https connection?

I installed the BACKUP MYSQL ADMIN PLUGIN 1.3. It created a backup file for me in no time. Thanks a lot! But I don't quite understand how to download the backup files via a secure SSL / HTTPS connection.

I have ENABLE_SSL_ADMIN set to true in my configure.php. If I click the little download button in the backup page, the file would be downloaded via http not https.

I checked the source code and found the following code was commented out in admin/backup_mysql.php. (The red portion is what I added. The blue portion is what I deleted.)

 [B]<!--[/B]                 <td class="dataTableContent" onclick="document.location.href='<?php echo zen_href_link(FILENAME_BACKUP_MYSQL, $onclick_link); ?>'"><?php echo '<a href="' . zen_href_link(FILENAME_BACKUP_MYSQL, 'action=download&file=' . $entry[B], 'SSL'[/B]) . '">' . zen_image(DIR_WS_ICONS . 'file_download.gif', ICON_FILE_DOWNLOAD) . '</a> ' . $entry; ?></td> [B]-->[/B]
```Instead, the following code is used in the current version.

            <td class="dataTableContent" onClick="document.location.href='<?php echo zen_href_link(FILENAME_BACKUP_MYSQL, $onclick_link); ?>'"><?php echo '<a href="' . ((ENABLE_SSL_ADMIN == 'true') ? DIR_WS_HTTPS_ADMIN : DIR_WS_ADMIN) . 'backups/' . $entry . '">' . zen_image(DIR_WS_ICONS . 'file_download.gif', ICON_FILE_DOWNLOAD) . '</a> ' . $entry; ?></td>

I then tried to approach in different way. I comment out the code in the quote by using a php comment, <?php /* */ ?>, instead of the html comment, <!-- -->. It worked. I can still login too. Odd! I couldn't reproduce the problem.

Am I doing the right thing to use https connection for downloading the backup files?

I just installed 7-zip on my local PC. It is under c:/program files/7-zip. I modified both LOCAL_EXE_GUNZIP and LOCAL_EXE_UNZIP in admin/includes/init_includes/init_gzip.php to 'c:/Program Files/7-Zip/7z e -y'. I tested the command in cmd window. But the .gz file never got extracted from backup page. So, I couldn't restore the .gz file from the backup page. Restoring db with a .sql file is fine. Any idea?

**loop4ever

360square.com**
Display & Sell Your Artwork for Free
Buy Directly from Artists

11 Dec 2007, 3:10 PM
#2
yellow1912 avatar

yellow1912

Totally Zenned

Join Date:
Oct 2006
Posts:
5,422
Plugin Contributions:
0

Re: backup MySql - works fine but how to download via a https connection?

In your admin/includes/configure.php, check if you set the http link correct.

I no longer provide installation support on forum for all my modules. However, if there are real bugs with the modules please feel free to contact me

11 Dec 2007, 8:11 PM
#3
loop4ever avatar

loop4ever

New Zenner

Join Date:
Apr 2006
Posts:
18
Plugin Contributions:
0

Re: backup MySql - works fine but how to download via a https connection?

Yellow,

The setting in my admin/includes/configure.php is fine. If I used php to comment out the code in my second quote and uncommented the code in my first quote, the download connection would be https.

I have problem with restoring the backup file on my local PC. My previous post stated that I cannot gunzip my .gz file but can restore an .sql file was incorrect. In fact, I cannot gunzip my .gz file nor restore an .sql file. I actually did the restore manually.

I turned on the debug mode in backup_mysql.php and here is the messages shown when I tried to restore a .sql file. The .sql file was gunzipped using 7z manually.

COMMAND FILES SELECTED:            mysqlexe="c:/wamp/bin/mysql/mysql5.0.45/bin/mysql.exe"
mysqldumpexe="c:/wamp/bin/mysql/mysql5.0.45/bin/mysqldump.exe"

COMMAND:
"c:/wamp/bin/mysql/mysql5.0.45/bin/mysql.exe" "--database=zc137" "--host=localhost" "--user=xxxxx" "--password=yyyyy" zc137 < "c:/wamp/www/store/admin/backups/db_zc2-20071210160351.sql" 2>&1
valueA: operable program or batch file.           
valueB:           
Result code: 1           
Failure: The database may NOT have been restored properly. Please check it carefully.
```I copied the command and ran it in cmd window. It worked fine.

I bet that the problem is the permission to run exec() under my Window XP. DrByte mentioned to alter the security permissions on cmd.exe and grant the Internet Guest Account read/execute as "Special Access" permissions. Where can I alter this permission?  I have WampServer 2 installed on my PC.

**loop4ever

360square.com**
Display & Sell Your Artwork for Free
Buy Directly from Artists