Magento Server Crash!! Tips on Magento Backup - OLD POST
** VERY OLD POST ** The information in this post is likely to have been superseded
"So it was bound to happen - I knew I should not have drizzled honey over my Magento server - but that was not the problem, it was the Bear that ate it that cause my business the most inconvenience!!" - ok these aren't the actions of a normal, or even sane, systems administrator and as far as I know, this has never happened (please someone tell me it has though) ... but the outcome is familiar. No more server, all your orders, customer details, configuration GONE! You cannot predict what is going to happen, you can insure yourself against it causing a major problem to your business by taking a few precautions.
This is a brief article on backing up your Magento store in the simplest way possible.
Backing up a Magento CE store can be split into two parts backing up the database and backing up the file structure.
The database contains all of your orders, product details, customer details, site configuration - pretty much anything you submit through the back office
The file structure contains the files that make your site work, the images (including product images), any extensions you have installed (either by downloading or through Magento-Connect).
The database is likely to change pretty regularly depending on how busy your site is. Every time an order is placed, a product is updated or a customer is added the database is updated.
So here are my tips for backing up a Magento store (for Community edition). Let's start with the database.
- This is fairly straightforward. In the back office go to >system> tools> backups
- This shows a list of all the backups you have performed. These backups are the database only (not the system files) so they contain product data, orders, how the system is set up etc
- To back up simply press the 'Create Backup' button at the top right of the page.
- The backup is created as an SQL file - so it is one big SQL query which you can run against an empty database to restore.
- You can copy this file on to your local machine by clicking on the 'qz' link in the download column of the page. You can also get to this via FTP - if you FTP into your server from the root there is a folder called 'var' and in that folder is a folder called 'backups' this contains all of the back-ups you have taken as compressed files.
So that covers backing up the data. To back up your site I would advise that whenever you make any changes to the code, or if you have uploaded an extension then FTP into the site and literally copy everything from your server (all files in the root and all subdirectories) to a local machine or another machine. If you backup the database before you do this you will also have a copy of the database in the /var/backup folder so a complete backup that you can restore from should the worst happen.
It is important when backing up data that you have the backup is taken off the server. So take a copy to your local PC or server. That way if your server was to be stolen, blew up or even eaten by a bear you will still have a backup to start again with.
For incremental backups perform a backup of the database and also backup the /media folder on the server - this contains all your images for products and the CMS.
That should keep you covered.
It is worth having a look on Magento Connect where you can find extensions that will automate the backup process. If you have any that you use or would recommend please just comment below.
One last thing. Don't drizzle honey on your server.