Categories

Featured templates

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

Ray Taylor April 8, 2013
Rating: 5.0/5. From 6 votes.
Please wait...

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

OpenCart. 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. Install Database on NEW SERVER through PhpMyAdmin
  5. Update the configuration files config.php and admin/config.php to reflect your new domain path.

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 OpenCart 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 config.php file may re-write its permissions which will need to be corrected later.
You may need to correct permissions on other OpenCart files and folders as per the OpenCart installation guide.
Files and folders include; /config.php to 644 (444 on some servers) /admin/config.php to 644 (444 on some servers).

4) Install Database on NEW SERVER through PhpMyAdmin

Log onto your PhpMyAdmin and create a NEW DATABASE, this will be your new database for your OpenCart 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.

5) Change variables in 2 config.php files

In /config.php and admin/config.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 you are uploading the copied site to a Directory you need to specify this in the following files:

  • admin/config.php
  • /config.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.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<!--?php
// HTTP
define('HTTP_SERVER', 'http://yourdomainname.com/admin/');
 
// HTTPS
define('HTTPS_SERVER', 'http://yourdomainname.com/admin/');
// DIR
define('DIR_APPLICATION', '/home/user/public_html/admin/');
define('DIR_SYSTEM', '/home/user/public_html/system/');
define('DIR_DATABASE', '/home/user/public_html/system/database/');
define('DIR_LANGUAGE', '/home/user/public_html/admin/language/');
define('DIR_TEMPLATE', '/home/user/public_html/admin/view/template/');
define('DIR_CONFIG', '/home/user/public_html/system/config/');
define('DIR_IMAGE', '/home/user/public_html/image/');
define('DIR_CACHE', '/home/user/public_html/system/cache/');
define('DIR_DOWNLOAD', '/home/user/public_html/download/');
define('DIR_LOGS', '/home/user/public_html/system/logs/');
define('DIR_CATALOG', '/home/user/public_html/catalog/');
// DB
define('DB_DRIVER', 'mysql');
define('DB_HOSTNAME', 'localhost');
define('DB_USERNAME', 'database_username');
define('DB_PASSWORD', 'newpassword');
define('DB_DATABASE', 'database_name');
define('DB_PREFIX', 'oc_');</pre-->
<p>                        <strong>admin/config.php</strong></p>
<p class="info-box">Where ‘store’ is the new <span class="glossaryLink" data-cmtooltip="<strong>Directory</strong> is a <strong>subject guide organized by major topics and subtopics</strong>. The best-known directory is the one at Yahoo (http://www.yahoo.com). Many other sites now use a Yahoo-like directory including major portal sites.<br/>A 'Directory' is also <strong>a type of index where a person locates content through a formal classification system</strong>. A directory enables a person to move from a general to specific level of the classification system (and vice-versa).<br/>A directory of websites <strong>is typically grouped and(...)</strong> <strong></strong>" onclick="window.open('http://mpdh.cesametal.net/help/glossary/directory/', '_blank')">directory</span> name. Where ‘user’ is your server account address. Where ‘yourdomainname.com’ is the web <span class="glossaryLink" data-cmtooltip="<strong>Domain name</strong> is an identification of one or more IP addresses. On the Internet, a domain is a part of every network address. It is a unique name that you can see in the browser address bar.<br/>Internet domains are organized in levels. The most popular and widely used are .com,  .org, .net, .edu,  etc.<br/>A domain name can be maximum of sixty-three characters and minimum of one character and also ends with a suffix that indicates which top level domain it belongs to.<br/>Here are examples of top(...)</strong> <strong></strong>" onclick="window.open('http://mpdh.cesametal.net/help/glossary/domain/', '_blank')">domain</span> of your new <span class="glossaryLink" data-cmtooltip="<strong>A website</strong>  is a set of related web pages typically served from a single web domain. A website is hosted on at least one web server, accessible via a network such as the Internet or a private local area network through an Internet address known as a uniform resource locator (URL). All publicly accessible websites collectively constitute the World Wide Web.<br/>Some websites require a subscription to access some or all of their content. Examples of subscription websites include many business(...) <strong></strong>" onclick="window.open('http://mpdh.cesametal.net/help/glossary/website/', '_blank')">website</span>.</p>
<pre class="brush:php"><!--?php
// HTTP
define('HTTP_SERVER', 'http://yourdomainname.com/admin/');
define('HTTP_CATALOG', 'http://yourdomainname.com/');
// HTTPS
define('HTTPS_SERVER', 'http://yourdomainname.com/admin/');
define('HTTPS_CATALOG', 'http://yourdomainname.com/');
// DIR
define('DIR_APPLICATION', '/home/user/public_html/admin/');
define('DIR_SYSTEM', '/home/user/public_html/system/');
define('DIR_DATABASE', '/home/user/public_html/system/database/');
define('DIR_LANGUAGE', '/home/user/public_html/admin/language/');
define('DIR_TEMPLATE', '/home/user/public_html/admin/view/template/');
define('DIR_CONFIG', '/home/user/public_html/system/config/');
define('DIR_IMAGE', '/home/user/public_html/image/');
define('DIR_CACHE', '/home/user/public_html/system/cache/');
define('DIR_DOWNLOAD', '/home/user/public_html/download/');
define('DIR_LOGS', '/home/user/public_html/system/logs/');
define('DIR_CATALOG', '/home/user/public_html/catalog/');
 
// DB
define('DB_DRIVER', 'mysql');
define('DB_HOSTNAME', 'localhost');
define('DB_USERNAME', 'database_username');
define('DB_PASSWORD', 'newpassword');
define('DB_DATABASE', 'database_name');
define('DB_PREFIX', 'oc_');
</pre-->
<p>Go to your new site to see the result.</p>
<p>Feel free to check the detailed video tutorial below:</p>
<p><a href="http://www.youtube.com/watch?v=CsHwEY1mzYU?width=1280&height=720" rel="prettyPhoto" class="video-link">OpenCart. How to move your website from one domain to another</a></p>
<p></p>
<p></p>
<p></p>
<p></p>                     </pre>
OpenCart Themes
This entry was posted in OpenCart Tutorials and tagged another, domain, move, opencart, website. Bookmark the permalink.

Submit a ticket

If you are still unable to find a sufficient tutorial regarding your issue please use the following link to submit a request to our technical support team. We'll provide you with our help and assistance within next 24 hours: Submit a ticket