[contact-form-7 id="24078" title="Feedback EN"]

Featured templates

osCommerce. How to move your website from one domain to another

In this tutorial we will learn how to move your osCommerce website from one domain to another.

osCommerce. How to move your website from one domain to another

  1. Download ALL files from server.
  2. Create backup of Database through PhpMyAdmin.
  3. Upload files to NEW SERVER.
  4. Change variables in 2 configure.php files.
  5. Install Database on NEW SERVER through PhpMyAdmin.

1) Download ALL files from server

Connect to the old server and download all files for exact copies.

2) Create backup of Database through PhpMyAdmin

Log into PhpMyAdmin and export the store database, uncompressed to a location on your PC. Also log into the OSCommerce store admin area, click tools and create a backup of the database to also save to your PC. The database created through PhpMyAdmin will probably be called localhost.sql

3) Upload files to NEW SERVER

Log onto your new web server via ftp or Hosting Cpanel and upload all store files in binary. Note the includes/configure.php file may re-write its permissions which will need to be corrected later.
You may need to correct permissions on other osCommerce files and folders as per the osCommerce installation guide.

Files and folders include:

  • catalog/images to 777;
  • catalog/includes/configuration.php to 644 (444 on some servers);
  • catalog/admin/includes/configuration.php to 644 (444 on some servers);
  • catalog/admin/backups to 777 and catalog/admin/images/graphs to 777;

4) Change variables in 2 configure.php files

In includes/configure.php and admin/includes/configure.php you need to change some variables to make the store re-install work. Open these files in notepad, dreamweaver or your preferred html/code editing application.

If your store is going to be installed in the root on your new server you only need to edit a few values. These would include DB_DATABASE, DB_SERVER_PASSWORD, DB_DATABASE_USERNAME, DIR_FS_CATALOG, HTTPS_COOKIE_DOMAIN, HTTP_COOKIE_DOMAIN, HTTPS_SERVER, HTTP_SERVER.

If you want to install your osCommerce store into a DIRECTORY on your NEW SERVER and previously it was installed in the ROOT of your OLD SERVER then do the following.

If you are uploading the copied site to a Directory you need to specify this in the following files:

  • includes/configure.php;
  • admin/includes/configure.php;

Where ‘store’ is the new directory name. where ‘user’ is your server account address. where ‘yourdomainname.co.uk’ is the web domain of your new website.

<?php
                      define('HTTP_SERVER', 'http://yourdomainname.co.uk');
                      define('HTTPS_SERVER', 'http://yourdomainname.co.uk');
                      define('ENABLE_SSL', false);
                      define('HTTP_COOKIE_DOMAIN', 'yourdomainname.co.uk');
                      define('HTTPS_COOKIE_DOMAIN', 'yourdomainname.co.uk');
                      define('HTTP_COOKIE_PATH', '/store/');
                      define('HTTPS_COOKIE_PATH', '/store/');
                      define('DIR_WS_HTTP_CATALOG', '/store/');
                      define('DIR_WS_HTTPS_CATALOG', '/store/');
                      define('DIR_WS_IMAGES', 'images/');
                      define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/');
                      define('DIR_WS_INCLUDES', 'includes/');
                      define('DIR_WS_BOXES', DIR_WS_INCLUDES . 'boxes/');
                      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', '/home/user/public_html/store');
                      define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/');
                       define('DIR_FS_DOWNLOAD_PUBLIC', DIR_FS_CATALOG . 'pub/');
                      
                      define('DB_SERVER', 'localhost');
                      define('DB_SERVER_USERNAME', 'database_user');
                      define('DB_SERVER_PASSWORD', 'userpa33word');
                      define('DB_DATABASE', 'database_name');
                      define('USE_PCONNECT', 'false')
                      define('STORE_SESSIONS', 'mysql');
                      ?>

admin/includes/configure.php

Where ‘store’ is the new directory name. where ‘user’ is your server account address. where ‘yourdomainname.co.uk’ is the web domain of your new website.

<?php
                      define('HTTP_SERVER', 'http://yourdomainname.co.uk/store');
                      define('HTTP_CATALOG_SERVER', 'http://yourdomainname.co.uk');
                      define('HTTPS_CATALOG_SERVER', 'http://yourdomainname.co.uk/store/');
                      define('ENABLE_SSL_CATALOG', 'false');
                      define('DIR_FS_DOCUMENT_ROOT', '/home/user/public_html/store/');
                      define('DIR_WS_ADMIN', '/admin/');
                      define('DIR_FS_ADMIN', '/home/user/public_html/store/admin/');
                      define('DIR_WS_CATALOG', '/store/');
                      define('DIR_FS_CATALOG', '/home/user/public_html/store/');
                      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/');
                      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('DB_SERVER', 'localhost');
                      define('DB_SERVER_USERNAME', 'database_username');
                      define('DB_SERVER_PASSWORD', 'userpa33word');
                      define('DB_DATABASE', 'database_name');
                      define('USE_PCONNECT', 'false');
                      define('STORE_SESSIONS', 'mysql');
                      ?>

5) Install Database on NEW SERVER through PhpMyAdmin

Log onto your PhpMyAdmin and create a NEW DATABASE, this will be your new database for your osCommerce store, you can use the same name as your old database if possible as this will make things easier.

Assign a user to the database, again if you can use the same user as your old database it will keep things simpler.

Login to your PhpMyAdmin panel, select your New Database, click Import button, browse for exported previously xxxxxxxx.SQL file and click GO button.

Go to your new site to see the result.

Feel free to check the detailed video tutorial below:

osCommerce. How to move your website from one domain to another