X-Cart:Moving store to another host

From X-Cart 4 Classic
Revision as of 12:31, 7 January 2010 by Admin (talk | contribs)
Jump to: navigation, search

In order to move your store from one host to another, you should take the following actions:

1. If your images are stored on the file system, move them to the database. This can be done under the 'Images location' section of the admin interface.

Move2.gif'Images location' form


2. Backup the whole X-Cart directory. It is recommended to delete the content of the 'templates_c' directory before creating the backup file.

3. Backup the database. You can do it using either the 'DB backup/restore' feature (see the corresponding section of the admin interface) or a MySQL terminal utility (like mysqldump or phpMyAdmin).

Move1.gifDatabase Backup/Restore' form

4. Upload the whole X-Cart directory into the web directory on the new server.

5. Edit the config.php file and adjust the settings which relate to your MySQL database account on the new host:

#
# SQL database details
#

$sql_host ='%SQL_HOST%';
$sql_user ='%SQL_USER%';
$sql_db ='%SQL_DB%';
$sql_password ='%SQL_PASSWORD%';

6. Edit the config.php file and adjust the settings referred to the X-Cart HTTP & HTTPS host and web directory where it is to be installed:

$xcart_http_host ="$HTTP_HOST";
$xcart_https_host ="$HTTP_HOST";
$xcart_web_dir ="/xcart";

You should put hostname here only without http:// or https:// prefixes. Also do not put slashes after the hostname. Web dir is the directory in the URL, not the filesystem path. Web dir must start with slash and have no slash at the end, the only exception is when you configure for the root of the site, in which case you should leave it empty.

EXAMPLE 1:

$xcart_http_host ="www.yourhost.com";
$xcart_https_host ="www.securedirectories.com/yourhost.com";
$xcart_web_dir ="/xcart";

- will result in the following URLs:

http://www.yourhost.com/xcart https://www.securedirectories.com/yourhost.com/xcart

EXAMPLE 2:

$xcart_http_host ="www.yourhost.com";
$xcart_https_host ="www.yourhost.com";
$xcart_web_dir ="";

- will result in the following URLs:

http://www.yourhost.com/ https://www.yourhost.com/

You will find some additional explanations in the config.php file above the mentioned lines. If the URL to your store is not being changed, you should not edit these lines.

7. Change the current directory to the root X-Cart folder and adjust file permissions in the following way:

chmod -R 777 templates_c files log catalog skin1

I want to use www.mydomain.com/ instead of www.mydomain.com/xcart. How do I move my store?

If you want to move your site to root directory, you should move all the files from the directory where X-Cart is installed to root directory. After that you should find /config.php and replace the following string:

$xcart_web_dir ="/xcart";

by this:

$xcart_web_dir ="";

Do not forget to make backup copies of the original files from root directory which have names similar with the names of files from /xcart directory (for example, index.html), because they will be replaced when you move your store.

Note that if you store product and category images on the file system, you should correct links to images manually after moving your store.

If you want to change the location of php scripts used in customer, administrator and provider zones, you should open the file top.inc.php and edit the values of DIR_CUSTOMER, DIR_ADMIN and DIR_PROVIDER constants.