There are many reasons why you should consider regularly backing up your oscommerce database, not least of all the fact that sooner or later there is a good chance that you may suffer a partial or complete loss of data.
This may be due to your webhost having server problems, modules or contributions you have added yourself, a corrupt database, or the need to move your oscommerce site to a new server.
In future updates I intend to write a rough guide to transferring your oscommerce store to a new server, but for now I'll cover the essential back-up process prior to any move.
First of all you will need to log into your store admin and back up the database on-line. Click on Tools in the Admin Panel, and then, appropriately enough, "Backups".
You have a couple of options on how to back up your databse here. The quickest and simplest is to just click on Backup and let the store save a copy to the server. If you already have backups, you will shortly see a new addition in the central column with todays date.
If you intend to make changes to the database with the addition of new contributions etc, you can now "roll-back" the database to this point should it all go wrong using the Restore button, (note - you will still have to remove any changes you have made to the actual php files).
As a bit up double-security, it is wise to backup again, but this time choose to download the back-up to your pc hard drive. It is seldom neccesary to use the gzip compression option unless you have an incredibly large site with thousands of products and sales. The admin panel will prompt you to browse to your preferred home pc location to save the file as it would do with any other download.
Ok thats it - you have now backed up your database both on-line, and to your own PC.
For those who are happy using MySql there is another method: log into your website control panel, (not the oscommerce admin panel, but the log in given to you by your hosting company). Any webhost worth its salt will also have given you access to your on-line database via the MySql panel. Acess this now and have alook in the panel for the option to "export" the database.
Dont worry, this doesnt actually remove the database from its current location. Again, there are a multitude of options as to the format that you may want to export the database. My preference is always to save it as an .sql file, unless I specifically want to manipulate the database in Excel or some other program.
For this tutorial we'll go for an sql backup. Make sute sql is clicked and hit the "go" butoon at the bottom. It may take a moment or two, but you will eventually be presented with a box full of sql code. Select ALL of the code with the mouse, copy it, and paste it into notepade on your pc, (I personally prefer to use the excellent NotePad2.exe simply because the colour coding of script is easier on the eye!).
You now need to save this file to somewhere on your hard drive. When saving, give the file a name, but always end it with .sql
You now have your databse backed up!
To back up the actual site itself, with the images, layouts and all those php files, you will need an ftp, (File Transfer Protocol) program.
These come in many different varieties, some you can pay for, some are free. If you simply intend to use it for uplaods and downlaods to and from your oscommerce store, then you may as well grab one of the free ones.
Follow the instructions in your ftp program for connecting to the server, and simply highlight all the files in your root folder and drag them across to the relevant folder on your hard drive. Make sure that you ftp is downloading in binary format, as some ftp will download blank files when dealing with ftp if left to select their automatic or default method.
Expect it to take quite a while to complete, even if you have high speed broadband. Once finished, go to the file where you saved the site, and open up one of the php files in your editing program just to make sure that everything is in order there.
You should now have a complete backup of your site databse and the site itself.
Coming soon: how to trasnfer your oscommerce store onto a new server and get it working!
want-a-site.co.uk: low cost website design and hosting - wigan