Jump to content

When to back up prestashop files?


Housy

Recommended Posts

Hello ;-)

I would like to know, how often do you backup your files on server?

Are you doing this only, when you add some new products or when should i do it and which folders and files should i backup regularly?

I just don't want to lose any data, so i rather ask.

Thank you,
Housy

Link to comment
Share on other sites

Tnx for your reply mona22 =)

I thought it would be a good idea to do this each time you upload some pictures of products, cause for example if someone hack into your shop and delete some of the products in admin area, that will also erase images and that could be a huge disaster, especially if you have like 1000 products, then you would have to upload all images again.

I will probably do that atleast once per week, cause you never know what can happen.

Housy

Link to comment
Share on other sites

Hello,

I run a cron script to backup my databases daily this is so I don't lose orders. As for the files themselves because the shop admin is adding new products often I do a file backup weekly again with a cron script.


I have two backup systems for my databases:

1. Use MUTT (a linux email client) which lets me email my database off site (away from hackers) to an e-mail account. This works okay as my databases is only about 2mb in size at the moment.

2. Get a server or PC on my home or office network to FTP or SCP (better) to connect run a dump and copy the file to itself. This means I have the database safely stored on an PC in my natted / firewall home network.

For my prestashop file backup I use the same office PC or server to connect to the webserver tar (or zip) up the prestashop directories and download it safely onto the PC. This makes fairly large backup files if you have a lot of product images so I only do it once a week to save the server resources.



These methods give me off site backup recovery should the webserver die or be hacked

Ta

Dave

Link to comment
Share on other sites

Hello,

I run a cron script to backup my databases daily this is so I don't lose orders. As for the files themselves because the shop admin is adding new products often I do a file backup weekly again with a cron script.


I have two backup systems for my databases:

1. Use MUTT (a linux email client) which lets me email my database off site (away from hackers) to an e-mail account. This works okay as my databases is only about 2mb in size at the moment.

2. Get a server or PC on my home or office network to FTP or SCP (better) to connect run a dump and copy the file to itself. This means I have the database safely stored on an PC in my natted / firewall home network.

For my prestashop file backup I use the same office PC or server to connect to the webserver tar (or zip) up the prestashop directories and download it safely onto the PC. This makes fairly large backup files if you have a lot of product images so I only do it once a week to save the server resources.


First of all thank you for such a great reply Dave ;-)

But I still have few questions for you :-)

Are you using the CronTab for PrestaShop -> this one? Is Cron reliable?

I will definitely consider using the MUTT email client. Is that hard to install and connect with PrestaShop?

Thanks,
Housy
Link to comment
Share on other sites

Hello Housy,

I use the cron system that comes with the linux server I host my site on. Depending on your host you should have access to this.

As I have a centos VPN which runs vixie cron by default that is the one I use. This is very reliable. Of course I do check my emails each day but I do that anyway becasue i use e-mail daily.

I must say I don't know about that module you showed me.

As my server is running centos (just like redhat linux) I can simply drop my backup scripts in the folder /etc/cron.daily or /etc/cron.weekly and my backup jobs work without fail (so far)

If you are on a shared hosting you may have to use a cron tool that the host provides but this is not that hard - I can help if you like.

The mutt command is very easy to use - but not all webhosts install it. I have listed my linux shell script (not windows I am afraid - I do have one for Windows servers somewhere I think) which backs up my database and e-mails it to me once a day using the mutt command.

So basically I run this command script daily from the webserver itself using the cron scheduler. Alternatilvey if you have a linux pc (ubuntu or whatever) at home or in your office you can configure that to connect you you remote server to dumb the database and e-mail it to you. However, this only works if the webhost allows secure shell commands


#!/bin/sh
#These are the parts you will need to change to suit your setup
BACKUPDIR=/home/myuser/backups/
[email protected]
[email protected]
DBNAME=MYPRESTASHOPDATABASE
DBUSER=MYPRESTASHOPDATABASEUSER
DBPASSWORD=MYPRESTASHOPDATABASEPASSWORD
#End These are the parts you will need to change to suit your setup
BACKUPDATE=`date +%Y-%m-%d`
MySQLFILE=$BACKUPDIR/$BACKUPDATE.$DBNAME.sql.gz

# Use mySQL dump tool to dump your database
mysqldump  -u$DBUSER -p$DBPASSWORD $DBNAME | gzip > $MySQLFILE

#Mail Backup Off-Site to two different e-mails using mutt

echo "Your mySQL $DBNAME Backup is attached" | mutt -a $MySQLFILE $EMAILA -c $EMAILB -s "$DBNAME backup"

#delete the file so you don't take up space (optional of course)
cd $BACKUPDIR

rm -f $MySQLFILE


Link to comment
Share on other sites

I am using my own backup module http://www.prestashop.com/forums/viewthread/55766/ I set it to backup daily on the server, and also send a copy of the backup to my email (on a different server).

It lets you set a different backup time for file / database (using cron).

I do daily backup of the database and weekly of the files.


This is even better, didn't know module exist especially for that, tnx dude =)

But for now i think i'll choose Daves method, because it's free ;)

Tnx to both =)
Link to comment
Share on other sites

  • 2 weeks later...

Hi,

We use a combination of what others have posted.

We initially started out with using Tomer's backup module, and we still continue to do so. I highly recommend it! He offers great support too!
His modules has 2 options: to backup your DB and one to backup your files/directories. We started out using both, but as our files started to become larger (mainly due to the images) we had to disable that feature. We didn't want to increase our max execution time and size directives for security reasons. Anyways, we still use the DB backup feature to backup our DB every 12 hours... and it also emails us a copy! It's worked without a hitch for almost a 9 months now.

We also started to run AutoMysqlBackup script to backup our other DB's on our server... ie. mail server, configurations, blog db, etc. We have this backup 1 daily with an email report. Both AutoMysqlBackup and Tomer's Backup module running on cron.

We are always adding new products each and every day... and although our DB is backed up with out our images we would be in a lot of trouble. So we use JungleDisk to backup our PS files and some other server files to an off location server/storage facility. It costs us $5 a month and 10gb is free. It does incremental backup's so you don't pay anymore thna the changes you make. It has a good interface and it you can easily restore your backups from many different points.

I should aslo mention that our Automysqlbackup script saved our other DB backups to a folder, and when we setup JungleDisk we just selected this "backup" folder to be included in its backup (along with our PS directory). So everything is backed up at least 1-2 a day to multiple off site locations.

HTH!

Link to comment
Share on other sites

  • 3 years later...
In a store that has movements daily level database, The backups should be scheduled every second, every minute.
 
Personally, I scheduled backups every hour.
 
I can not write English, I used google translator.
 
---
 

 

why not use backup from hosting ftp or cpanel?

 

I schedule the backup with cron, you can also do this from the hosting panel (cpanel, plesk, etc. ..)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...