Moving X-Cart to another location
page last edited on 01 March 2017
Imagine the situation that you have your X-Cart installed at
http://<HOST>/xcart/ but you want it be available at
This guide will help you to complete this task.
Table of Contents
File transfer and configuration
Make a backup of your files and database. You do need this step in case something goes wrong. Do not neglect this step because it can cost you hours of work contacting your hosting provider and asking them to recover your store from backup.
Transfer X-Cart files from the origin folder to the destination one.
If transferring from
http://<HOST>/xcart5/, you can move the folder by running this command on Linux/Mac:
cd ~/www/; mv xcart xcart5;
Don’t forget to reconfigure your server to have it serve the files from the destination directory under
[optional] if you need to transfer your X-Cart between servers or to create a dev copy of your store, create a new database on the destination server from the MySQL backup created at step 1.
[optional] if you need to create a new database, then define the database
passwordparameters in the
<X-Cart>/etc/config.phpfile of your destination installation. Such details are specified in the
[database_details]section of the
<X-Cart>/etc/config.phpfile, which looks similar to the following:
[database_details] hostspec = "localhost" socket = "" port = "" database = "database" username = "username" password = "password" table_prefix = "xc_"
Edit the file
<X-Cart>/etc/config.phpand define the new path to X-Cart installation in the
[host_details] http_host = "<HOST>" https_host = "<HOST>" web_dir = "/xcart"
You need to specify HTTP and HTTPS hosts. If you are transferring X-Cart within the bounds of one server, keep these values as they are.
web_dirparameter. To move X-Cart from
http://<HOST>/xcart5/, you should change its value from
If you are moving X-Cart to webroot:
http://<HOST>/, leave the field blank, without any slashes.
Edit the file
<X-Cart>/.htaccessand define the new path to X-Cart installation in the RewriteBase directive, for example:
Transfering the database
After moving all the files, you may want to transfer the data as well. You can achieve this by using the default RDBMS utilites, e.g. MySql source.
Also, you can upload the database dump from one X-Cart installation to another. Follow these steps:
First of all, make sure both X-Cart installations have the same set of modules installed and activated.
If the database dump file is larger than 2 MB, upload it to the
<new X-Cart>/var/backup/sqldump.sql.phpfile. Alternatively, a small dump can be uploaded during the next step.
Open the X-Cart admin > Tools > Restore database page and run the restoration process with one of the options.
After uploading the backup to the destination X-Cart’s database, you should copy the value of “shared_secret_key” from the source X-Cart’s etc/config.php file, and paste it to the destination X-Cart’s
etc/config.phpfile, for example:
shared_secret_key = "57c81e28ca9e12.95513295"
Help make this document better
This guide, as well as the rest of our docs, are open-source and available on GitHub.