Forums / All Other Contributions/Addons / BackUp ZC [Support Thread]

BackUp ZC [Support Thread]

Views: 60,130

Results 21 to 40 of 286
14 Oct 2010, 1:41 AM
#21
ts232 avatar

ts232

Zen Follower

Join Date:
May 2006
Posts:
167
Plugin Contributions:
0

BackUp ZC [Support Thread]

Thanks for the clues. Turns out there was something in the zen directory that was overriding the global setting of PHP 5 set in the cpanel. I still don't know what it was, but I put the two lines below in my .htaccess at the zen root and it seems to have fixed things.

AddHandler application/x-httpd-php5 .php5 .php4 .php .php3 .php2 .phtml
AddType application/x-httpd-php5 .php5 .php4 .php .php3 .php2 .phtml

--
Author of Stock vs. Sales Report

15 Oct 2010, 8:01 PM
#22
joyjoy avatar

joyjoy

Totally Zenned

Join Date:
Sep 2010
Posts:
611
Plugin Contributions:
0

Re: BackUp ZC [Support Thread]

Hi, I need help again.

I am able to backup okay and the zip file that shows up in my backups directory seems correct. The right size and everything.

However, when I try to unzip the files I get an error message saying that the file has ended unexpectedly.

What do I need to do to fix this? Thank you!

16 Oct 2010, 12:51 AM
#23
joyjoy avatar

joyjoy

Totally Zenned

Join Date:
Sep 2010
Posts:
611
Plugin Contributions:
0

Re: BackUp ZC [Support Thread]

Nevermind Skip,

Not sure what was going on but I downloaded the newest version and it's working again.

Thanks again, this mod rocks!

18 Oct 2010, 11:55 AM
#24
bruce1952 avatar

bruce1952

Totally Zenned

Join Date:
Aug 2008
Location:
Sydney Australia
Posts:
828
Plugin Contributions:
0

Re: BackUp ZC [Support Thread]

skipwater:

This sounds like the same error that bpryor post had Post 7

The fix he used

So add this directory /home/content/o/u/t/outdoorking/html/stats/error_logs to the excluded list and that should fix it.

Skip

Tried to add the folder but was unable, so contacted Godaddy and they will not add the folder unless I shift from a shared server to either a dedicated one or a virtual dedicated server.

Do you have a work around?

Outdoorking
Live Site https://www.outdoorking.com.au

18 Oct 2010, 3:46 PM
#25
skipwater avatar

skipwater

Totally Zenned

Join Date:
Jun 2008
Location:
Washington, DC
Posts:
775
Plugin Contributions:
1

Re: BackUp ZC [Support Thread]

Bruce1952:

Tried to add the folder but was unable, so contacted Godaddy and they will not add the folder unless I shift from a shared server to either a dedicated one or a virtual dedicated server.

Do you have a work around?

Just checking but is this how you added stats to the exclude files section?
"".DIR_FS_CATALOG."stats"

Skip

• 446F63746F722057686F •

18 Oct 2010, 8:58 PM
#26
bruce1952 avatar

bruce1952

Totally Zenned

Join Date:
Aug 2008
Location:
Sydney Australia
Posts:
828
Plugin Contributions:
0

Re: BackUp ZC [Support Thread]

Skip,

Where do I find that please?

Outdoorking
Live Site https://www.outdoorking.com.au

18 Oct 2010, 9:05 PM
#27
bruce1952 avatar

bruce1952

Totally Zenned

Join Date:
Aug 2008
Location:
Sydney Australia
Posts:
828
Plugin Contributions:
0

Re: BackUp ZC [Support Thread]

Getting this error in the panel as well:

Fatal error: Uncaught exception 'RuntimeException' with message 'SplFileInfo::getSize() [<a href='splfileinfo.getsize'>splfileinfo.getsize</a>]: stat failed for /home/content/o/u/t/outdoorking/html/stats/error_logs' in /home/content/o/u/t/outdoorking/html/admin/backup_zc.php:51 Stack trace: #0 /home/content/o/u/t/outdoorking/html/admin/backup_zc.php(51): SplFileInfo->getSize() #1 /home/content/o/u/t/outdoorking/html/admin/backup_zc.php(405): directorySize('/home/content/o...') #2 {main} thrown in /home/content/o/u/t/outdoorking/html/admin/backup_zc.php on line 51

Outdoorking
Live Site https://www.outdoorking.com.au

18 Oct 2010, 10:11 PM
#28
skipwater avatar

skipwater

Totally Zenned

Join Date:
Jun 2008
Location:
Washington, DC
Posts:
775
Plugin Contributions:
1

