backup and restore of webshop do it yourself guide, by ... · tell_a_friend.php total backup and...

12
Backup_and_Restore_of_Webshop_Do_It_Yourself_Guide_by_Bertil_Palmqvist_en.pdf Backup and Restore of webshop Do It Yourself Guide, by Bertil Palmqvist Contents Introduction......................................................................................................................................1 Disclaimer........................................................................................................................................ 1 Prerequisites.....................................................................................................................................1 Total Backup and Restore of a Webshop..............................................................................................3 Backup of a osCommerce 2.3.4 Webshop....................................................................................... 3 Restore of a osCommerce 2.3.4 Webshop....................................................................................... 6 Restore the database via the admin interface.............................................................................. 9 Restore the database from the Web hosting control panel........................................................ 10 Move of a Webshop to another web hosting provider........................................................................10 Introduction Follow this guide at your own risk! The best thing is to test the method on a test installation of osCommerce Webshop. Disclaimer The information in this document is for general information. The information provided by me Bertil Palmqvist and while I strive to keep the information current and accurate, I make no representations or warranties of any kind, expressed or implied, about the completeness, accuracy, reliability, suitability or availability regarding the contents of this document. You use the information in this document entirely at your own risk. Under no circumstances will I be liable for any loss or damage including without limitation, indirect or consequential loss or damage, or any loss or damage whatsoever arising from loss of data or profits arising out of or in connection with the use of this document. Prerequisites Do not try this unless you know what you are doing! You have your own computer with a broadband internet connection. You have a FTP client program installed, I recommend Filzilla. 1

Upload: others

Post on 25-Oct-2020

5 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Backup and Restore of webshop Do It Yourself Guide, by ... · tell_a_friend.php Total Backup and Restore of a Webshop This method for making full backups, and total recovery can probably

Backup_and_Restore_of_Webshop_Do_It_Yourself_Guide_by_Bertil_Palmqvist_en.pdf

Backup and Restore of webshop Do It Yourself Guide, byBertil Palmqvist

ContentsIntroduction......................................................................................................................................1Disclaimer........................................................................................................................................1Prerequisites.....................................................................................................................................1

Total Backup and Restore of a Webshop..............................................................................................3Backup of a osCommerce 2.3.4 Webshop.......................................................................................3Restore of a osCommerce 2.3.4 Webshop.......................................................................................6

Restore the database via the admin interface..............................................................................9Restore the database from the Web hosting control panel........................................................10

Move of a Webshop to another web hosting provider........................................................................10

Introduction

Follow this guide at your own risk! The best thing is to test the method on a test installation of osCommerce Webshop.

Disclaimer

The information in this document is for general information. The information provided by me BertilPalmqvist and while I strive to keep the information current and accurate, I make no representationsor warranties of any kind, expressed or implied, about the completeness, accuracy, reliability, suitability or availability regarding the contents of this document. You use the information in this document entirely at your own risk.Under no circumstances will I be liable for any loss or damage including without limitation, indirector consequential loss or damage, or any loss or damage whatsoever arising from loss of data or profits arising out of or in connection with the use of this document.

Prerequisites

Do not try this unless you know what you are doing!

You have your own computer with a broadband internet connection. You have a FTP client programinstalled, I recommend Filzilla.

1

Page 2: Backup and Restore of webshop Do It Yourself Guide, by ... · tell_a_friend.php Total Backup and Restore of a Webshop This method for making full backups, and total recovery can probably

Backup_and_Restore_of_Webshop_Do_It_Yourself_Guide_by_Bertil_Palmqvist_en.pdf

You have an installed osCommerce Webshop of version 2.3.x

This method can work with other versions of osCommerce as well.

NOTE! There are two ways how you copied to your osCommerce software to your domains HTML root from the beginning, either with the "catalog" folder, or everything under the "Catalog" directory. FTP copying in this document describes how to copy to and from the web page including the "Catalog" directory.

If you copied all under "Catalog" directory during installation, do the same now, that is, you must select the following directories and files, and drag and drop between windows of Filezilla:If you have a responsive version or another template verison of osCommerce, then my best guess is to copy everything from your domain root!This is the list of files and directories for the standard osCommerce 2.3.4 version of osCommerce:

