Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Backup All Store Files In Zip Format


spooks

Recommended Posts

Hi,

 

I must admit I hadn't tested in that mode, but now I have & can confirm that this is indeed a issue, blush.gif When I've time I will see if I can find a solution, in the meantime you could simply turn off your ssl for admin do the backup, then revert, its a lot faster than downloading it all by ftp still. wink.gif

 

 

No worries spooks - I'll make do and mend for now :thumbsup: - I'll keep an eye out for a fix though if you come up with one.

 

Thanks for the help.

Link to comment
Share on other sites

  • 1 month later...

Sam,

 

I tried to modify line 59 of backup_store_files.php to include more folders that are bulky for me, but I am not sure I did this correct. The mod took the file size from 96MB to 8.6MB, which should now allow this to work, but I am still getting errors. My entire catalog folder on my local drive is 24MB, with the images folder minus pub folder and minus the download folder, and yet I am now getting this error: Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 8650752 bytes) in /home/*****/*******/catalog/admin/backup_store_files.php on line 62. If I try to increase the memory size, on line 19, to my host limit of 64MB, I get error: Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 14060980 bytes) in /home/*****/*******/catalog/admin/includes/classes/zip.class.php on line 113. I am not sure why the two bytes tried to allocate are different.

 

 

Line 59 Mod:

if (strpos($arquivo,DIR_FS_BACKUP) === 0 || strpos($arquivo,DIR_FS_CACHE) === 0 || strpos($arquivo,DIR_FS_CATALOG . DIR_WS_IMAGES) === 0 || strpos($arquivo,DIR_FS_CATALOG . DIR_WS_PUB) === 0 || strpos($arquivo,DIR_FS_CATALOG . DIR_WS_DOWNLOAD) === 0)continue;

 

Any ideas or anymore info needed? Are there some settings I need to make within Oscommerce that I am missing? Thanks much.

 

Thanks, that would depend on the contents of DIR_FS_CACHE, although the default is only the name of the cache folder, this often causes problems, ideally DIR_FS_CACHE should contain the full path to the folder, so in any update, my preferance in this case would be to simply advise of the prefered contents of DIR_FS_CACHE.

Link to comment
Share on other sites

 

 

As I think I explained here already, the current version needs to hold 2 copies of the site in memory, so will need a lot more space than the site size.

 

See what else you can exlude, perhaps you have language files you don't use?

 

My purpose for the release was to remove a security loophole in the original, I've not had time to improve the code as well.

 

 

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Link to comment
Share on other sites

  • 3 weeks later...

Sam, thank you for updating this contribution. I was having similar problem as mentioned earlier, after hitting the button, I was receiving 500 error in IE and in Firefox "can't find the file at http://www.mystore.com/admin/backup_store_files.php?action=savenow."

I've tried to remove the .htaccess from admin but the result was the same. I kept trying and after removing this line from user.ini

display_errors = 0

it started working, HOWEVER, the zip file is empty and after trying to open it, I'm receiving: Error in packed file c:\my_store_backup_date.zip

Any ideas please? Running PHP 5.3.1 if that helps.

Absinthe Original Liquor Store

Link to comment
Share on other sites

Sam, thank you for updating this contribution. I was having similar problem as mentioned earlier, after hitting the button, I was receiving 500 error in IE and in Firefox "can't find the file at http://www.mystore.com/admin/backup_store_files.php?action=savenow."

I've tried to remove the .htaccess from admin but the result was the same. I kept trying and after removing this line from user.ini

display_errors = 0

it started working, HOWEVER, the zip file is empty and after trying to open it, I'm receiving: Error in packed file c:\my_store_backup_date.zip

Any ideas please? Running PHP 5.3.1 if that helps.

 

 

There are a number of issues with the routine, its very rough & needs a rewrite, most is as the original, I just updated to remove the security hole it opened.

 

When I've time I'll get to it, but its not a priority, sorry. wink.gif

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Link to comment
Share on other sites

  • 3 months later...

Hi Spooks,

 

Thanks very much for the contribution. I just have one slight problem. Whenever I click on the save button, it directs me to a page with a bunch of odd characters with no zip download. Here's what it shows:

 

 

Warning: fopen(/home/content/f/u/r/XXX/html/stats/.statspwd) [function.fopen]: failed to open stream: Permission denied in /home/content/f/u/r/XXX/html/XXX/backup_store_files.php on line 61

 

Warning: fread(): supplied argument is not a valid stream resource in /home/content/f/u/r/XXX/html/XXX/backup_store_files.php on line 62

 