Re: BackUp ZC [Support Thread]

Bruce1952:

Skip,

Where do I find that please?

File YOUR_ADMIN/backup_zconfig.php about line 78

  // ***********************************************************************
  // Set default exclude directories
  // ***********************************************************************
  $exclude_files = array("".DIR_FS_CATALOG."cache",
  						 "".DIR_FS_CATALOG."extras",
  						 "".DIR_FS_CATALOG."pub"
  						 );

Change to look like this

  // ***********************************************************************
  // Set default exclude directories
  // ***********************************************************************
  $exclude_files = array("".DIR_FS_CATALOG."cache",
  						 "".DIR_FS_CATALOG."extras",
  						 "".DIR_FS_CATALOG."pub",
                           "".DIR_FS_CATALOG."stats"
  						 );

As for your cpanel error its the same error.

Skip

• 446F63746F722057686F •

19 Oct 2010, 1:06 AM
#29
bruce1952 avatar

bruce1952

Totally Zenned

Join Date:
Aug 2008
Location:
Sydney Australia
Posts:
828
Plugin Contributions:
0

Re: BackUp ZC [Support Thread]

Skip,

Here is the new error message:

Notice: Undefined index: name in /home/content/o/u/t/outdoorking/html/koala/backup_zc.php on line 403

Notice: Use of undefined constant BACKUP_EXCLUDED - assumed 'BACKUP_EXCLUDED' in /home/content/o/u/t/outdoorking/html/admin/backup_zc.php on line 413

Fatal error: Uncaught exception 'RuntimeException' with message 'SplFileInfo::getSize() [<a href='splfileinfo.getsize'>splfileinfo.getsize</a>]: stat failed for /home/content/o/u/t/outdoorking/html/stats/error_logs' in /home/content/o/u/t/outdoorking/html/admin/backup_zc.php:51 Stack trace: #0 /home/content/o/u/t/outdoorking/html/admin/backup_zc.php(51): SplFileInfo->getSize() #1 /home/content/o/u/t/outdoorking/html/admin/backup_zc.php(413): directorySize('/home/content/o...') #2 {main} thrown in /home/content/o/u/t/outdoorking/html/admin/backup_zc.php on line 51

I changed as per your instructions and the above is the error message that I am getting.

Below is what is in the file after the change:

<?php /* *********************************************************************** $Id: backup_zconfig.php, v 1.0.5 2010/24/09 ZenCart 1.3.9f Copyright 2003-2010 Zen Cart Development Team Portions Copyright 2004 osCommerce <http://www.zen-cart.com/license/2_0.txt> GNU Public License V2.0 Written By SkipWater <[email protected]> 05.08.10 *********************************************************************** */ require(DIR_WS_CLASSES . 'archive.php'); // Load Archive class file require(DIR_WS_CLASSES . 'mysql_db_backup.class.php'); // Load MySQL DB Backup class file define(TEXT_ZCS_BACKUP_VERSION,'Version 1.0.5'); define(FILENAME_ZC_DOWNLOAD, 'backup_zc_download.php'); $zc_directory = DIR_FS_CATALOG; // Used for zen cart site size $zc_directory_base_count = strlen(DIR_FS_CATALOG); // *********************************************************************** // Grab a large chunk of memory // If your server allows this adjustment then adjust to meet your needs. // *********************************************************************** // ini_set("memory_limit","128M"); // ini_set("memory_limit","192M"); // ini_set("memory_limit","256M"); ini_set("memory_limit","512M"); // default // ini_set("memory_limit","768M"); // ini_set("memory_limit","1000M"); // *********************************************************************** // Note each directroy or file name must be surrounded with double quotes // and a single comma with no space separating each. // DIR_FS_CATALOG = Zen Carts root files system path you must use this and // just add the directory you want excluded. // Rember that directories names are case sensitive! // *********************************************************************** /* Sample Exclude $exclude_files = array("".DIR_FS_CATALOG."cache", "".DIR_FS_CATALOG."pub", "".DIR_FS_CATALOG."admin", "".DIR_FS_CATALOG."download" ); */ // *********************************************************************** // Set default exclude directories // *********************************************************************** $exclude_files = array("".DIR_FS_CATALOG."cache", "".DIR_FS_CATALOG."extras", "".DIR_FS_CATALOG."pub", "".DIR_FS_CATALOG."stats" ); // *********************************************************************** // Default Setting // These are the settings that are used when you first request backup zc // You can edit them if you understand them. // *********************************************************************** $file_name = $_SERVER['HTTP_HOST'].'_'.date("mdY-Hi"); // Create File Name $file_ext = '.zip'; // Zip File Extention default $archive_type = 'zip_file'; // Set as default $file_location = DIR_FS_SQL_CACHE."/"; // Set cache directory as default $base_directory = '.'; // Set ZC root as default $compress_level = 3; // 1-9 1 lowest 9 highest only works with zip file $recurse_dir = 1; // 1 = true 0 = false $backup_file_type = '0'; // 0 = zip 1 = gzip 2 = tar $download_backup = 0; // 1 = true 0 = false // *********************************************************************** // SQL Data Base info // *********************************************************************** $sql_path = DIR_FS_ADMIN.'backups/'; // path to SQL file default $sql_file_name = $_SERVER['HTTP_HOST'].'_'.date("mdY-Hi").'.sql'; // Create SQL File Name ?>

