Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Contribution: Auto Backup Database


spooks

Recommended Posts

Hey everyone, I've been playing around on my dev site trying to get another addon to work with 2.3.3.2 and ran into a couple problems restoring a backup.

1)I received the following error

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/flournet/public_html/sandbox/snuffle_upagus/includes/functions/db_backup.php on line 166

1065 - Query was empty

 

I notice line 166 is

 

$create_table_result = mysql_fetch_array($create_table_query, MYSQL_NUM);

 

And, I believe (I'm not a coder) this should be changed for 2.3.3.2 to

 

 $create_table_result = tep_db_fetch_array($create_table_query, MYSQL_NUM);

 

I've changed in my dev site and tested and now works...

 

2)When restoring, leaving the

Do you want to empty the tables sessions and whos_online (advisable when doing a complete restore, will also reset the date and file used for last restore)?
defaulted "checked"

 

It seems to be deleting these tables completely... Not emptying...

 

When I leave the box "upchecked' I receive the following error

Error: no tables selected for restore

 

Can anyone confirm???

Link to comment
Share on other sites

  • 2 months later...

I am having the hardest time installing this into a 2.3.3.4 store.

I upload all of the files, overwriting the files in the store, then I run the auto_backup_setup.php

 

Afterwards, Everything looks ok, and I get the green bar across the top, however, when I try to run a new backup, I get a server error

PHP Fatal error:  Call to undefined function tep_db_fetch_array_num() in /var/www/*******/*******/backup.php on line 184, referer: http://mtrosemedia.org/*******/*******/backup.php?action=backup

 

I reverted back to my backed up copy of backup.php, but nothing runs automatically. And now, I can't backup with compression, only uncompressed.

Link to comment
Share on other sites

  • 5 months later...
  • 3 months later...

I'm running into the same issues as in the last 3 posts in my local install using Xampp and oscommerce v2.3.4.

I'm using what I believe is the latest version by Snoopy: http://addons.oscommerce.com/info/8902/v,23

 

When I try to restore a backup, I get the error:

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in xampp/mylocalstore/includes/functions/db_backup.php on line 166

So I changed the two instances of  mysql_fetch_array to tep_db_fetch_array in the db_backup.php file, but when I try to restore the backup, now I get this error:

1146 - Table 'mystore.whos_online' doesn't exist

show create table `whos_online`

[TEP STOP]

Does anyone know how to fix this and update the addon to work with v2.3.4?

@@greasemonkey and @@Snoopy10, could you guys please help out?

 

TIA! :)

 

In time: when I uncheck the "Do you want to empty the tables sessions and whos_online" box, I'm able to restore the backup.

Edited by Patty

Patty

Link to comment
Share on other sites

  • 3 weeks later...

Hi, Question..

 

I have set auto backup every 10 minutes when i'm working in admin.  All good.

 

Set Backup delete for 200 hours, but every time it's makes a backup the last backup made of 10 minutes ago is getting deleted. ?

 

Where is the problem.

 

Greetings, Anne

Link to comment
Share on other sites

  • 2 weeks later...

@@Patty that is as far as I've got.

 

So when you restore just be sure to leave the "who's online and sessions option" UN-checked.

 

It sounds like that works for you? It does for me.

 

Hi there. Sorry I didn't reply before, just read this now. Tks for replying.

 

It works that way, but it seems to me it's a bug that should be fixed. ;)

Patty

Link to comment
Share on other sites

  • 3 years later...
  • 2 years later...

Uploaded new update:

WARNING: auto_backup_setup.php don't upgraded, I DON'T KNOW IF WORKS, DON'T USE IN LIVE STORE.

- Bootstraped Page - Bootstraped Buttons - Replaced array() to []

- Replaced require('file-path') to require 'file-path'

- Replaced require('file-path') to require 'file-path'

- Replaced XHTML Tags to HTML Tags - Added Spanish translations (partially)

Link to comment
Share on other sites

On 4/15/2020 at 1:40 PM, PiLLaO said:

Uploaded new update:

WARNING: auto_backup_setup.php don't upgraded, I DON'T KNOW IF WORKS, DON'T USE IN LIVE STORE.

- Bootstraped Page - Bootstraped Buttons - Replaced array() to []

- Replaced require('file-path') to require 'file-path'

- Replaced require('file-path') to require 'file-path'

- Replaced XHTML Tags to HTML Tags - Added Spanish translations (partially)

Unfortunately this is not working for Phoenix 1.0.56

I'm getting errors like

Notice: Undefined index: listing in C:\xampp\htdocs\phoenix\admin\backup.php on line 41

And when I try to restore a back up, it created an uncompressed back up file, but neither back ups can be restored:

Error: no tables selected for restore

Can someone please help making this addon compatible with Phoenix latest versions? This one should be made part of the project.

TIA! 

 

Edited by Patty

Patty

Link to comment
Share on other sites

On 4/18/2020 at 6:45 PM, Patty said:

And when I try to restore a back up, it created an uncompressed back up file, but neither back ups can be restored:

Error: no tables selected for restore

 

Can you check the backup file have data?

Uncompress the file and look at the sql file, please.

Link to comment
Share on other sites

Seems to never works this function, at least as I can see on code, was mixing $_GET and $_POST at same time.

You must to find on catalog/admin/backup.php this line:

      // end if ($buInfo->table_list != TEXT_INFO_NO_INFORMATION)
        $contents[] = ['class' => 'text-center', 'text' => tep_draw_bootstrap_button(IMAGE_RESTORE, 'fas fa-file-upload', tep_href_link('backup.php', 'file=' . $buInfo->file . '&action=restorenow'), null, null, 'btn-warning mr-2') . tep_draw_bootstrap_button(IMAGE_CANCEL, 'fas fa-times', tep_href_link('backup.php', 'file=' . $buInfo->file), null, null, 'btn-light')];

and replace by this:

      // end if ($buInfo->table_list != TEXT_INFO_NO_INFORMATION)
        $contents[] = ['class' => 'text-center', 'text' => tep_draw_bootstrap_button(IMAGE_RESTORE, 'fas fa-file-upload', tep_href_link('backup.php', 'file=' . $buInfo->file . '&action=restorenow&restore_all=1'), null, null, 'btn-warning mr-2') . tep_draw_bootstrap_button(IMAGE_CANCEL, 'fas fa-times', tep_href_link('backup.php', 'file=' . $buInfo->file), null, null, 'btn-light')];

it's a dirty fix to make it works temporarily.

Link to comment
Share on other sites

Thank you! That worked! Uncompressed back up was restored!

But it won't restore the compressed back up file. Also it's forcing the restoring of all tables, not just the selected ones. 

Like you said, it's just a temporary fix, but the code should be reviewed to make it work as it's supposed too.

In any case, thank you for your help with this! Have a great week and stay safe! 😙

Patty

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