We use cookies to improve our services and provide a better experience. By continuing to use this site, you agree with our Cookies Policy.

Tutorials
More than 400 step-by-step articles to guide you through online project development.
HomeTutorialsCMS TutorialsosCommerceosCommerce Transfer

How to copy site to the new server

USA VPS
OpenVZ VPS
Ubuntu VPS
cPanel KVM
Germany Cloud Servers
Windows Cloud Server
Linux KVM Hosting
KVM VPS
Brazil VPS
Linux Cloud Server

Basically all it takes to copy osCommerce website to the new server is transferring website files, adjusting configuration and importing database to MySQL server. That’s the basic steps we should accomplish in order to have online commerce website hosted in the new server. Here we will go through the process from the beginning of transferring website to the new server.

Follow these steps to copy a site to a new server

Connect to the current server through FTP and download all related files to the local drive. If there is a backup feature supported by the control panel, it might be faster to create full backup in which all files and database will be included. Then download the backup to the local drive instead of downloading the files and database separately. If downloading everything separately, we should get the database as well.

Database can be obtained by opening MySQL interface through phpMyAdmin. Simply click on the database to list it’s tables and click on the “Export” tab at the top menu.

osCommerce database

In the next page select format in which the database will be exported. It should be enough to use SQL format for exporting.

Database export format

The next steps should be done in the new server. Connect to the new server control panel and add domain name which will be used for our online commerce website. By adding domain name we should get directory created for website files. Usually it’s named “public_html”. In some cases, depending on the control panel it may create FTP account as well which can be used for uploading files. Therefore, we can start uploading website files to the new server.

If uploading them file by file, it’s better to upload them directly to public_html. Otherwise, if uploading backup archive, we may need to extract the files and copy them to the public_html directory.

When it comes to re-creating the database, the best way is to create a new database and import SQL file from the old server. New database can be created in control panel MySQL management section. It’s important to save database details as they will be used in osCommerce configuration.

To import SQL file, login to phpMyAdmin by using newly created database details and go to “Import” section. There click “Browse…” and select SQL file from the old server. After then, click “Go” button to import the tables into the database.

Import Database

Then we will need to adjust osCommerce configuration files in order to match new location of osCommerce installation. Of course, this is needed only if the location will be different comparing with the old server. Mostly it depends on both servers configurations and what control panels they are running.

Firstly open file which is located in “includes/configure.php”. There we will need to adjust the following line. define('DIR_FS_CATALOG', '/home/username/domains/domain.com/public_html/');

Generally, we should get new username in the news server. However, if the domain name remains the same, username should be provided the same as well.

We should also take a look at the file located at “admin/includes/configure.php”. There we will find the following lines that might be required to edit. 

1
2
define(‘DIR_FS_ADMIN’,/home/username/domains/domain.com/public_html/admin/); 
define(‘DIR_FS_CATALOG’,/home/username/domains/domain.com/public_html/);

Replace the username in both lines if required and save the configuration.

Now we may try to check how website is looking in the new server. There are 2 ways for doing this: by using temporary URL or domain name. Temporary URL can be used if our domain name still haven’t propagated in the new server. In most cases, temporary URL looks like http://IP_Address/~username where “IP_Address” is the server IP address and “username” is our account ID. Once the domain name will be propagated, we can start using it in the new server as well.

This is how we can copy the website from the old server to the new one. If it’s looking exactly the same as it was working in the old server, we can assume it was transferred successfully. However, if any error occurs while trying to open websites frontend or backend, we might need to check server error logs or consult with hosting service customer support for possible solutions.

Linux KVM Hosting
Ubuntu VPS
USA VPS
OpenVZ VPS
Linux Cloud Server
Windows Cloud Server
KVM VPS
Brazil VPS
Germany Cloud Servers
cPanel KVM
Rate this Tutorial:
No Comments Leave a Comment
Leave a Comment

Other (192)

Popular Keywords