Outdoorking
Live Site https://www.outdoorking.com.au

19 Oct 2010, 3:07 PM
#30
skipwater avatar

skipwater

Totally Zenned

Join Date:
Jun 2008
Location:
Washington, DC
Posts:
775
Plugin Contributions:
1

Re: BackUp ZC [Support Thread]

Due to Go Daddy I have rewritten the function directorySize I can not test it because I do not have access to a Go Daddy account. So you will have to try it out.
Find the file YOUR_ADMIN/backup_zc.php replace the directorySize function about line 40.

	// Get the size of the web site
	function directorySize($zc_directory)
	{
    	$zc_size = 0;
    	foreach(new RecursiveIteratorIterator(new RecursiveDirectoryIterator($zc_directory)) as $file)
    	{
        $zc_size += $file->getSize();
    	}
    	return $zc_size;
	}

With this directorySize function

// GoDaddy work around
function directorySize($zc_directory)
{
  $zc_size = 0;
  if ($handle = opendir ($zc_directory))
  {
    while (false !== ($file = readdir($handle)))
    {
      $nextpath = $zc_directory . '/' . $file;
      if ($file != '.' && $file != '..' && !is_link ($nextpath))
      {
        if (is_dir ($nextpath))
        {
          $result = directorySize($nextpath);
          $zc_size += $result['size'];
        }
        elseif (is_file ($nextpath))
        {
          $zc_size += filesize ($nextpath);
        }
      }
    }
  }
  closedir ($handle);
  return $zc_size;
}
// eof GoDaddy work around

Skip

• 446F63746F722057686F •

19 Oct 2010, 8:46 PM
#31
bruce1952 avatar

bruce1952

Totally Zenned

Join Date:
Aug 2008
Location:
Sydney Australia
Posts:
828
Plugin Contributions:
0

Re: BackUp ZC [Support Thread]

Skip,

That appears to have worked but I don't have the option to save for some reason. I have a screen shot so you can have a look.

Outdoorking
Live Site https://www.outdoorking.com.au

19 Oct 2010, 10:22 PM
#32
skipwater avatar

skipwater

Totally Zenned

Join Date:
Jun 2008
Location:
Washington, DC
Posts:
775
Plugin Contributions:
1

Re: BackUp ZC [Support Thread]

You seem to be missing define('BACKUP_EXCLUDED', 'Excluded '); that would be in YOUR_ADMIN/includes/languages/english/backup_zc.php

I don't know how this is not working but check the file and re-upload if it is not there.

The screen should look like the BackUp_ZC_Main_Window.gif file in the zip that you downloaded from the free software addons.

Skip

• 446F63746F722057686F •

19 Oct 2010, 10:49 PM
#33
bruce1952 avatar

bruce1952

Totally Zenned

Join Date:
Aug 2008
Location:
Sydney Australia
Posts:
828
Plugin Contributions:
0

Re: BackUp ZC [Support Thread]

Skip,

This is what is in the file:

