Just imagine that you have your X-Cart installed at http://<HOST>/xcart/, but you want it to be available at http://<HOST>/xcart5/ OR you need to transfer your X-Cart store from one server to another, i.e., you need to change HOST.
Both of the tasks will consist of the 2 main steps that are described below.
Files Transfer and Configuration
Make a backup of your files and database.
You do need this step in case something goes wrong. Please 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>/xcart/ to 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 http://<HOST>/xcart5/ domain.
[optional] if you need to transfer your X-Cart between servers or 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 host, name, user, and password parameters in the <X-Cart>/etc/config.php file of your destination installation. Such details are specified in the [database_details] section of the <X-Cart>/etc/config.php file, 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.php and define the new path to X-Cart installation in the [host_details] section:
[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.
Define the web_dir parameter. To move X-Cart from http://<HOST>/xcart/ to 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>/.htaccess and define the new path to X-Cart installation in the RewriteBase directive, for example:
Remove the <X-Cart>/var/datacache/ folder.
Database Transfer and Configuration
After moving all the files, you may want to transfer the data as well. You can achieve this by using the default RDBMS utilities, 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 addons installed and activated.
If the database dump file is larger than 2 MB, upload it to the <new X-Cart>/var/backup/sqldump.sql.php file. Alternatively, you can upload a small dump during the next step.
Open the X-Cart admin > Tools > Restore database page and run the restoration process.
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"