Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

backing up files and databases


joekilo

Recommended Posts

ok i have almost finished my store...and after the work thats gone in theres always a worry that in the event of a crash or whatever things will get lost..

 

So i basically would like to know the best way of backing up my store and how regulary should this be done? i know this sounds stupid i have done a download of the storebefore but it takes ages by ftp not sure if there are easier ways

 

Also do i have to back up the database? i not sure how i use the database? or if i need to at all

 

thanks in advance

jk

Link to comment
Share on other sites

The code in /catalog/... is obviously what runs the cart plus where the images are stored. The db is where the data is stored (i.e. customer info, orders, plus all the cart settings). VERY IMPORTANT to back up both often!!!

 

Here's what I do currently:

 

I use the admin>tools>backup feature to make a backup of the db. I make a backup daily - how often you do it depends on how much traffic/sales you get and how often you want to have a backup. (To use this feature you have to set up a directory in the catalog/admin/configure.php file =>

define('DIR_FS_BACKUP', DIR_FS_ADMIN . 'backups/');

You can use any directory name you wish; you can also probably set up any path you wish, but I store mine in the amin/backups directory.)

 

For security I then ftp a copy of this backup offsite to another computer. Since I modify my code quite a bit, I ftp the entire catalog directory, which includes all the backups at least once a week.

 

(You can also copy the db files manually, but to do so you need to stop the SQL server while copying.)

 

I plan on setting up some automated method to do this in the future so that I have daily backups.

 

Hope this helps,

Kirk

Boom... Big butta boom.

Link to comment
Share on other sites

thanks for the advice...you say you back up your whole store by ftp at least once a week...it takes ages yeah? or is there an easier way..i think maybe my problem is cos i have the other languages directories on there which i dont need so can these just be deleted without complication...

 

And finally on the admin back up does this only cover thenew data ie customers etc..not any coding or catalog details.. you say you ftp a safer copy to anothercomputer this is ok to disk though right?

 

thanks in advance

jk

Link to comment
Share on other sites

The admin backup tool backs up the complete data base each time you use it. This includes all customer data, sales, and all of the cart settings. It does not include the OSC code.

 

You only need to backup your code (/catalog/*) once UNLESS you make changes in it. Then you should back it up BEFORE you make changes in case you screw it up, and then AFTER to have a good copy saved. So this means any time you make changes to the code or add contributions. Your product and other images are also stored in the code directory, so unless you have backup copies of these, it is a good idea to backup the code directory after adding new products, etc.

 

I have a fast connection (cable modem) when I ftp, but it takes about 15 minutes. If it takes too long, or if you prefer, you can of course backup onto disk or cd.

 

As to the other languages, I also have one extra in my cart, but I can not comment on deleting them and any ramifications that may cause. BACKUP first!!!!!! b4 trying this.

Boom... Big butta boom.

Link to comment
Share on other sites

p.s sorry can you advise me on the restore function within the back up does this need to be used or is the back up enough?

 

Ijust wanna get it straight without guessing cheers

jk

Link to comment
Share on other sites

Restore is what you do if you want to go back to a backup. I.e. if your database gets corrupted, you will then use the restore function to "restore" your database to the way it was when you backed it up.

 

Hth,

Matt

Link to comment
Share on other sites

Deleting the other languages won't save much as id you have no date/images etc there's only a fe configuration files. I tried it ot save space. i think it saved less than O.5Mb out of 7.5 or less.

 

I suggest you copy all of your shop over to your home pc once, then any updated files as and when. Then just trh database once a day if you like.

 

I'm really new at this only just setting up. But it makes sense to me.

 

:lol:

 

Roger

facts invariably distort the truth

Link to comment
Share on other sites

I am too seeking a way to backup my entire store. Not just only the database, which is very important, but also the images of each product that is into the /images directory.

I don't know why but when I xcopy the entire /catalog tree at once via ftp sometimes connection gets lost. what i'm doing now is backuping folder by folder..

 

It will be great if in future versions a backup module is created, so besides backuping the database, it could also gzip the entire store, with images and all the code. :)

Link to comment
Share on other sites

Yes, but where would you put it? If it were running from the webserver, it would have to be put in the web folder, which is what you are trying to backup.

 

Better is to get your host to set up something to do that for you. A backup is very easy to do with shell access.

tar jcf . backup.`date +%Y%m%d%h%M%S`.tbz2

Hth,

Matt

Link to comment
Share on other sites

HI,

 

I posted another note about the error message I am getting.

 

I am beggining to think that it is a db error because the only pages I get the error is product related.

 

So does that mean that if I do backup restore from the admin/backup etc.

this will restore all my items products, prices etc?

 

by the way the error message I get is

 

1016 - Can't open file: 'products.MYI'. (errno: 145)

 

select p.products_id, pd.products_name, products_date_available as date_expected from products p, products_description pd where to_days(products_date_available) >= to_days(now()) and p.products_id = pd.products_id and pd.language_id = '1' order by date_expected desc limit 10

 

[TEP STOP]

 

Corwyn

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...