<?php /* *********************************************************************** $Id: backup_zc.php, v 1.0.4 2010/07/09 ZenCart 1.3.9f Copyright 2003-2010 Zen Cart Development Team Portions Copyright 2004 osCommerce <http://www.zen-cart.com/license/2_0.txt> GNU Public License V2.0 Written By SkipWater <[email protected]> 05.08.10 *********************************************************************** */ // the following are the language definitions define('BACKUP_COMPLETE_TEXT', '<h1>Backup Completed</h1> Archive was created in '); define('BACKUP_DOWNLOAD', 'Backup file location will be downloaded <b>NOT SAVED ON SERVER</b>'); define('BACKUP_FILE_NAME_TEXT', 'Backup File Name: '); define('BACKUP_LOCATION', 'Backup file location: '); define('BACKUP_TEXT', 'BackUp '); define('COMPLETE_TEXT', 'Complete Site '); define('CREATE_SQL_BACKUP', 'Create a SQL BackUp File From <b>'.DB_DATABASE.'</b> Database: '); define('DEFAULT_SETTINGS', 'Default Settings'); define('DEFAULT_TEXT', ' (Defualt) '); define('DID_NOT_RUN_SQL_TEXT', 'You did NOT Run MySQL BackUp '); define('DOWNLOAD_ARCHIVE_TEXT', 'Download Archive:'); define('DIR_FILES_EXCLUDED', 'Directory and Files excluded from archive: '); define('FILE_NAME_TEXT', '- File Name: '); define('FILE_TYPE_ZIP', 'File type Zip '); define('FILE_TYPE_GZIP', 'File type Gzip '); define('FILE_TYPE_TAR', 'File type Tar '); define('FTP_NOTE_TEXT', 'Please use FTP to download it to free up server space. Thank You<br />'); define('HEADING_FILES', 'Files Only '); define('HEADING_OPTIONS', 'Options'); define('HEADING_NOTES', 'Notes: '); define('HEADING_TITLE', 'Backup Zen Cart'); define('MEMORY_MESSAGE_TEXT', '<b>Due to memory limits on some servers save the archive to the server. (Default)</b><br />or do one directory download at a time.'); define('NO_TEXT', 'No '); define('NOT_ARCHIVED_TEXT', 'This directory is not archived so any files in it will NOT be added. '); define('ONLY_ONCE', 'You need to select this ONLY once per backup session. '); define('ROOT_FILE_TEXT', 'Web Site Root Files Only '); define('SAVE_TO_TEXT', 'Save BackUp File To: '); define('SECONDS_TEXT', ' seconds. '); define('SQL_FILE_TEXT', 'All SQL Files Only '); define('SQL_FILE_NAME_TEXT', 'SQL File Name '); define('SQL_FILE_LOCATION_TEXT', 'SQL file location '); define('SQL_FILE_ARCHIVE_NOTE', ' Your SQL File will be in your arcive backup file. Only if you did a complete backup, sql file backup or Complete Admin backup.<br /> Please use FTP to download or delete it to free up server space. Thank You<br /><br /> '); define('TEXT_NOTES', ' The options to the right allow you to select what you want to archive.<br /><br /> Backup MySQL database will export your Zen Cart database to a SQL file.<br /> When completed BackUp ZC will continue to create a archive file of your selected options. The SQL file will only be added to the archived if you selected Complete Site, All SQL Files or Your Admin Directory.<br /><br /> If you select a directory to backup the directory name will be added to the archives file name. This will allow you to idenify the files contents easily.<br /><br /> Selecting \'Yes\' in the Download Archive dropdown you will get a new window to download your archive.<br /><br /> If you get a blank page php memory has been over used. To fix you can edit backup_zc.php in your admin folder and raise the memory usage.<br /> <br /> <b>Please be patient scanning your Zen Cart directory structure.</b><br /> '); define('YES_TEXT', 'Yes '); define('ZIP_GZIP_COMPRESSION', 'Compression level Zip or GZip: '); // ?>

Outdoorking
Live Site https://www.outdoorking.com.au

19 Oct 2010, 11:10 PM
#34
skipwater avatar

skipwater

Totally Zenned

Join Date:
Jun 2008
Location:
Washington, DC
Posts:
775
Plugin Contributions:
1

Re: BackUp ZC [Support Thread]

I just downloaded BackUp ZC from the free software addons and looking at that file it has the code ie:

// the following are the language definitions
define('BACKUP_COMPLETE_TEXT', '<h1>Backup Completed</h1> Archive was created in ');
define('BACKUP_DOWNLOAD', 'Backup file location will be downloaded <b>NOT SAVED ON SERVER</b>');
define('BACKUP_FILE_NAME_TEXT', 'Backup File Name: ');
define('BACKUP_LOCATION', 'Backup file location: ');
define('BACKUP_TEXT', 'BackUp ');
define('BACKUP_EXCLUDED', 'Excluded ');

How it's gone from your file is unknown.

Skip

• 446F63746F722057686F •

2 Nov 2010, 9:38 PM
#35
batta avatar

batta

New Zenner

Join Date:
Oct 2010
Posts:
14
Plugin Contributions:
0

Re: BackUp ZC [Support Thread]

Skip-
Very nice addition. This eliminates any excuses for not backing up early and often.

A question, though, that may show my ignorance. The ReadMe says "NOTE: If you intend to download files, we STRONGLY recommend you do it only via a secure SSL / HTTPS: connection."

I have SSL on my site. To download via SSL do I do this by manually changing http to https on the Download Backup Archive page each time I go there?

