How to move a osCommerce site

When you move an osCommerce installation from one webserver to another it often isn’t possible to just move it and update your DNS-names, unless the conditions, like paths and database users etc are exactly the same. This is a step by step guide how to do it, and if you find something that I didn’t catch, please let me know (by the Contact in the menu).

Moving osCommerce 2.2 from one webserver to another

  1. Make a database dump on the source server using a tool like phpMyAdmin, or if you have shell access, by issuing this command:
    mysqldump -udbuser -pdbpassword oscommercedb > oscommercedb.sql

    Where dbuser and dbpassword is to be replaced by the username and password used to access the database. Theoscommercedb should be replaced by the real name of the database. These things can by found by examining/catalog/includes/configure.php.

  2. Copy the content of the entire /catalog folder by using for example FTP, from the source to the destination server, including the oscommercedb.sql file created in the previous step.
  3. Create a MySQL database on the destination server (if the server administrator hasn’t already done this for you) by using a tool like phpMyAdmin, or if you have shell access, by issuing this command:
    mysql -udbuser -pdbpassword
    create database oscommercedb;
    exit

    Where dbuser and dbpassword is to be replaced by the username and password used to access the database. The oscommercedb should be replaced by the real name of the database. Possibly you were provided these by your new webserver administrator.

  4. Now it is time to fill the database with the contents of your oscommercedb.sql file created in previous steps. This can be done by using a tool like phpMyAdmin, or if you have shell access, by issuing this command:
    mysql -udbuser -pdbuser oscommercedb < oscommercedb.sql

    Where dbuser and dbpassword is to be replaced by the username and password used to access the database. The oscommercedb should be replaced by the real name of the database.

  5. Edit the /catalog/includes/configure.php file and update it with the new values for your destination server. If you don’t have shell access, edit this file on your local computer and upload the edited file.

    Especially the following lines beginning with:
    define(‘DIR_FS_CATALOG’, ‘
    define(‘DB_SERVER’, ‘
    define(‘DB_SERVER_USERNAME’, ‘
    define(‘DB_SERVER_PASSWORD’, ‘
    define(‘DB_DATABASE’, ‘

    If the host- or domainname is changed by the server move, also update the lines beginning with:
    define(‘HTTP_SERVER’, ‘
    define(‘HTTPS_SERVER’, ‘
    define(‘HTTP_COOKIE_DOMAIN’, ‘
    define(‘HTTPS_COOKIE_DOMAIN’, ‘

  6. Edit the /catalog/admin/includes/configure.php file and update it with the new values for your destination server. If you don’t have shell access, edit this file on your local computer and upload the edited file.

    Especially the following lines beginning with:
    define(‘DIR_FS_DOCUMENT_ROOT’, ‘
    define(‘DIR_FS_ADMIN’, ‘
    define(‘DIR_FS_CATALOG’, ‘
    define(‘DB_SERVER’, ‘
    define(‘DB_SERVER_USERNAME’, ‘
    define(‘DB_SERVER_PASSWORD’, ‘
    define(‘DB_DATABASE’, ‘

    If the host- or domainname is changed by the server move, also update the lines beginning with:
    define(‘HTTP_SERVER’, ‘
    define(‘HTTP_CATALOG_SERVER’, ‘
    define(‘HTTPS_CATALOG_SERVER’, ‘

  7. Point your browser to the admin login on your new destination server, like http://domain/catalog/admin and log in as administrator. In Configuration -> Cache, update the path for the cache files (if you are using cache). If your shop moved from one domain to another you will probably also update email addresses under Configuration -> My store and possibly also do modifications to payments modules etc.’
  8. Test, test and test again to verify that everything is running as expected.
1 reply
  1. DLassar
    DLassar says:

    You may also check this online service, called Cart2Cart http://goo.gl/6maCW.
    It can transfer your products, customers and orders from one host to another one.
    You don’t need to have programming skills or hire an out source programmer.

    I hope you will like it.

    Good luck!

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *

twenty + 17 =