Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] Website Backup - Create zipped copy of all site files


spooks

Recommended Posts

FTP / Website Backup Comparison

 

Someone commented that it was better to use FTP rather than an add-on for a site backup as people already have FTP so don't need to install anything extra, so this morning I picked a random site and tried both methods, for fairness I had no folders in the excluded list for the test.

 

FTP: It started fine but after 5 minutes the connection reset but download continued, but at 6 minutes 45 after another reset, the process baulked and stopped so not a backup you could rely on as its definitely incomplete. This is fairly common scenario I find when trying to FTP large numbers of files, you need to do it in batches to be sure. :'(

 

Website Backup: (File Mode) The process took 52 seconds including the download, all files were present in the archive. :thumbsup:

 

I suspect most could install this quicker than they could use FTP to backup just once. :D

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 Sam

 

I'm thinking of adding this contribution and just wondered if I need to do anything with the menu.js files which is in the resources folder.

 

Its not mentioned in the installation procedure, so I presume not but have lost a bit of my confidence in upgrading the site, so just thought I'd ask first

 

ken

Os-commerce v2.3.3

Security Pro v11

Site Monitor

IP Trap

htaccess Protection

Bad Behaviour Block

Year Make Model

Document Manager

X Sell

Star Product

Modular Front Page

Modular Header Tags

Link to comment
Share on other sites

  • 3 weeks later...

@@modem2.0

 

 

 

 

 

backup_website.php line 87, replace:

 

elseif (@@IS_dir($file)) if ($zip->addEmptyDir($file) === false) $wok = false;

 

with:

 

elseif (@@IS_dir($file)) if ($zip->addEmptyDir($name) === false) $wok = false;

 

 

Your just changing $file to $name in the code.

 

 

 

 

I still get files with 0 bytes named after folders in memory mode.

File mode works fine.

 

Tim

Link to comment
Share on other sites

Hi Sam,

 

Getting about 200+ these errors:

 

Warning: strpos() [function.strpos]: Empty delimiter in /path_to_admin/includes/functions/backup_site_functions.php on line 28

 

before your report:

Website size: 193.3 MB Estimated compressed file size: 131.44 MB Containing 291 folders with 12450 Files.

 

Thanx.

 

Martin

Edited by Jan Zonjee
Link to comment
Share on other sites

Hi Sam,

 

Getting about 200+ these errors:

 

Warning: strpos() [function.strpo: Empty delimiter in /path_to_admin/includes/functions/backup_site_functions.php on line 28

 

before your report:

Website size: 193.3 MB Estimated compressed file size: 131.44 MB Containing 291 folders with 12450 Files.

 

Thanx.

 

Martin

 

I just added @ in

 

foreach ($exclude as $remove) if (@strpos($dir_name.'/'.$file.'/', $remove) === 0 ) continue 2;

 

which stopped the error. Donlt know if I merely cut the oil pressure light, leaving the unmderlying problem.

 

Thanx.

 

Martin

Edited by Jan Zonjee
Link to comment
Share on other sites

  • 3 months later...

Just tried to install this but received an error:

 

Parse error: syntax error, unexpected ')', expecting '(' in /var/www/vhosts/mysite.co.uk/httpdocs/admin/backup_website.php on line 67

 

 

The code on that line is:

 

 

$zip->open(DIR_FS_BACKUP . $filename . $filedate, ZipArchive::CREATE);

Link to comment
Share on other sites

funny, I just spent the evening creating a backup script in php to do just this, and then I see this exists ...

 

but I do get timeout on the full site and decided to create a separate zip for each subdirectory

how does this contribution handle big sites that timeout under php (setting is already at 300 seconds) ?

KEEP CALM AND CARRY ON

I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support).

So if you are still here ? What are you waiting for ?!

 

Find the most frequent unique errors to fix:

grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt

Link to comment
Share on other sites

  • 1 year later...

I have installed in oscommerce 2.3.3.4 and when I want to back up, I get the following:

 

1146 - Table 'magiasdelsur2.TABLE_ORDERS_PRODUCTS' doesn't exist

 

select products_id, products_quantity, products_stock_attributes from TABLE_ORDERS_PRODUCTS where orders_id = '0'

 

[TEP STOP]

 

and I can't continue.

 

How can I sove this issue?

Link to comment
Share on other sites

  • 4 years later...

@spooks

Hi, thank you for the addon.

I had installed this addon on 2.3.1 and now upgraded to 234.1 Edge, try to install this again to match the old version.

at the /admin/backup_website.php

tep_draw_form('save_files', FILENAME_STORE_BACKUP, 'action=savenow',


have change FILENAME_STORE_BACKUP to 'store_backup.php' for the button action, but there is no such file with the attached, did i misunderstood and make wrong somewhere?

 

Thank you!  Lyn

Link to comment
Share on other sites

  • 4 weeks later...

Use 'backup_website.php' or basename($PHP_SELF)

Edited by spooks

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

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...