I have looked through backup_zc.php, backup_zconfig.php, and backup_zc_download.php and could spot nothing that would automatically make the Download Backup Archive page SSL nor otherwise make the download SSL protected. I prefer not to modify my admin/includes/configure.php to make my entire admin area SSL protected.

Thanks.

2 Nov 2010, 11:49 PM
#36
skipwater avatar

skipwater

Totally Zenned

Join Date:
Jun 2008
Location:
Washington, DC
Posts:
775
Plugin Contributions:
1

Re: BackUp ZC [Support Thread]

batta:

Skip-
Very nice addition. This eliminates any excuses for not backing up early and often.

A question, though, that may show my ignorance. The ReadMe says "NOTE: If you intend to download files, we STRONGLY recommend you do it only via a secure SSL / HTTPS: connection."

I have SSL on my site. To download via SSL do I do this by manually changing http to https on the Download Backup Archive page each time I go there?

I have looked through backup_zc.php, backup_zconfig.php, and backup_zc_download.php and could spot nothing that would automatically make the Download Backup Archive page SSL nor otherwise make the download SSL protected. I prefer not to modify my admin/includes/configure.php to make my entire admin area SSL protected.

Thanks.

I know that you did not want to activate SSL in the configure file but there is no way around it. But if you store the backup to the server and then sftp the file down. You would be using the secure sftp transfer and would not have to change the configure setting in ZC admin.

The way ZC works with zen_href_link function you would have to set define('ENABLE_SSL_ADMIN', 'true') in the admin/includes/configure.php

And add this code to backup_zc.php around line 158 find

$_SESSION = array_merge($_SESSION, $_POST);
   header('Location: '. zen_href_link(FILENAME_ZC_DOWNLOAD) .'');
   exit();

Change to look like this:

$_SESSION = array_merge($_SESSION, $_POST);
// Download using SSL or NOT
  if (ENABLE_SSL_ADMIN != 'true') {
     header('Location: '. zen_href_link(FILENAME_ZC_DOWNLOAD) .'');
  } else {
     header('Location: '. zen_href_link(FILENAME_ZC_DOWNLOAD,'', 'SSL') .'');
  }
exit();

This change and the Go Daddy fix will be in the next update.

Skip

• 446F63746F722057686F •

3 Nov 2010, 12:30 AM
#37
batta avatar

batta

New Zenner

Join Date:
Oct 2010
Posts:
14
Plugin Contributions:
0

Re: BackUp ZC [Support Thread]

Skip -

Thanks for the quick response. Even with the couple extra steps for the SSL download it is a nice addition.

8 Nov 2010, 8:41 AM
#38
gman avatar

gman

New Zenner

Join Date:
Oct 2010
Posts:
6
Plugin Contributions:
0

Re: BackUp ZC [Support Thread]

I have the same problem.

Using: Linux 2.6.18; PHP version 4.4.9; MySQL version 4.1.22; Zen Cart version 1.3.9h; browser IE8. You mentioned to check for SPL support. Did not see it mentioned in list. How do i go about activating it in my php.ini file?

Error message does not appear in admi, but found it in the /cache folder under xxxxxx.log :

[08-Nov-2010 03:04:39] PHP Fatal error: Cannot instantiate non-existent class: recursiveiteratoriterator in /home3/user_dir/public_html/admin_folder/backup_zc.php on line 44

Could you give me some guidance with this?

8 Nov 2010, 8:55 AM
#39
gman avatar

gman

New Zenner

Join Date:
Oct 2010
Posts:
6
Plugin Contributions:
0

Re: BackUp ZC [Support Thread]

skipwater:

You might not have recursiveiteratoriterator loaded in your php setup.

Try looking admin->tools->Server/Version Info

Scroll down to 'SPL support' and see if it is listed.

If it is not listed you will have to activate it in your php.ini file.

Skip

Get same error on line 44. Looked into server info and did not see SPL support listed. How do i go about activating in the .ini file?

Here's error message found in xxxx.log file in the /cache directory. Error did not show on admin/backup_zc page.

[08-Nov-2010 03:04:39] PHP Fatal error: Cannot instantiate non-existent class: recursiveiteratoriterator in /home3/user_dir/public_html/admin_folder/backup_zc.php on line 44.

8 Nov 2010, 12:36 PM
#40
joyjoy avatar

joyjoy

Totally Zenned

Join Date:
Sep 2010
Posts:
611
Plugin Contributions:
0

Re: BackUp ZC [Support Thread]

Things were going great. But I've just tried to backup, I don't get a success screen. Just blank. The backup file is in my directory but I can't extract anything from it. Corrupted or damaged files...help? Thank you.