account_edit.php account_history_info.php account_history.php account_newsletters.php account_notifications.php account_password.php account.php address_book.php address_book_process.php admin advanced_search.php advanced_search_result.php checkout_confirmation.php checkout_payment_address.php checkout_payment.php checkout_process.php checkout_shipping_address.php checkout_shipping.php checkout_success.php conditions.php contact_us.php cookie_usage.php create_account.php create_account_success.php download download.php ext images includes index.php info_shopping_cart.php install login.php logoff.php

2

Page 3: Backup and Restore of webshop Do It Yourself Guide, by ... · tell_a_friend.php Total Backup and Restore of a Webshop This method for making full backups, and total recovery can probably

Backup_and_Restore_of_Webshop_Do_It_Yourself_Guide_by_Bertil_Palmqvist_en.pdf

opensearch.php password_forgotten.php password_reset.php popup_image.php popup_search_help.php privacy.php product_info.php product_reviews_info.php product_reviews.php product_reviews_write.php products_new.php pub redirect.php requires reviews.php shipping.php shopping_cart.php specials.php ssl_check.php stylesheet.css tell_a_friend.php

Total Backup and Restore of a Webshop

This method for making full backups, and total recovery can probably also be used for earlier versions of osCommerce Webshop. It can probably be used on responsive and other template versions of osCommerce taking into account that there may be other directories and files to be copied. I myself have only tested it on the official standard versions 2.3.3, 2.3.3.4 and 2.3.4 of osCommerce.

Backup of a osCommerce 2.3.4 Webshop

Log in as administrator. Go to Tools -> Database Backup. Click on Backup button. Let ”No Compression (Pure SQL)” be marked. Leave ”Download only (do not store server side) unmarked. Click the Backup button. After a short while a Green line at the top will be shown ”Success:The database have been saved. The database file will also be listed with Title, date and size like this example:

Title Date Size

db_bpdata_se-20140525090047.sql 05/25/2014 08:59:29 312,418 bytes

3

Page 4: Backup and Restore of webshop Do It Yourself Guide, by ... · tell_a_friend.php Total Backup and Restore of a Webshop This method for making full backups, and total recovery can probably

Backup_and_Restore_of_Webshop_Do_It_Yourself_Guide_by_Bertil_Palmqvist_en.pdf

The Database have been saved correctly. Now you can logout.

Begin with making a new directory, in your local computer, with a name that includes the Webshopsdomainname and date and your own comments.

Example in Linux:

$ mkdir bpdata_shop_backup_20140525_de_sv

Start the FTP client program (Filezilla) for doing the total file backup.

You can make the directory direct in Filezilla

4

Page 5: Backup and Restore of webshop Do It Yourself Guide, by ... · tell_a_friend.php Total Backup and Restore of a Webshop This method for making full backups, and total recovery can probably

Backup_and_Restore_of_Webshop_Do_It_Yourself_Guide_by_Bertil_Palmqvist_en.pdf

Navigate to the new directory in the left pane, there you see an empty filelisting window. Connect to your Webshop website, you will see the root html listing there. In this example there are other directories and files that not belong to the osCommerce webshop.

The only directory of intrest here is the ”catalog” directory. Drag and drop it from the right side to the left side.

If you installed the osCommerce without the top directory "catalog", then select all the folders and files in the right window, and drag and drop them from right to left side.

5

Page 6: Backup and Restore of webshop Do It Yourself Guide, by ... · tell_a_friend.php Total Backup and Restore of a Webshop This method for making full backups, and total recovery can probably

Backup_and_Restore_of_Webshop_Do_It_Yourself_Guide_by_Bertil_Palmqvist_en.pdf

Wait until the transfer is complete. It can take from about five minutes to an hour depending on the size of your online store and transfer speed of your broadband.

When the transfer is complete close down Filezilla. Now the total backup completed!

You can now, if you like, burn the "catalog" directory to a CD/DVD disc or save to a USB stick.The size use to be from 50 MB to a couple of hundred MB.

Restore of a osCommerce 2.3.4 Webshop

If you have followed the previous step to make total backups of your osCommerce 2.3.4 Webshop, it is easy to restore the Webshop to an earlier state when the backup was made. All new customers

6

Page 7: Backup and Restore of webshop Do It Yourself Guide, by ... · tell_a_friend.php Total Backup and Restore of a Webshop This method for making full backups, and total recovery can probably