Warning: Cannot modify header information - headers already sent by (output started at /home/content/f/u/r/XXX/html/XXX/backup_store_files.php:61) in /home/content/f/u/r/XXX/html/XXX/backup_store_files.php on line 73

 

Warning: Cannot modify header information - headers already sent by (output started at /home/content/f/u/r/XXX/html/XXX/backup_store_files.php:61) in /home/content/f/u/r/XXX/html/XXX/backup_store_files.php on line 74

 

Warning: Cannot modify header information - headers already sent by (output started at /home/content/f/u/r/XXX/html/XXX/backup_store_files.php:61) in /home/content/f/u/r/XXX/html/XXX/backup_store_files.php on line 75

PKsk<”Ø[hv5me/content/f/u/r/XXX/html/_notes/speed up.txtŒ1ƒ@ û¼bËPð)E$ºtÎÙp–ÈùbBù=G3ÅjvFì!H”r§•æ¶ÝFPúíêÖDMÙ¢iY¡Äìûâ"8´eLÆ}ýcžŸC¿_Ééýxõâ·^®ZÁbŽC>•V‰PKrk<íÌ<ã6me/content/f/u/r/XXX/html/_notes/freelance.txt]Árà Dïþ ]zKâôÚ/éUÆ"f‚•äqò÷tšq{–·»Ò Ñ ÆJ`©,h‹Iš6K\t Tã–óöd o“ÞS¹-šbq#‰$í½}vUþÚ çW¤‘$kG%‚Û%)¼_¯o·€ù@ääæ {0=0„ËVœ©ý" Ä”é—tÛ™ õN©À'Ìø<™šS%ñô¬×•$Ð êRO°>õ«•¨}6œr¯º³Üîczý¿µ‰" ƒƒ?ý ¢ªS³Ž>ï€}­-çÕƒÑWªÃ°˜ÕqÜ÷ý¢ARµŒ%ÐÅK¥F!ê¢4u<Êô‚ÆoPKskgëò8¯«Ó†ø"Ðxë ðùÝ…!¾<ñå) ö!Ÿs¶¡º© Ë–âs˜Ïû¯ñEàÆ©½Àý€ÿ||Ö ž?}[ˆË3s&¼MˆÏéàJû]!>´ÑsòY¸g8˜SRâCÌgp böÆòû|žºÈŸçƒ A>×Í^°âž/C|¨ƒyy`ïsËC|“óκŸ£Örì³`?¨‡‰€—h·*dü–ýz˜I–Ëãz˜²£±ë› ß&–í"oºió¡íø<ÛEý¾÷^ÜïB1ö,çÿE‹^8øɉ}¢O¾ÿè‡Á~èîC÷c°ºûþ¤ËQà¨aÊ~œ.ª¬ÇÀ…ÿ“”H¿yûz¼š¾4CY÷̵(xjC‰›‘uoÁ¯“Òè)`+Þ© gBgM .GM¢t»>®ïÂ]˜DÕS6Þ´ìF´ê ¤{‚„oÞê!´¤ú³Û„9&ï-:W!N‚î~kêÀë¸×{<ÐÝïõðzáÓÍ2¯w³½ÞÙX½^8âöP«û`÷zç nÀÕý%.Åõ¥j' ÄÂ)T2œB¥€xŽA Ùfþ¬Æ‡c=OýâΨa—ŸàÝäùæ”W²xþo“a?+¥ã‘ß½Ò©Ý^ïdH.á¬WvÔéüâÌ]ÎgÎz‰É %::ßûÓlûGÞM›P* }1ÿ7¯w“ÆÄ á‹ù¿ÀÂQe‹OÞ/jΨWfJvRßÙ9 µ¶ ýÛtöÀ¾IÙ)Y1É=Óå#xg‹kèLyzÏ䘬”,IT|²fÇÍuS·,Hï–%@ Šˆ\Â&¦¤ÚZ!Y ë,ˆ!^J•EÅĸgDˆ‰³2Ø‘‰ÄbëÌÓ<€XSåµB\Ê÷i§pü ýÚ 8 dBçö;œbÔ»aúÙ'€vo0œ 2¡åôôc脽º…µÖÞÿ•öþPK}k<òz`ÐÍ®u=me/content/f/u/r/XXX/html/_work files/productinfo.psdì= @Gד„ûò¾¯x_ ÷! " Ê¡*^4$bB‚IÛbýZQ[KmUÔªTÛµ*â…b•jm±^(xë…Õjð€$û¿™$ܶگýûµÝÙììì̼7oÞ¼yófwfã9blb ½c!ÄP#Äœ„,p;ÉÏž#BÃMú“›Ö¨‰#iýpÈ_2ÌV /*ÙñÂD‘Ô·ÏÃýÅ}Ø"oŸ‰náœð”@a’hÔ¹0jND4Ž˜ï%èãïg5l–÷¬ä”d¡’Çž•,‘*¼gùöá dñBoãh§>l’E)öí€Ø“ÂDzer!ÛÕÑÙÑÙÏqwa»¹8º¸9»;»Ú³9O'Ž‡“ ÇëéÍuöæz² ®ŸøÃä‚ïñ#ƒ ÂoŸ$¥2ÅÛÉ)==Ý1ÝÅQ&Otâzyy9qœœ ‡ƒb¶TÉ›å UôÕ#1â)Tð墥H&eã{^¼,UéÛ§»3Ô,9¥® ©Â‘ÔÒ‘/KvšÅKqâ:rœê0cäÛ;P.ä)eòh™L⧯ûØ$™R¦H’¥°£\ÙER,]1Ì©iæ–ðGÂéÜñrà:;8s¢9\oW/ogŽÇÍ›Ãi€DŸ³ Žph OÉkŒ…Íáx»p½Ýbi”·)™@”0û•°Ôç4rÜ© ËoSøu-‘’*—ð„a²PªT@kp·†€ï “'ó”~¼”‰ˆÏÃ¥8¥I†fL1¶Ë0§ú¬4ÕÀ”ðð_¡äd§– Ê 4å¯C*¢g§Æ ²T9_”|èÛT ÃýC¥ %OʆŽôƒG‘Hàíæêìâ8ÒÅ%häÈ .×+(ØÙ3À9ÈÅyDP€K`iÍÆ ÍÐŽ”ñS1ë h-÷ÕÐ6m†6R.UÄ“üè[@Ѭ˜Q"ô¼Ù~8OZ7J8³q¬1A""­Â“+„˜ó¾}Œ¬ïÓ Ãôæñ‰üðI/ sjûr0Q ö›ÕoúrüéIBé¯i–¹^ŽD!KP¦óä€Dàò¯«»–šqÙIÏæ?ý ^ÚÉ|ç?“ù.Àso÷¯d~=b~Oš(ø9«öúM ÷»Û«ùÐ÷·n/}lc­gÔ¤M´

Edited by SierraTango
Link to comment
Share on other sites

  • 1 month later...

Hi Spooks,

 

Thanks very much for the contribution. I just have one slight problem. Whenever I click on the save button, it directs me to a page with a bunch of odd characters with no zip download. Here's what it shows:

 

 

Warning: fopen(/home/content/f/u/r/XXX/html/stats/.statspwd) [function.fopen]: failed to open stream: Permission denied in /home/content/f/u/r/XXX/html/XXX/backup_store_files.php on line 61

 

 

I had the same problem with GoDaddy. You just need to exclude the stats folder. In backup_store_files.php change:

 

if (strpos($arquivo,DIR_FS_BACKUP) === 0 || strpos($arquivo,DIR_FS_CACHE) === 0) continue;

 

to:

 

if (strpos($arquivo,DIR_FS_BACKUP) === 0 || strpos($arquivo,DIR_FS_CACHE) === 0 || strpos($arquivo,DIR_FS_CATALOG . "stats") === 0) continue;

 

Edit: Forgot to mention, this is assuming your catalog is in the root dir along the GD's stats folder.

Edited by oscgreyfell
Link to comment
Share on other sites

  • 3 weeks later...

It looks like sierra tango has a hacker in his/her mist from the code posted and could benefit from this forum :thumbsup:

Always backup your files! You will be glad you did

My add-ons :

SSPP Seperate Shipping Per Product v2.5| Support
Gift vouchers for SPPC 4.22 v2.1 | Support |
Catalog Infobox v1.0 | Sorry no support for Catalog Infobox |
HTML Mail v2.0 | Support |




Upcoming Add ons:

Addon Manager |
Separate Pricing Per Product Qty |
Coupon Populate |
EZ-PDF Catalog

Link to comment
Share on other sites

Thank you very much greyfell, that solved my problem. And thank you rpetet for your suggestion. I have already implemented most of those security features. I think those strange characters were from the backup script trying to read some PSD files or something.

Link to comment
Share on other sites

Hey there this seems like a really good add-on - just having a few problems getting it going..

 

First of all I got the fatal error mentioned on page one - with the memory exhausted. I thought this was odd as I didn't particularly think I had that big a store section - but obviously I did!

 

I then changed the backup_store_files.php as recommended to exclude the image folder - and indeed that worked in that I did not get taken to the Fatal Error page.

 

Howevr, a file download box opened and then before any progress was made an error box popped up saying:

 

"Internet Explorer cannot download backup_store_files.php from securexx.inmotionhosting.com. It is unable to open this Internet site - the required site is either unavailable or cannot be found. Please try again later"

 

I have tried a few times and keep getting this.

 

Hopefully it's something small that I've missed!

 

 

-To clarify, my site has a shared ssl certificate, and the admin area has ssl turned on - and otherwise seems to be working fine. Just wondered if that may be the problem though?

 

 

The osc db backup also had that exact problem and I used the fix found here http://www.oscommerce.com/forums/topic/31123-downloads-dont-work-when-using-https-and-ie/ to get this contribution to work in IE8 with admin SSL.

 

backup_store_files.php

Find:

 

header('Content-Type: application/zip');

 

Add above:

 

header("Pragma: ");

Link to comment
Share on other sites

  • 2 months later...
  • 3 weeks later...

Hi,

 

Never had any problem using this contribution. But the other day extracting the zip file resulted in a corrupted file.

(Not sure how this happend?!)

What I did to resolve this problem was:

 

Change in admin/backup_store_files.php

$filename = substr(STORE_NAME,0,12). '_SiteBackup-'. $current_date . '.zip;

to:

$filename = substr(STORE_NAME,0,12). '_SiteBackup-'. $current_date . '.rar';

 

This results in a file with no extention. Just add .zip or .rar to the end of the file.

Link to comment
Share on other sites

  • 2 years later...

I try to install this add on last version,but at step 6 I was blocked because I didn't find

$contents[] = array('text' => '<a href="' . tep_href_link(FILENAME_BACKUP) . '" class="menuBoxContentLink">' . BOX_TOOLS_BACKUP . '</a><br>' .My tools.php looks like this:

 

<?php

/*

$Id$

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2010 osCommerce

 

Released under the GNU General Public License

*/

 

$cl_box_groups[] = array(

'heading' => BOX_HEADING_TOOLS,

'apps' => array(

array(

'code' => FILENAME_ACTION_RECORDER,

'title' => BOX_TOOLS_ACTION_RECORDER,

'link' => tep_href_link(FILENAME_ACTION_RECORDER)

),

array(

'code' => FILENAME_BACKUP,

'title' => BOX_TOOLS_BACKUP,

'link' => tep_href_link(FILENAME_BACKUP)

 

),

array(

'code' => FILENAME_BANNER_MANAGER,

'title' => BOX_TOOLS_BANNER_MANAGER,

'link' => tep_href_link(FILENAME_BANNER_MANAGER)

),

array(

'code' => FILENAME_CACHE,

'title' => BOX_TOOLS_CACHE,

'link' => tep_href_link(FILENAME_CACHE)

),

array(

'code' => FILENAME_DEFINE_LANGUAGE,

'title' => BOX_TOOLS_DEFINE_LANGUAGE,

'link' => tep_href_link(FILENAME_DEFINE_LANGUAGE)

),

array(

'code' => FILENAME_MAIL,

'title' => BOX_TOOLS_MAIL,

'link' => tep_href_link(FILENAME_MAIL)

),

array(

'code' => FILENAME_NEWSLETTERS,

'title' => BOX_TOOLS_NEWSLETTER_MANAGER,

'link' => tep_href_link(FILENAME_NEWSLETTERS)

),

array(

'code' => FILENAME_SEC_DIR_PERMISSIONS,

'title' => BOX_TOOLS_SEC_DIR_PERMISSIONS,

'link' => tep_href_link(FILENAME_SEC_DIR_PERMISSIONS)

),

array(

'code' => FILENAME_SERVER_INFO,

'title' => BOX_TOOLS_SERVER_INFO,

'link' => tep_href_link(FILENAME_SERVER_INFO)

),

array(

'code' => FILENAME_VERSION_CHECK,

'title' => BOX_TOOLS_VERSION_CHECK,

'link' => tep_href_link(FILENAME_VERSION_CHECK)

),

array(

'code' => FILENAME_WHOS_ONLINE,

'title' => BOX_TOOLS_WHOS_ONLINE,

'link' => tep_href_link(FILENAME_WHOS_ONLINE)

)

)

);

?>

So,how to proceed?

 

Also I installed Autobackup V4.3 but I cannot find there how to restore the backup saved.Using phpadmin ?

Thank you.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...