Backup_and_Restore_of_Webshop_Do_It_Yourself_Guide_by_Bertil_Palmqvist_en.pdf

and new orders that have not been delivered and paid in the meantime will be lost if you make a restore.

It is essential not to be rash. Check first with support for the web space provider if the error can be corrected by them.

What could be the reason for the need to restore the webshop?If your customer can not access the Webshop, or if you can not access the administration area of the Webshop there can be a need for a total restore.

Another reason for a restore can be if there are a lot of error messages when accessing the catalog oradmin area. If the error seem to be in the database or software files, and the cause is not by the webservice provider.

First you need to restore the whole "catalog" folder from your local computer where the backup is stored. This is best done via FTP client Filezilla. Start Filezilla, log on to the online store via FTP. Go to the directory you want to restore from in the file window on the left side.

Drag and drop the “catalog” directory from left to right window. Make sure you don't drop it on top of a directory but on top of file listing. If there is any files left select replace all if question window appears.

7

Page 8: Backup and Restore of webshop Do It Yourself Guide, by ... · tell_a_friend.php Total Backup and Restore of a Webshop This method for making full backups, and total recovery can probably

Backup_and_Restore_of_Webshop_Do_It_Yourself_Guide_by_Bertil_Palmqvist_en.pdf

Again it will take about 5 to 60 minutes depending on how much data you have and the speed of your internet connection. When it has completed, you can close the Filzilla program. The total Restore of files is completed. Log in as admin and check that everything works as before. Access the Webshop as a customer and check that everything works.

If everything works as expected, the restore is completed!

If not, there can be something wrong with the database. Restoring the database from a database backup file can be done in several ways, of which two are shown here:Restore the database via the admin interfaceRestore the database from the Web hosting control panel

8

Page 9: Backup and Restore of webshop Do It Yourself Guide, by ... · tell_a_friend.php Total Backup and Restore of a Webshop This method for making full backups, and total recovery can probably

Backup_and_Restore_of_Webshop_Do_It_Yourself_Guide_by_Bertil_Palmqvist_en.pdf

Restore the database via the admin interface

If you can access the administrator area, login as admin an go to Tools -> Database Backup . Mark the sql file you like to restore and click on the Restore button in the right column. Verify by clickingthe Restore Button at the bottom of the right column. Check if the problem has gone, if so you are done!

9

Page 10: Backup and Restore of webshop Do It Yourself Guide, by ... · tell_a_friend.php Total Backup and Restore of a Webshop This method for making full backups, and total recovery can probably

Backup_and_Restore_of_Webshop_Do_It_Yourself_Guide_by_Bertil_Palmqvist_en.pdf

Restore the database from the Web hosting control panel

If you can not access the admin area, log in to your web hosting provider control panel.Begin with deleting the whole database, but make sure you have a good, and relatively new, database file to restore from!Start the phpMyAdmin tool. Choose the correct database. Check all tables. Drop . Click Go.Verify the drop. The complete database has been deleted. Choose Import. Browse and navigate to the directory you want to restore from. Go down to catalog/admin/backups and mark the sql file to restore and click Open. Then click Go . The database backup sql file can contain errors that have tobe corrected before it can be used for restoring. If an error occur edit the sql file locally and find the faulty code and correct it. Import the sql file again and run it with Go. When no more errors occur, the database has been restored.

The total restoration is complete. Log in as administrator and check that everything works as before.Go to your Web shop as a customer and make sure everything works.

Move of a Webshop to another web hosting provider

Follow the same procedure as above Total Backup and Restore of a Webshop. The only thing that needs to be altered is the two configure files. At the new site you have have to edit the files catalog/includes/configure.php and catalog/admin/includes/configure.php, and put in the new domainname, html root path and database access data, alter the yellow highlited fields below. Use the information given to you by the new hosting provider.

”catalog/includes/configure.php” :

<?php

define('HTTP_SERVER', 'http://bpdata.se');

define('HTTPS_SERVER', 'http://bpdata.se');

define('ENABLE_SSL', false);

define('HTTP_COOKIE_DOMAIN', '');

define('HTTPS_COOKIE_DOMAIN', '');

define('HTTP_COOKIE_PATH', '/catalog/');

define('HTTPS_COOKIE_PATH', '/catalog/');

define('DIR_WS_HTTP_CATALOG', '/catalog/');

define('DIR_WS_HTTPS_CATALOG', '/catalog/');

define('DIR_WS_IMAGES', 'images/');

define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/');

define('DIR_WS_INCLUDES', 'includes/');

10

Page 11: Backup and Restore of webshop Do It Yourself Guide, by ... · tell_a_friend.php Total Backup and Restore of a Webshop This method for making full backups, and total recovery can probably

Backup_and_Restore_of_Webshop_Do_It_Yourself_Guide_by_Bertil_Palmqvist_en.pdf

define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . 'functions/');

define('DIR_WS_CLASSES', DIR_WS_INCLUDES . 'classes/');

define('DIR_WS_MODULES', DIR_WS_INCLUDES . 'modules/');

define('DIR_WS_LANGUAGES', DIR_WS_INCLUDES . 'languages/');

define('DIR_WS_DOWNLOAD_PUBLIC', 'pub/');

define('DIR_FS_CATALOG', '/customers/4/b/1/bpdata.se/httpd.www/catalog/');

define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/');

define('DIR_FS_DOWNLOAD_PUBLIC', DIR_FS_CATALOG . 'pub/');

define('DB_SERVER', 'bpdata.se.mysql');

define('DB_SERVER_USERNAME', 'bpdata_se');

define('DB_SERVER_PASSWORD', 'xxxxxxxxx');

define('DB_DATABASE', 'bpdata_se');

define('USE_PCONNECT', 'false');

define('STORE_SESSIONS', 'mysql');

define('CFG_TIME_ZONE', 'Europe/Stockholm');

?>

”catalog/admin/includes/configure.php” :

<?php

define('HTTP_SERVER', 'http://bpdata.se');

define('HTTP_CATALOG_SERVER', 'http://bpdata.se');

define('HTTPS_CATALOG_SERVER', 'http://bpdata.se');

define('ENABLE_SSL_CATALOG', 'false');

define('DIR_FS_DOCUMENT_ROOT', '/customers/4/b/1/bpdata.se/httpd.www/catalog/');

define('DIR_WS_ADMIN', '/catalog/admin/');

define('DIR_FS_ADMIN', '/customers/4/b/1/bpdata.se/httpd.www/catalog/admin/');

define('DIR_WS_CATALOG', '/catalog/');

define('DIR_WS_HTTPS_CATALOG', '/catalog/');

define('DIR_FS_CATALOG', '/customers/4/b/1/bpdata.se/httpd.www/catalog/');

define('DIR_WS_IMAGES', 'images/');

define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/');

define('DIR_WS_CATALOG_IMAGES', DIR_WS_CATALOG . 'images/');

define('DIR_WS_INCLUDES', 'includes/');

define('DIR_WS_BOXES', DIR_WS_INCLUDES . 'boxes/');

define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . 'functions/');

11

Page 12: Backup and Restore of webshop Do It Yourself Guide, by ... · tell_a_friend.php Total Backup and Restore of a Webshop This method for making full backups, and total recovery can probably

Backup_and_Restore_of_Webshop_Do_It_Yourself_Guide_by_Bertil_Palmqvist_en.pdf

define('DIR_WS_CLASSES', DIR_WS_INCLUDES . 'classes/');

define('DIR_WS_MODULES', DIR_WS_INCLUDES . 'modules/');

define('DIR_WS_LANGUAGES', DIR_WS_INCLUDES . 'languages/');

define('DIR_WS_CATALOG_LANGUAGES', DIR_WS_CATALOG . 'includes/languages/');

define('DIR_FS_CATALOG_LANGUAGES', DIR_FS_CATALOG . 'includes/languages/');

define('DIR_FS_CATALOG_IMAGES', DIR_FS_CATALOG . 'images/');

define('DIR_FS_CATALOG_MODULES', DIR_FS_CATALOG . 'includes/modules/');

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

define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/');

define('DIR_FS_DOWNLOAD_PUBLIC', DIR_FS_CATALOG . 'pub/');

define('DB_SERVER', 'bpdata.se.mysql');

define('DB_SERVER_USERNAME', 'bpdata_se');

define('DB_SERVER_PASSWORD', 'xxxxxxxxxx');

define('DB_DATABASE', 'bpdata_se');

define('USE_PCONNECT', 'false');

define('STORE_SESSIONS', 'mysql');

define('CFG_TIME_ZONE', 'Europe/Stockholm');

?>

12