Sie sind auf Seite 1von 35

Table of Contents

1 X-Cart:Summary Page.......................................................................................................................................................................................................1
1.1 About Summary page......................................................................................................................................................................................1
1.2 Auth code........................................................................................................................................................................................................1
1.3 License info.....................................................................................................................................................................................................1
1.4 General info.....................................................................................................................................................................................................1
1.5 Clean URLs info..............................................................................................................................................................................................2
1.6 Payment methods info.....................................................................................................................................................................................2
1.7 Environment info..............................................................................................................................................................................................2
1.8 Directories that need to have write permissions..............................................................................................................................................2

2 X-Cart:Advanced Tools.....................................................................................................................................................................................................3
2.1 Overview..........................................................................................................................................................................................................3
2.2 Generate Clean URL Values...........................................................................................................................................................................3
2.3 Remove Credit Card Information.....................................................................................................................................................................3
2.4 Change user authentication mode...................................................................................................................................................................4
2.5 Optimize Tables...............................................................................................................................................................................................4
2.6 Check Database Integrity................................................................................................................................................................................4
2.7 Force Cache Generation.................................................................................................................................................................................4
2.8 Rebuild category indexes................................................................................................................................................................................4
2.9 Clear Statistics.................................................................................................................................................................................................5
2.10 Clear Templates/X-Cart Cache.....................................................................................................................................................................5
2.11 Remove Temporary Files..............................................................................................................................................................................5
2.12 Re-generate the Image Cache......................................................................................................................................................................5
2.13 Re-generate the Blowfish Encryption Key.....................................................................................................................................................5
2.14 Remove Data.................................................................................................................................................................................................6

3 X-Cart:System Fingerprints..............................................................................................................................................................................................7
3.1 MD5 checksums..............................................................................................................................................................................................7
3.2 Generating system fingerprints........................................................................................................................................................................7
3.3 Deleting system fingerprints............................................................................................................................................................................8
3.4 Uploading system fingerprints.........................................................................................................................................................................8
3.5 Comparing system fingerprints........................................................................................................................................................................9

4 X-Cart:Cron.php - Script for Periodic Tasks.................................................................................................................................................................11


4.1 See also.........................................................................................................................................................................................................11

5 X-Cart:Logs......................................................................................................................................................................................................................12

6 X-Cart:Images Location Management...........................................................................................................................................................................14

7 X-Cart:Applying Patches.................................................................................................................................................................................................17
7.1 Overview........................................................................................................................................................................................................17
7.2 Applying File Patches....................................................................................................................................................................................17
7.3 Applying SQL Patches...................................................................................................................................................................................19

8 X-Cart:Backup and Restore............................................................................................................................................................................................20


8.1 Overview........................................................................................................................................................................................................20
8.2 Backing up the Store.....................................................................................................................................................................................20
8.3 Restoring the Store from a Backup...............................................................................................................................................................23
8.4 Safety Tips.....................................................................................................................................................................................................25
8.5 Troubleshooting.............................................................................................................................................................................................26
8.6 Automatic backups with X-CloudBackup.......................................................................................................................................................26

9 X-Cart:Upgrading.............................................................................................................................................................................................................27
9.1 General information on upgrading.................................................................................................................................................................27
9.2 Upgrading to X-Cart 4.5.x step by step.........................................................................................................................................................29

10 X-Cart:Moving store to another host...........................................................................................................................................................................31


10.1 Note on moving stores based on X-Cart 4.5.5 or later................................................................................................................................32

11 X-Cart:Moving store to web-root directory..................................................................................................................................................................33

i
1 X-Cart:Summary Page

1.1 About Summary page


X-Cart provides a page with a summary of information about the store - the so-called Summary page. You can use this page to learn about the current
state of your store and to find out whether there are any inconsistencies in the store configuration. Depending on your access level, you may be able to
view the following information:

The store's Auth code;


License info;
General info;
Payment methods info;
Environment info.

Note: All the above sections are available to X-Cart GOLD/GOLD PLUS users with administrator/provider privileges and X-Cart PLATINUM/PRO
administrators. X-Cart PLATINUM/PRO providers can view only some of the General info.
If you are an X-Cart GOLD or GOLD PLUS administrator/provider or an X-Cart PLATINUM or PRO administrator:

In X-Cart versions 4.4.0 and later, the Summary page can be found at Tools menu -> Summary.
In earlier X-Cart versions, the Summary page can be found at Administration menu -> Summary.

If you are an X-Cart PLATINUM or PRO provider:

In X-Cart versions 4.4.0 and later, the Summary page can be found at Tools menu -> Summary.
In earlier X-Cart versions, the Summary page can be found at Inventory menu -> Summary.

Information about each of the sections on the Summary page is available below.

1.2 Auth code


The top section of the Summary page provides your store's Auth code. It is a key code used to prevent unauthorized access to X-Cart's installation
script install.php. When you re-install X-Cart, install an add-on or change your store's skin set, X-Cart requires you enter this code.

1.3 License info


This section includes X-Cart's copyright information and provides two links:

a link to the text of X-Cart's License Agreement,


a link that you can use to verify your X-Cart license status.

1.4 General info


This section tells you the following:

Single Store mode status (enabled or disabled)

This entry is displayed only in X-Cart PLATINUM and PRO. It shows whether Single Store mode is enabled.

Note: More info on Single Store mode is available in the section Configuration file config.php.

Your store's open/closed status

This entry shows whether your store is currently open to visitors or closed.

Note: Your store's open/closed status can be controlled using the option 'Check this to close your shop temporarily' in X-Cart's 'General settings/General
options' section. For details, see the description of the option 'Check this to close your shop temporarily' in the section General Options.

Date of your store's latest database backup

If your store's database has ever been backed up using X-Cart's 'DB backup/restore' page, this entry displays the date when the backup was
performed. The link 'click here to backup >>' displayed in this section allows you to go to the 'DB backup/restore' page.

Information on the number of products with a zero price

This entry tells you how many of your products have a zero price. The link 'click here to check >>' allows you to view the list of products that
have been detected to have a zero price.

1
Note: By products with a zero price X-Cart means only regular, non-configurable products whose base price OR the price of the default product variant
is defined as 0 (zero). Regular products that have a non-default variant with a zero price and configurable products are not counted as products with a
zero price.

Orders info

This subsection provides a table with information about orders. In this table, you can see the number of processed, failed/declined, not
finished and queued orders for specific periods (Since last login / Today / This week / This month).

Shipping methods info

This subsection tells you the total number of enabled shipping methods and provides a table displaying the number of enabled shipping
methods per carrier.

Shipping rates info

This subsection tells you the total number of defined shipping rates and provides a table displaying the number of defined shipping rates per
carrier. It also tells you the status of real-time shipping rates calculation (enabled or disabled).

1.5 Clean URLs info


This subsection provides information about missing clean URLs. It tells you the overall number of products, categories, manufacturers and embedded
static pages in your store and tells you, how many objects of each type do not have a clean URL value. If your store has any objects for which clean
URL values are missing, you can use X-Cart's 'Generate clean URL values' tool to generate the missing clean URL values. The 'Generate clean URL
values' tool is available in the 'Summary/Tools' section of the store's Admin area (See the section Generate Clean URL Values).

1.6 Payment methods info


This subsection tells you whether the payment methods enabled at your store can be used on your system.

1.7 Environment info


This subsection provides information about your store's environment.

1.8 Directories that need to have write permissions


This subsection tells you the status of directories that must have write permissions.

2
2 X-Cart:Advanced Tools

2.1 Overview
X-Cart provides tools that allow you to perform a variety of advanced tasks:

Generate clean URL values for the object that do not have clean URL values defined.
Remove credit card information from processed and completed orders.
Optimize database tables to increase your store's overall performance.
Check database integrity.
Force (re)generation of cache files and quick tables.
Clear statistics.
Clear templates/X-Cart cache.
Remove temporary files.
Re-generate cache for resized images.
Re-generate Blowfish encryption key.
Remove unnecessary store data.

X-Cart 4.4or above


These tools are available in the 'Maintenance' section of your store's Admin area, which can be accessed via the 'Tools' menu.

Note: In the older versions of X-Cart, these tools are available via the 'Summary/Tools' section of your store's Admin area, which can be accessed by
clicking Summary and then clicking 'Tools' in your store's Admin area.
Important: To avoid loss of important data, make sure you clearly understand what you are doing before you use any of X-Cart's advanced tools.

2.2 Generate Clean URL Values


This tool automatically generates clean URL values for the products, categories, manufacturers and static pages that do not have clean URL values
defined. This tool is available only when the option 'Enable Clean URLs' in the 'General settings/SEO options' section is enabled.

To generate clean URL values using this tool, do the following:

1. Specify the types of objects for which you wish clean URL values to be generated by selecting the respective check boxes:

2. Click the Submit button.

When you click Submit, X-Cart generates URL values for all the objects of the selected type(s) that do not have clean URL values defined. A message
is displayed confirming that the clean URL values have been generated successfully.

2.3 Remove Credit Card Information


This tool is intended for the removal of credit card information from the store's database. Note that since version 4.5.0 X-Cart does not store credit card
information to enable PCI DSS compliance. In X-Cart versions 4.5.0 and later the 'Remove credit card information' tool is preserved to enable those
X-Cart store owners who upgraded from earlier X-Cart versions that used to keep CC data in order details (xcart_orders table => details field) to strip out
all credit card info from their database in order to meet PCI DSS requirements.

To use the 'Remove credit card information' tool, select the necessary options and click the Apply button:

3
Note that the option "Remove from customers' profiles" has been removed since X-Cart version 4.5.0; the option "Save the last 4 digits of credit card
numbers in order details" is to be removed in X-Cart 4.5.x.

Be careful when removing credit card information as this operation is irreversible.

Note: If you remove credit card information from orders, you will not be able to perform Capture or Void transactions for Pre-Authorized orders created
using NetRegistry or LinkPoint payment modules.

2.4 Change user authentication mode


X-Cart 4.4or above
This tool allows you to switch your store's authentication mode. Two authentication modes are available:

'Email as login': In this mode, registered users log in using the email address specified at the time of registration of their user profile.
'Username as login': In this mode, registered users log in using a unique user name that differs from their email address. The user name is
defined during user profile registration and, depending on the 'Allow users to change their usernames' setting in 'General settings/General',
may or may not be changed by the user at a later time.

Note: If you choose to switch to the 'Username as login' authentication mode after using the 'Email as login' authentication mode for some time, your
store's existing users whose profiles were set up while user names were not required will still be able to log in using their emails.

2.5 Optimize Tables


This tool allows you to optimize the structure of data stored in your MySQL database by reindexing the database tables. It is the right tool to use after
any UPDATE, INSERT or DELETE activity performed bypassing X-Cart interface which you think might cause your indexes to become less well
organized. Data and indexes becoming fragmented not only result in inefficient use of space, but cause SELECT queries used for data retrieval take
longer to complete, which considerably slows down your shopping cart application. Table optimization should help you improve the overall performance
of your store.

2.6 Check Database Integrity


This tool allows you to improve the consistency and quality of data structures in your store's MySQL database. The database used by your store is
designed in such a way that your data is stored there in multiple tables. The way X-Cart shopping cart application works requires that in some cases the
data from two or more tables should be combined. In such cases MySQL binds the data together across tables. For example, product titles are stored in
one table, product prices - in another one; as each product in the store is supposed to have a price, MySQL associates each of the product title fields in
the former table with a price field in the latter. If, while making alterations to your database tables, you fail to consistently change all the related data (for
example, if you add a new product, but fail to add a price for that product), MySQL will not be able to join the respective tables and perform the selection
of data from them properly. Performing a database integrity check with X-Cart's 'Check database integrity' tool allows you to ensure that all the tables
required for the store's operation are present in the MySQL database used by the store and helps you to detect any flaws and inconsistencies that may
appear as a result of alterations to the database design caused by maintenance or new inclusions to the database structures performed bypassing
X-Cart interface.

2.7 Force Cache Generation


This tool allows you to force (re)generation of cache files and quick tables. In situations where X-Cart needs the same data set to be retrieved relatively
often, you can have this data set cached (saved in a cache file or a quick table) so that X-Cart can receive it from there rather than by having MySQL
select the necessary data by running the same queries on the same data set each time. Sparing MySQL the necessity of running through the data over
and over, cache files and quick tables considerably reduce the load on your MySQL server.

This functionality is most useful after an import procedure, or after the store administrator has modified the database or some files manually, or you
suspect that some data may have been calculated incorrectly due to an interrupted procedure.

2.8 Rebuild category indexes


This tool allows you to re-build category indexes, e.g. when you manually make any adjustments to categories on a MySQL level, using the utility
outside the X-Cart back-end (e.g mysql terminal, or 3rd party data feed etc).

4
2.9 Clear Statistics
This tool allows you to clear some or all of the types of statistical data gathered by your store since the store installation or the last statistics clearing,
whichever is the later. Clearing your store statistics permanently removes the respective data from the database, so please be careful while selecting
the type(s) of data to be removed.

Please be careful when clearing statistics, this operation is irreversible.

2.10 Clear Templates/X-Cart Cache


This tool allows you to remove precompiled Smarty templates ('var/templates_c' directory) and X-Cart cache ('var/cache' directory) and free some disk
space.

To use this tool, click the Clear button.

Alternatively, templates/X-Cart cache can be cleared by running the "cleanup.php" script in your browser. For example, if your store's address is
http://www.yoursite.com/xcart/, the command you should type in your web browser's address bar is as follows:

http://www.yoursite.com/xcart/cleanup.php

Starting with X-Cart version 4.5.5, to run the "cleanup.php" script you need to know your store's Auth code. For a store with the Auth code XXXXXXXX
located at http://www.yoursite.com/xcart/, the command that should be used for running the "cleanup.php" script would be

http://www.yoursite.com/xcart/cleanup.php?auth_code=XXXXXXXX

2.11 Remove Temporary Files


This tool allows you to remove temporary files from the <x-cart>/var/tmp directory and free some disk space.

To use this tool, click the Clear button.

Before cleaning the directory, be sure to temporarily close the store for maintenance. Otherwise, you may hamper the processes initiated by other users,
such as uploading files, using HTTPS modules to connect to payment gateways or real-time shipping rate calculators, etc.

Note: The directory may contain export, newsletter and other files created when generating system fingerprints, uploading files via the Admin area,
using HTTPS and PGP/GnuPG modules, etc. Make sure the directory contains no necessary information before cleaning it.

2.12 Re-generate the Image Cache


This tool allows you to re-generate the cache of resized images (for example, for detailed product images).

To re-generated the image cache, click the Regenerate button.

2.13 Re-generate the Blowfish Encryption Key


This tool allows you to generate a new Blowfish key and replace your current Blowfish key with it.

Your current Blowfish key is stored in the file config.php. To enable X-Cart to replace the current Blowfish key with a new one, you must set write
permissions on the file config.php. On Unix this can be accomplished by using the following command:

chmod 666 config.php

Before you use this tool, you must back up the config.php file and the database of your store. This is essential, because if the re-generation
procedure fails, you will not be able to log in to the store, and a lot of important information will be lost, including customer data and order details.

To use the tool, click the Regenerate button. After you click Regenerate, X-Cart generates a new Blowfish key and starts re-encrypting the data
encrypted with the old key using the new key (If your store also uses the Merchant key based encryption method, the data already encrypted using your
store's Merchant key is not affected - it remains safely encrypted using your Merchant key). While X-Cart is performing the re-encryption of data with the
new Blowfish key, you can see the progress on the screen. Please be patient and allow sufficient time for the procedure to complete.

Important: You must ensure that the re-encryption procedure runs uninterrupted up until the moment you see the message indicating its successful
completion. If you happen to lose the Internet connection, close the browser window or simply leave the page displaying the re-encryption process
before the routine is successfully completed, you will lose all the data that has not been re-encrypted with the new Blowfish key.

It is also highly recommended to have the mcrypt PHP-extention installed on your server. This extension helps to speed up the Blowfish data
encryption process, thus ensuring the re-encryption routine runs uninterrupted and completes successfully.

See also:

5
X-Cart:Config.php
X-Cart:Blowfish

2.14 Remove Data


This tool allows you to empty your store of any content data with which it might have been populated for testing purposes. Clicking the button removes
the settings related to products, categories, manufacturers, shipping rates etc. The tool can help you bring your X-Cart installation to a state where the
store will get rid of all unnecessary data, retaining the configuration settings defining how it should function.

6
3 X-Cart:System Fingerprints

3.1 MD5 checksums


X-Cart uses MD5 (Message-Digest algorithm 5) for data integrity control. It provides a tool which allows you to create lists of MD5 checksums of all the
files in X-Cart installation directory and to compare checksum lists generated at different periods of time to verify the integrity of X-Cart files.

In X-Cart, a list of MD5 checksums of all the files in the system is called a system fingerprint. The first system fingerprint in your store is generated
automatically at the time of X-Cart installation. This system fingerprint reflects the original unmodified state of the system. Later, you can get X-Cart to
generate more system fingerprints.

Any system fingerprint can be compared with the current state of the store or with any other fingerprint. Comparing fingerprints allows X-Cart to detect
any changes in /xcart directory. As a result of comparing fingerprints, you get a list of files which have been modified, added or lost (removed from the
system or renamed so they cannot be identified).

3.2 Generating system fingerprints


To have X-Cart generate a system fingerprint:

1. Sign in to your X-Cart admin area.

2. On the 'Tools' menu, select 'Maintenance'; then click on the 'See also' tab and then click on the 'System Fingerprints' link.

This opens the 'System fingerprints' page, where you can generate and further manage your system's fingerprints.

3. In the 'Generate system fingerprint' section of the 'System fingerprints' page, enter a description for the system fingerprint you are going to create.

7
4. Click the Generate button.

X-Cart should launch the generation of the fingerprint. The process may take as long as several minutes. As soon as the fingerprint gets generated, you
should see an Information box with a confirmation message.

The new fingerprint should be added to the list of available system fingerprints:

3.3 Deleting system fingerprints


System fingerprints which you no longer need can be deleted directly from the 'System fingerprints' section of X-Cart Admin area.

To delete a system fingerprint:

1. Sign in to your X-Cart admin area.

2. On the 'Tools' menu, select 'Maintenance'; then click on the 'See also' tab and then click on the 'System Fingerprints' link.

This opens the 'System fingerprints' page, where you can generate and further manage your system's fingerprints.

3. Select the DELETE check box by the system fingerprints to be deleted.

4. Click the Delete selected button at the end of the list.

This deletes the selected fingerprints and displays the respective confirmation message.

3.4 Uploading system fingerprints


X-Cart saves generated system fingerprints to the /xcart/var/log directory (a system fingerprint filename looks something like md5_1139908092log.php).
If you do not wish to permanently keep your system fingerprints on the server /xcart/var/log but would like to be able to use them in the future, you can
move your fingerprint files somewhere else; e.g., download them to your local computer. When you need to compare a downloaded system fingerprint
with the current state of your online store or to other system fingerprint, you will only need to upload the fingerprint to be compared back to the X-Cart
server and have it stored in the /xcart/var/log directory. This can be done directly from the 'System fingerprints' section of X-Cart Admin area.

To upload a system fingerprint to the directory /xcart/var/log:

1. Sign in to your X-Cart admin area.

2. On the 'Tools' menu, select 'Maintenance'; then click on the 'See also' tab and then click on the 'System Fingerprints' link.

This opens the 'System fingerprints' page, where you can generate and further manage your system's fingerprints.

3. Scroll down to the 'Upload system fingerprint' section of the 'System fingerprints' page.

8
4. In the 'System fingerprint description' field, enter a description for the system fingerprint to be uploaded.

5. Click the Browse button, select the system fingerprint file to be uploaded and then click the Upload button.

As soon as the uploaded fingerprint appears on the list of available fingerprints on the 'System fingerprints' page, you can use it as any other system
fingerprint stored on the server.

3.5 Comparing system fingerprints


At any moment, you can compare any existing system fingerprint with the current state of your store. If you have more than one system fingerprint, you
can also compare them with one another.

To compare fingerprints:

1. Sign in to your X-Cart admin area.

2. On the 'Tools' menu, select 'Maintenance'; then click on the 'In this section' tab click on the 'Compare system fingerprints' link.

This opens the 'System fingerprints' page, where you can any of the available system fingerprints.

Note: The 'Compare system fingerprints' page may be unavailable while you have less than two system fingerprints stored in the /xcart/var/log directory.
3. Choose whether you want to compare the current status with a system fingerprint or to compare two system fingerprints.

4. Use the 'System fingerprint' drop-down box(es) to select the system fingerprints to be compared.

5. Select the files to be displayed in the comparison results:

Templates only / PHP scripts only / All files;


Changed files / New files / Missing files / Unreadable files.

9
6. Click the Compare button.

X-Cart will now compare the selected fingerprints and display the results in the 'Comparison results' form on the same page.

10
4 X-Cart:Cron.php - Script for Periodic Tasks
X-Cart provides a script cron.php which you can use to launch execution of periodic tasks.

The tasks include:

Checking whether authorization has expired for any payment transactions in Pre-authorized status and setting the status of the
respective orders to Declined.
Checking whether authorization is going to expire for any payment transactions in Pre-authorized status and sending email
notifications thereof to the store's Orders department.
Note: You can define how many days in advance such notifications must be sent using the setting 'Number of days in advance that
you want a reminder to be sent to the Orders department email address about an order in Pre-authorized status for which the
authorization period is going to expire' in the 'General settings/General options' section.
Sending out survey invitations (when X-Survey add-on module is used).
Sending out abandoned cart reminder notifications (when Abandoned Cart Reminder add-on module is used in automated mode).

You can choose to launch the script cron.php from the command line or to set up X-Cart to launch this script automatically. Launching cron.php from the
command line gives you a bit more control: you can decide exactly when you wish the script to be launched. Allowing X-Cart to launch this script
automatically saves you time and effort: X-Cart will launch the script once per a predetermined number of user sessions.

If you choose to launch the script from the command line, you will need to adjust the setting 'Key for launch of the cron.php script' field in the 'General
Settings/General options' section.

If you decide to set up X-Cart to launch cron.php automatically, you will need to adjust the setting 'Run the script that launches execution of periodic
tasks once per N user sessions' in the 'General Settings/General options' section.

Example of command line to launch the cron.php script:

cd /var/www/vhosts/yoursite.com/httpdocs/xcart; /usr/bin/php -d safe_mode=Off cron.php --key=c901d65fc15ff15d0ac0af967437d051

Note: You need to run cron.php using the so called "CLI" version of PHP. Ask your hosting administrator to tell you the location of PHP CLI on your
server and configure cron to run the cron.php script using PHP CLI version.

4.1 See also


General Settings->General Options
Abandoned Cart Reminder module
Survey module
Orders

11
5 X-Cart:Logs
X-Cart logs are stored in the /xcart/var/log directory. The 'Logs' section of your X-Cart store's Admin area allows you to view and manage X-Cart logs via
your store's interface.

X-Cart 4.4or above


To access the 'Logs' section:

1. Login to the Admin area of your X-Cart store.

2. Select Tools -> Maintenance on the menu.

3. On the Maintenance page, click on the See also tab and then click on the Logs link on the tab that appears.

In the 'Logs' section, you can see a dialog box titled 'View shop logs':

You can use this form to view and manage your X-Cart store's logs.

To view logs for a specific period:

12
1. Select the period you want to view log records for.

You can select one of the preset options (All dates, This month, This week, Today) or specify an exact period (Select 'Specify the period below' and then
enter the desired period in the 'Log date from' and 'Log date through' fields).

2. Select the types of log records to be shown (select the respective check boxes).

3. In the View N latest records field, specify how many records from each selected log you want to see. For example, setting this parameter to "5"
displays five most recent records from each of the logs you have selected. To view all the records, set this parameter to "0" (zero).

4. Click the Search button.

Clicking the Search button opens the selected log records in the 'Search results' section below.

To clear logs for a specific period:

1. Select the period you to clear log records for.

You can select one of the preset options (All dates, This month, This week, Today) or specify an exact period (Select 'Specify the period below' and then
enter the desired period in the 'Log date from' and 'Log date through' fields).

2. Select the types of log records to be cleared (select the respective check boxes).

3. Click the Clean selected logs button.

Clicking the Clean selected logs button empties the selected log files.

13
6 X-Cart:Images Location Management
Images used in your online store can be stored either in the database or on the file system. The Images Location page of your store's back end allows
you to manage the location of your images. In X-Cart versions 4.4.0 and later, this page can be found at Settings menu -> Images location; in earlier
X-Cart versions, this page can be found at Administration menu -> Images location.

The 'Images Location' page typically includes the following sections:

'Product thumbnails',
'Product images',
'Category icons',
'Language icons'.

Certain X-Cart modules and add-ons create additional sections on this page, for example:

Manufacturers - 'Manufacturer logos',


Affiliate - 'Affiliate graphic banners' and 'Library items for Affiliate media-rich banners',
Banner System - 'Banner System images',
Product options - 'Variant images',
Feature comparison - 'Product class images'
SpecialOffers - 'Special offer images',
Detailed product images - 'Detailed images'.

The named sections allow you to control the respective types of images.

14
Store images in: select whether you want to store a certain category of images in the database or on the file system. To speed up your store,
ensure that your images are in the file system, not in the database.

When you choose to store image in the file system, all images are stored in the /images directory. Each type of images (product images,
thumbnails, category icons, etc.) is stored in a separate subdirectory in the /images directory (called T, D, etc. - according to the type of
images). Make sure you do not rename the /images directory and its subdirectories, because otherwise X-Cart will not be able to see the
images. Also do not move your images to other directories.

Upload all remote images to the selected image repository (database or file system): select this option to save all the images that are not
stored on your server to the specified location - file system or database.
Enable digital signature (MD5) verification: select this option to compare the digital signature, which is stored in the database with the digital
signature of the file itself. If the signatures are not the same, the images will not be displayed.

Note: If you select this option, keep in mind that in this case you will not be able to replace your images by simply uploading other ones via FTP, as the
digital signature of the new image will not match the one stored in the database for this image.

File size limit (bytes): limit the size of the image files to be used. '0' means the file size is not limited.

15
Default image: enter the path to the image to be used if no other image is specified.

16
7 X-Cart:Applying Patches

7.1 Overview
X-Cart provides an interface that allows you to apply patches. The two types of patches that you might need to apply in X-Cart are file patches and
SQL patches.

IMPORTANT! It is recommended to make a backup copy of all PHP scripts, templates and create a database dump before applying any patches.
Please use Patch/Upgrade function ONLY if you absolutely understand what you are doing.

7.2 Applying File Patches


The 'Patch/Upgrade center' section of X-Cart allows you to apply file patches supplied by X-Cart developers using the Admin area of your store. A patch
can be applied from a patch file or from a URL.

Applying the patch can be done in several ways: via X-Cart Admin area, by issuing the command 'patch' or manually.

7.2.1 To apply a patch via X-Cart Admin area

1. BACK UP YOUR STORE!

2. Set write permissions for the files that will be patched.

3. Save the text of your patch to a file (e.g. patch.diff). If you are planning to use a patch from a certain URL, skip this step.

4. Sign in to the Admin area of your X-Cart and go to the 'Patch/Upgrade' section. You see the 'Apply patch' form:

5. In the 'Apply patch' form select your file by clicking on the Browse button. Alternatively, you can enter the patch URL into the appropriate field.

If you are going to apply a new patch, 'Reverse' selectbox should be set to 'No'. Selecting 'Yes' will lead to the removal of the specified patch that has
already been applied.

To start applying the patch click the Apply button.

The procedure of patch application includes two basic steps:

1. Testing patch applicability (Step 1 of 2). First X-Cart will check the presence of executable permissions for the patch tool, then patch checksums
and permissions for each file the patch must be applied to. Then the results of patch applicability testing will be shown to you in the 'Applying patch'
form.

If your Patch/Upgrade center detects any problems (errors - marked in red), you will not be able to proceed with applying your patch until these
problems are resolved. You will have to go back, make the necessary corrections and run the patch applicability test once again.

2. Applying the patch (Step 2 of 2). Clicking the Apply patch button initiates the process of applying the patch. During this process the differences
contained in the *.diff files are implemented in the source code of your X-Cart.

The process of upgrade patch application is shown on the screen:

17
Patch results show what files the patch was successfully applied to, and what files failed to be patched. You can see patch log for details.

The following problems may arise:

checksum error - patch contents is corrupted;


non-writable - writable permission has not been given to the file, please give it writable permission;
not a file - the target is not a file;
not exists - the necessary file is missing;
could not patch - the patch cannot be applied to this file automatically, because it has been significantly modified, the patch should be
applied to this file manually, as described here.

When the patch has been successfully applied, click Finish to get back to the 'Patch/Upgrade center' page.

Note: Do not forget to change permissions for the patched files. Instructions for changing file permissions:

If you are using a UNIX server


If you are using a Windows server

7.2.2 To apply a patch by issuing the command 'patch'

1. Save the text of your patch to a file (e.g. patch.diff).


2. Copy this file (patch.diff) to the directory where X-Cart is installed.
3. Issue the command 'patch --dry-run -p1 < patch.diff' to check the patch applicability.
4. If there are no errors during the check-up, apply the patch by issuing the command 'patch -p1 < patch.diff'.

You can read more about 'patch' command in the manual (man patch, info patch).

If the text of the patch contains header lines like "Index: include/func/func.category.php", use -p0 option in the commands, i.e. 'patch --dry-run -p0 <
patch.diff' and 'patch -p0 < patch.diff'.
See also: How to apply patches manually.

18
7.2.3 To apply a patch manually

If a patch application failed in the first two ways (this may be caused by redundant spaces or conversion problems) you can try to apply the patch
manually.

If you cannot apply the patch in these ways it means the file that needs to be patched has been modified or this file is from another version of X-Cart and
cannot be patched by this patch. Ask technical support to help you.

7.3 Applying SQL Patches


The 'Patch/Upgrade center' section of X-Cart allows you to apply SQL patches to your database using the Admin area of your store.

To apply an SQL patch:

1. BACK UP YOUR STORE!

2. Save the text of your patch to a file. If you are planning to use a patch from a certain URL, or already have such file, skip this step.

3. Sign in to the Admin area of your X-Cart and go to the 'Patch/Upgrade' section. Scroll down to the 'Apply SQL patch' form.

4. In the 'Apply SQL patch' form select your file by clicking the Browse button. Alternatively, you can enter the patch URL or enter SQL query(ies). To
start applying the patch, click the Apply button.

5. The text of the patch will be shown to you in the 'Patch text' field.

Click on Apply patch to continue.

6. The results of patching your database will be shown to you.

If no errors occurred, click Finish.

19
8 X-Cart:Backup and Restore

8.1 Overview
Backup generally refers to making a copy of a store, which can then be restored fast and easily, if need be. Backups can be perfromed either manually
as described in this article below or by using backup automation tools such as X-CloudBackup. Regular data backup will help you prevent serious data
loss and corruption that can follow a disaster or mishandling of your store. The rule here is to create a full backup copy of the store at regular intervals
and before carrying out any tasks that may interfere with the software code and behavior, including software and hardware upgrades, custom
programming, adjusting the store design, etc. At that, you should not rely on your hosting provider only, who is likely to include regular data backup into
their hosting plan: In case of emergency, data cannot always be restored immediately while any possible delay can seriously affect your business.
Another typical example of when you may need to back up your store is moving/copying the store to another host or directory. In such a situation, if a
backup is available, you will be able to deploy a fully functioning copy of the store in a new location quickly.

When you create a backup copy of a store you need to carry out a number of typical steps and procedures, which include making a database dump and
creating an archive with the X-Cart code, templates and related files (images, static pages, the HTML catalog, files in the folder file/, etc.). In fact, X-Cart
does not impose any restrictions on what tools you use to create a backup copy of your store - you can use any convenient facility, including SSH, FTP,
phpMyAdmin, Remote Desktop, utilities that go with your hosting control panel and other available facilities. The exact set may vary depending on the
operating system you use.

When you restore the store from a backup copy, it is supposed that you use the same tools and facilities to carry out inverse operations: restoring the
store files from the archive and restoring the database content from the MySQL dump. In case you are restoring the store to a different location, in
addition to this you will need to adjust some configuration settings.

For detailed instructions on how to handle store backups and carry out specific tasks, please refer to the following sections later in this chapter:

Backing up the Store


Restoring the Store from a Backup
Safety Tips
Troubleshooting

Remember that making a backup copy of a store and restoring the store from the backup are rather complicated tasks, which may become associated
with a series of difficulties or even involve unpredictable effects. This document only provides a general description of the backup and restore
procedures, and it does not intend to cover all types of situations that can occur while you back up or restore your store.

If you experience any difficulties in handling your store backups and you cannot find the answer in this document, you are welcome to address the
alternative sources and services.

8.2 Backing up the Store

8.2.1 Prerequisites

Before you start making a back up copy of your store, make sure of the following:

You have enough free disk space on your server or hosting account where your store is installed.

To estimate the minimal required amount of free disk space correctly, you can use the following formula: 2 kilobytes (kB) per each product in
the store database + size of the folder images/ + size of the folder files/ + 50 megabytes (MB).

For example, if your store database consists of 5000 products, the size of the folder images/ is 66.7MB and the size of the folder files/ is
35.77MB, then you need (2 kB * 5000)/1024 + 66.7MB + 35.77MB + 50MB = 9.76MB + 66.7MB + 35.77MB + 50MB = 162.23MB.

Note: If you do not have enough free disk space, try to remove the files that you do not longer use or move them to another location.

You can access your server or hosting account using one of these options: terminal SSH or Telnet access, FTP, remote desktop (available for
Windows-based servers only), your hosting control panel.

Note: If you cannot access your server or hosting account via these or other alternative options, address your hosting team for help.

The directory to which you are going to save the backup copy has writable permissions.

The Customer area of your store is temporarily closed for maintenance.

Having the Customer area closed ensures that none of your website visitors will be able to shop through your store and place orders while you are
backing up your store, and the backup will include all the info that is available by the moment you start this task.

To close the store for maintenance:

1. Log in to the Admin area.

2. Go to the General settings section.

20
3. In the General options box, select the Check this to close your shop temporarily check box. If necessary, enter a key for accessing the Customer
area into the Key for access to a temporarily closed shop field.

4. Click the Save button.

From here on, all your store visitors will be automatically redirected to a special page saying that the store is temporarily inaccessible and can be visited
later. To open the store back, log in to the Admin area and unselect the checkbox.

8.2.2 Backing up Store Database

With X-Cart the store administrator can back up the store database in a few easy steps directly from the Admin area. However, this way of backing up
the database may be unsuitable if, for example, X-Cart utilizes third-party add-on modules and custom code: new tables introduced by these modules
and code may be excluded from the SQL dump, which is generated automatically.

In such situations you must back up the database manually so that the dump includes all the store data. For this purpose you can use any adequate
facility, including different client implementations of the SSH protocol like OpenSSH or PuTTY, Telnet, phpMyAdmin, MySQL console, control panel of
your hosting account, Remote Desktop client and other. Later in this section you will find an example of how to create a database dump using terminal
access (SSH or Telnet) to the server or hosting account where X-Cart is installed.

8.2.2.1 Backing up the database through X-Cart Admin area

To back up the database through the X-Cart Admin area:

1. Log in to the Admin area.

2. Go to the Database Backup/Restore section (In X-Cart versions 4.4.0 and later, this section can be found at Tools menu -> DB backup/restore; in
earlier X-Cart versions, this section can be found at Administration menu -> DB backup/restore).

You will see the Database Backup/Restore box.

3. In the Backup database section of the box, click the Generate SQL file button. If necessary, additionally select the Write SQL dump to file
'<file_name>' check box;

21
By selecting the check box you tell X-Cart to save the SQL dump to the default file and location on the server file system (file xcartdump.sql in the
directory <xcart_dir>/var/tmp/). It is good to save the SQL dump to the server if it is going to be rather large and you want to ftp it to your local computer
or another location on the server later. If you leave the check box unselected, the SQL dump will be saved onto your local computer.

Important: If you do not have access to your server/hosting account through FTP, SSH or other suitable facility, do not select the check box and save
the SQL file directly to your local computer.

8.2.2.2 Backing up the database using terminal access

To back up the database using terminal access to the server:

1. Log in to your server or hosting account.

2. Go to the X-Cart root directory.

3. Run the following shell command.

> mysqldump -h<db_host> -u<username> -p<password> -r<backup_filename> <db_name>

The abbreviations in the command mean:

db_host :: The DNS name or the IP-address of your MySQL server.


username :: The username for your MySQL user account.
password :: The password for your MySQL user account.
backup_filename :: The name and the path to the newly created SQL file with the database dump.
db_name :: The name of the MySQL database that you use for X-Cart.
After you have run the command, the system will generate an SQL file and save it to the directory that you have specified in the <backup_filename> part
of the command. If you have specified the name of the file for the backup only without mentioning the path, the file will be saved be saved to the X-Cart
root directory, the directory where you are currently located.

If necessary, you can use a different path, but it is yet recommended that it be a location within the X-Cart root directory.

8.2.3 Backing up Store Files

Creating a backup copy of the store files presumes that you pack all the files in the X-Cart root directory into an archive and then copy or move the
archive to a new location on the remote server or your local computer.

Note: If you have previously saved the database dump into the predefined file in the X-Cart root directory (folder <xcart_dir>/var/tmp/), the file will also
be included into the archive.
To create an archive you need to use a file archive manager. The exact choice of the archive manager will depend on the operating system you use. On
a UNIX-based server, the most popular archive manager, which is currently installed on the majority of servers, is TAR. Later in this section you will find
an example of how to archive the X-Cart files with the TAR archive manager. On a Windows-based server, you can create the archive with one of the
available file archive managers for Windows, including WinRAR, WinZIP, PKZip and 7Zip. You need to pack the whole X-Cart root directory to an
archive and then save the archive to the directory that is parent to the X-Cart root directory.

Alternatively, if it is not possible to pack the X-Cart files into an archive directly on your server, you can copy the X-Cart root directory to your local
computer or another remote server using FTP or other suitable facility. Before that, make sure the new location, to which you are planning to copy the
X-Cart root directory, has enough free disk space. Besides, the control panel of your hosting provider may offer its own facilities for backing up your
account data.

8.2.3.1 Backing up store files with the TAR archive manager (UNIX-based servers only)

In UNIX-based systems, TAR is known to be one of the most reliable and trustworthy utilities for creating and manipulating file archives. It is now
commonly used in tandem with external compression utilities like GZIP, BZIP2 or LZMA, which enables you not only to create an archive, but also
compress the data in the archive. As a result, with TAR you can create a lightweight archive of your store and then restore it using the same utility. To
find out whether TAR is installed on your server, run the following shell command.

> tar --version

If TAR is installed on your server, the system will display a message with the version of the utility; otherwise you will see an error message. In case of
the latter, please contact your hosting team for help.

To back up files with the TAR archive manager:

1. Log in to your server or your hosting account.

2. Go to the X-Cart root directory.

3. In the X-Cart root directory run the following shell command.

> tar -czfv ../store_backup.tgz *

22
After you have run the command, TAR will pack all the files in the X-Cart root directory to the file store_backup.tgz and compress it with the ZIP data
compression algorithm. The file will be saved to the directory that is parent to the X-Cart root directory. For example, if the X-Cart root directory is
u/user/public_html/xcart, the file store_backup.tgz will be saved to directory u/user/public_html.

8.3 Restoring the Store from a Backup


Generally speaking, restoring a store from a backup copy is an inverse procedure to creating the backup copy, which is described in section #Backing
up the Store earlier in this manual. When restoring the store, you are expected to use the same tools that you used to create the backup copy. Similar to
creating the backup, restoring does not cause any serious difficulties, but it yet requires the standard sequence of operations: restore the store files and
then restore the database. One of the major rules to be observed is to restore data from the backup to a newly created directory within the WWW part of
your hosting account. You must keep with this rule no matter whether you simply copy/move the store to a new location or replace an existing
installation with the backup copy. After you have restored your store from the backup, you may need to adjust some configuration settings, including the
values of the variables in the main configuration file config.php, paths to images, file permissions, etc.

8.3.1 Prerequisites

Before you start restoring your store from a backup, make sure of the following:

You can access your server or hosting account using one of these options: terminal SSH or Telnet access, FTP, remote desktop (available for
Windows-based servers only), your hosting control panel.

Note: If you cannot access your server or hosting account via these or other alternative options, address your hosting team for help.

You have enough free disk space on the server where you are planning to restore your store. It is recommended that you have at least twice
as much free disk space as is taken by the backup copy (X-Cart files + SQL dump).
The directory to which you are planning to restore your store has writable permissions.

8.3.2 Restoring Files from Archive

The instructions below generally describe how to restore X-Cart files from a backup copy. Examples and notes are provided for UNIX- and
Windows-based servers. Many of the listed operations can be carried out through your server/hosting control panel (if any).

To restore X-Cart files:

1. Log in to your server or your hosting account.

2. Go to the directory that contains all your Internet projects (usually referred to as the WWW directory), and create a new directory where you will
deploy the store from the backup.

On a UNIX-based server, you can create the new directory using the following shell command.

> mkdir xcart

On a Windows-based server, you can create the new directory using the graphic user interface (GUI).

As a result, you should get an empty directory that is accessible through the Internet.

3. Go to the directory that you have just created and upload the X-Cart files (or the archive with X-Cart files) onto the directory using FTP, SCP, your
control panel or other suitable facility.

4. If you have the X-Cart files in an archive, extract them using the available utilities.

On a Unix-based server, you can extract files from the archive using the following shell command.

> tar -xfv <archive_name>

or

> tar ?xzfv <archive_name> # If the archive has file extension *.tar.gz, *.gz or *.zip

or

> tar ?xjfv <archive_name> # If the archive has file extension *.tbz.

On a Windows-based server, you can extract the archive with one of the available file archive managers for Windows, including WinRAR,
WinZIP, PKZip or 7Zip.

5. Check the X-Cart directory. It must contain the standard X-Cart file structure. If it only contains one directory with the X-Cart files, move its content to
the current directory.

6. If necessary, edit the main X-Cart configuration file config.php:

23
a) Locate the file config.php and open it for editing in your favorite plain text editor.

b) Set correct values for the following variables:

$sql_host =?%SQL_HOST%?; # The DNS name or the IP-address of your MySQL server
$sql_user =?%SQL_USER%?; # The username for your MySQL user account
$sql_db =?%SQL_DB%?; # The name of your MySQL database
$sql_password =?%SQL_PASSWORD%?; # The password for your MySQL user account

and

$xcart_http_host =?$HTTP_HOST?; # The host name of the server on which X-Cart is installed
$xcart_https_host =?$HTTP_HOST?; # The host name of the secure server which provides access to X-Cart via the HTTPS protocol
$xcart_web_dir =?/xcart?; # The web accessible directory of your server/hosting account where X-Cart files are located

For more info on how to edit these variable, refer to the X-Cart:Config.php page.

7. Create a new database for the store using a database management system (DBMS) that you usually use to manage your MySQL databases.

On a Unix-based server, you can create the new database using the following shell command.

> mysql -h<sql_host> -u<sql_user> -p -e"create database <sql_db>;?

If you connect to the database server through a non-typical port or socket, use the following command.

> mysql -P<sql_port> -h<sql_host> -u<sql_user> -p -e"create database <sql_db>;"

or

> mysql -S<sql_socket> -h<sql_host> -u<sql_user> -p -e"create database <sql_db>;"

The system will ask you to to enter your password for the MySQL account. After the password is accepted, the system will create a new
empty database for your store.

Important: The name/address of the MySQL server, the name of the MySQL database, the username and the password for the MySQL account must be
the same as the values of the respective variables in the X-Cart configuration file config.php.

8.3.3 Restoring Database from SQL Dump

When you restore a database from an SQL dump, the existing database tables get overwritten. We strongly recommend that you always back up the
current store database before restoring data from an SQL dump as it allows you to avoid any possible data loss. Another critical issue here is that you
can restore the database only if the SQL dump was created for the same X-Cart version.

The store administrator can restore the database either through the X-Cart Admin area or manually. If you decide to carry out this task manually, ensure
that you have access to the respective tools and facilities, including different client implementations of the SSH protocol like OpenSSH or PuTTY,
Telnet, phpMyAdmin, MySQL console, control panel of your hosting account, Remote Desktop client and other. In this case, the exact instructions on
how to restore the database from the backup will depend on the utility you use.

The example below describes how you can restore the database using terminal access (SSH or Telnet) to the server or hosting account where X-Cart is
installed.

8.3.3.1 Restoring the database through X-Cart Admin area

To restore the database through the X-Cart Admin area:

1. Log in to the Admin area.

2. Go to the section Database Backup/Restore (In X-Cart versions 4.4.0 and later, this section can be found at Tools menu -> DB backup/restore; in
earlier X-Cart versions, this section can be found at Administration menu -> DB backup/restore);

3. Restore the database from the SQL dump using the instructions below.

(PREFERRED WAY) If the SQL dump is saved in the predefined file located on the server file system (file xcartdump.sql in directory
<xcart_dir>/var/tmp/):

a) Click the Restore button.


b) Confirm the action.
c) Wait until the system displays a message saying that the database has been restored successfully.

If the SQL dump is saved on a local computer:

a) Click the Browse... button to display the dialog box for uploading files.
b) Select the file with the SQL dump.
c) Click the Restore from file button.

24
Wait until the system displays a message saying that the database has been restored successfully.

Note: If your SQL dump is saved on your local computer, you can restore the database through the Admin area only if the size of the SQL dump does
not exceed the value in line "WARNING! The maximum file size that can be uploaded:...". This value is defined by the PHP settings of your server. If you
have access to the PHP configuration file php.ini, you can increase/decrease the maximum file size by editing the value of the variable
$max_upload_size.
If changing the php.ini settings is not possible, you should rename your SQL dump to xcartdump.sql file, upload it to the directory <xcart_dir>/var/tmp/
(for example using FTP), then use the Restore button to restore the database from that file.

8.3.3.2 Restoring the database using terminal access

To restore the database using terminal access to the server:

1. Log in to your server or your hosting account.

2. Run the following shell command.

> mysql -h<sql_host> -u<sql_user> -p <sql_db> < <store_backup.sql>

If you connect to the database server through a non-typical port or socket, the command should be

mysql -P<sql_port> -h<sql_host> -u<sql_user> -p <sql_db> < <store_backup.sql>

or

mysql -S<sql_socket> -h<sql_host> -u<sql_user> -p <sql_db> < <store_backup.sql>

The system will ask you to to enter your password for the MySQL account. After the password has been accepted, the system will populate the
database with the data from the SQL dump.

Important: The name/address of the MySQL server, the name of the MySQL database, the username and the password for the MySQL account must be
the same as the values of the respective variables in the X-Cart configuration file config.php.

8.4 Safety Tips


Remove the SQL dump and the archive from the WWW directory of your server or hosting accoun. It is strongly recommended that you do not leave the
SQL dump of the store database and the packed archive with X-Cart files anywhere in the WWW directory of your server or hosting account where you
keep your Internet projects and which is publicly accessible. Otherwise, your store data can be easily stolen as anybody will be able to access the
database dump through the Web.

A good practice here is to keep the backup on a local computer or in a directory on a remote server that cannot be accessed through the Web. For
example, if the root directory of your hosting account is /u/user/ and the web directory is /u/user/public_html/, you must move the SQL dump and the
store archive from the directory /u/user/public_html/ to somewhere in the directory /u/user/.

If you backed up the database through the X-Cart Admin area, make sure you have not left the dump (file xcartdump.sql) in the directory
<xcart_dir>/var/tmp/, which is the pre-defined directory for the SQL dump generated by X-Cart.

25
8.5 Troubleshooting
Problem Possible cause Solution
User who has run the PHP
The system says you do not have Set writable permissions to the directory where you are trying to save the SQL
script is not allowed to write files
enough privileges to write to the file dump to, and repeat the task.
to the directory.
The system says you do not have Since some data has been saved to the file before the error message, first
File system does not have
enough free disk space to complete remove the file with the backup. Then either make available more free space and
enough free disk space.
the operation. repeat the task, or choose to save the file to another location.
Increase the amount of memory allocated to the script by increasing the default
value of the $memory_limit variable in the php.ini file. If you do not have access
Task was terminated and the
The memory that was allocated to the php.ini file, ask your hosting team to help you.
system says you will be redirected
to the script has exhausted
to the previous page.
Important: It may be necessary to increase the allocated memory several times,
because it is impossible to predict how much memory you really need.

8.6 Automatic backups with X-CloudBackup


Instead of creating backup archives manually you may want to consider using X-CloudBackup module to backup your data into a cloud storage
automatically on a schedule.

26
9 X-Cart:Upgrading
The X-Cart team regularly improves and updates the X-Cart shopping cart by releasing new software versions. With each new release, X-Cart gains a
series of fixes and advances that make the software even more powerful, efficient and secure. Some of these improvements only fine-tune the existing
X-Cart behavior, whereas other ones change it dramatically by introducing new features and opportunities, which involves considerable changes to the
software core, database structure and user interfaces. And it seems quite natural that at some point you may decide to upgrade your store to the latest
version to take advantage of the great new features.

Specially for those store owners who already use X-Cart and want to upgrade their stores, with the release of each new X-Cart software version we
release special upgrade packs which can be used to bring the advantages of the latest release to existing X-Cart copies of earlier versions. Both the
new releases and the upgrade packs are available for download to registered X-Cart license owners through their personal Help Desk accounts at
https://secure.qtmsoft.com.

The information below will hopefully give you a better understanding of X-Cart upgrades.

NEED HELP? Feel free to contact our support team via your personal Help Desk accounts should you require any help in upgrading your X-Cart store
to the latest version.

9.1 General information on upgrading

9.1.1 Understanding X-Cart upgrade procedure

In order to understand the X-Cart upgrade procedure, you should first have a look at the X-Cart version numbering scheme, which is determined by the
current software architecture. X-Cart uses a sequence-based software versioning scheme of three-sequence identifiers like 4.2.2 or 4.3.1. In the
sequence, the first two numbers mean the major X-Cart version, which is commonly referred to as the branch, and the third number means the minor
X-Cart version, which is the software version within the branch. The major version numbers are increased when there has been a significant revision of
the software functionality, behavior and template structure, whereas the minor version number is incremented when only minor features and significant
fixes have been added to the software, but the overall software structure and behavior have remained untouched. This stipulates two different
approaches to the upgrade depending on whether you upgrade to a later minor version within one branch or to a later major version (branch).

9.1.2 Upgrading to a later minor version

When you upgrade the store to a later minor version within one branch (for example, from X-Cart 4.2.1 to X-Cart 4.2.2), you can smoothly upgrade the
default software code, database and design. In order to upgrade the store, you will need to apply an upgrade pack - a set of patch files that will iron out
the differences between your copy of X-Cart and the X-Cart version to which you are upgrading. The packs are applied automatically through a special
section of the X-Cart Admin area.

Nonetheless, this task can become more complicated if you are upgrading the store within one of the earlier branches, like 3.5.x or 4.0.x, as there may
be no direct pack to upgrade from a given version of the store to the required version, and you will need to successively apply several upgrade packs
until you upgrade to the required version. For example, if the current version of your store is X-Cart 4.0.6, and you want to upgrade it to X-Cart 4.0.19,
which is the latest version within the 4.0.x branch, first you will need to upgrade from version 4.0.6 to 4.0.17, then from 4.0.17 to 4.0.18, and only after
that to version 4.0.19. Besides, you will need to re-install the skin template and the add-on modules, if you use any.

Important: Take note that if your store utilizes some custom code or has serious design changes, the files and database tables that were modified within
a custom development project will be skipped or updated partially, which is likely to damage the custom functionality and design, and even affect the
default X-Cart functionality. If you are not sure whether the custom functionality and design will remain intact after the upgrade, consult the X-Cart
Support team (see section Getting Help).

9.1.3 Upgrading to a later major version (branch)

When you upgrade your store to a later major version (e.g. from X-Cart 4.2.x to X-Cart 4.3.x), you can only upgrade the default store database. There
are no ready-made upgrade packs to be used on your X-Cart copy; instead, you need to install a fresh copy of X-Cart and point it to the upgraded
database. This approach is conditioned by the X-Cart architecture that changes significantly with each new major release leaving no technical feasibility
to upgrade the software code and design automatically.

In order to upgrade the database, you need to run a special script that will convert the data in the database so that it will be compatible with the X-Cart
version to which you are going to upgrade your store. For convenience, a particular database structure is referred to in accordance with the X-Cart
version that the database is compatible with. For example, database version 4.2.1 means that this database can be used with X-Cart version 4.2.1.

Unfortunately, the set of available upgrade scripts is rather limited, and there may not be an upgrade script that will convert your given database to the
version you require directly. In this case you will need to convert your store database several times until you get a database compatible with the desired
X-Cart version.

The table below provides a list of available direct database upgrades: the column on the left contains source database versions; the column on the right
shows direct database upgrades available for each particular source database version.

Source X-Cart DB Version Direct X-Cart DB Upgrades


X-Cart Branch 4.0.x
3.5.10
* 4.0.1

27
X-Cart Branch 4.0.x
3.5.12
* 4.0.6
X-Cart Branch 4.0.x
* 4.0.12
3.5.14 X-Cart Branch 4.1.x
* 4.1.11
* 4.1.12
X-Cart Branch 4.1.x
4.0.19 * 4.1.11
* 4.1.12
X-Cart Branch 4.2.x
4.1.11
* 4.2.0
X-Cart Branch 4.2.x
* 4.2.1
* 4.2.2
X-Cart Branch 4.3.x
4.1.12 * 4.3.0
X-Cart Branch 4.4.x
* 4.4.0
X-Cart Branch 4.5.x
* 4.5.0
X-Cart Branch 4.3.x
* 4.3.0
X-Cart Branch 4.4.x
4.2.3
* 4.4.0
X-Cart Branch 4.5.x
* 4.5.0
X-Cart Branch 4.4.x
* 4.4.0
4.3.2
X-Cart Branch 4.5.x
* 4.5.0
X-Cart Branch 4.5.x
4.4.5
* 4.5.0

In the situation when you have to upgrade the database several times successively, there may be more than one upgrade paths available. Please follow
these recommendations for choosing the optimal upgrade path:

Among the alternative upgrade paths involving an upgrade within a branch, choose the one in which the upgrade within a branch is carried out
on a more recent branch.

The upgrade engine improves with each new X-Cart release, and upgrading on a more recent branch keeps the risk of failure to a minimum.
For example, when you upgrade the database for X-Cart 4.1.11 to the database for X-Cart 4.2.2, the two alternative paths are as follows:

(A) 4.1.11 -> 4.2.0 -> 4.2.2


(B) 4.1.11 -> 4.1.12 -> 4.2.2

(A) is the recommended upgrade path, as the in-branch upgrade is carried out on a more recent X-Cart branch, 4.2.x.

When you need to skip a branch (e.g. from X-Cart 4.1.x to X-Cart 4.3.x), minimize the number of branch-to-branch upgrades.

28
With each branch-to-branch upgrade the data in the database is converted, which theoretically increases the possibility of a fault or data loss.
Thus, the fewer times you upgrade your database from branch to branch, the better. For example, when you upgrade the database for X-Cart
4.1.11 to the database for X-Cart 4.3.0, the two alternative paths are as follows:

(A) 4.1.11 -> 4.1.12 -> 4.3.0


(B) 4.1.11 -> 4.2.0 -> 4.3.0

(A) is the recommended path, as it involves only one branch-to-branch upgrade, whereas (B) involves two branch-to-branch upgrades.

Important: You must be aware that with the upgrade to a later major version it is impossible to transfer the custom code and design automatically. So if
you use any in your store, you will need to re-implement the custom code and design after the upgrade, which is rather a resource-consuming task that
requires adequate experience in PHP, HTML and MySQL.

9.1.4 Associated difficulties

New releases not only enrich the software with new features and capabilities, but they also get rid of outdated elements and techniques that are no
longer in great demand. If you have gotten used to the logics and behavior of your current X-Cart version, or if you extensively use the elements that are
not supported in later X-Cart releases, an upgrade may involve extra inconvenience. It is recommended that you study the CHANGELOG, which is
updated with each new release and is included into every distribution package. The CHANGELOG provides a complete list of fixes and improvements
that were introduced to the new X-Cart release.

Another critical issue with X-Cart upgrades is that seamless upgrade is only possible if the store uses a default database and template structure, and
has only minor changes like its own store logo and the like. Yet, if the store has serious design changes, or if it utilizes some custom code and
third-party add-on modules that interfere with the original software behavior, you will need to re-implement custom code and design after the
upgrade, which requires adequate experience in PHP, HTML and MySQL. So, if you use some custom functionality, find out if it is possible to keep it
after the upgrade.

On the whole, upgrading X-Cart is a resource-consuming task, which demands that you understand what you are going to do and why. The rule here is
not to upgrade to a newer version if you are satisfied with how the store works at the moment.

If you decide that your store needs to be upgraded, be honest when estimating your abilities: If you are not sure you have enough resources to perform
this task on your own, do not start it. Leave it to professional engineers, and it will save your time, money and nerves.

9.2 Upgrading to X-Cart 4.5.x step by step


The below upgrade instructions can be also used to upgrade X-Cart to the latest version of earlier branches like 4.4.x or 4.1.x, for example:

from 4.4.1 to 4.4.5


from 4.3.0 to 4.4.5
from 3.5.0 to 4.1.12

9.2.1 Upgrading from version 4.6.0 or later

If the version of X-Cart on which your current store is based is 4.6.0 or later, to upgrade your store to a newer minor version within the 4.6.x branch (for
example to version 4.6.1) you will need to follow the same steps as described in the below section "Upgrading from version 4.5.0 or later".

29
9.2.2 Upgrading from version 4.5.0 or later

If the version of X-Cart on which your current store is based is 4.5.0 or later, to upgrade your store to a newer minor version within the 4.5.x branch (for
example to version 4.5.5) you will need to follow these steps:

1. Consider the environment and make a development copy of your store. For details, see the chapter Before the upgrade.
2. Obtain an upgrade pack for the direct upgrade from your current version to the desired version. For details, see the chapter Obtaining
in-branch upgrade packs.
3. Apply the upgrade pack to your X-Cart installation. For details, see the chapter Applying Upgrade Packs.
4. Complete the required post-upgrade tasks. For details, see the chapter After the upgrade.

9.2.3 Upgrading from versions 3.5.x-4.4.x

If the version of X-Cart on which your current store is based is earlier than 4.5.0, the upgrade procedure is more complex. To upgrade your store to
4.5.x, you might need to go through a series of transitional upgrades. At least one of the upgrades will be a branch-to-branch upgrade, which means that
you will be able to upgrade your database, but X-Cart software will have to be installed from scratch from the 4.5.x distribution package. To upgrade
your store, follow these steps:

1. Consider the environment and make a development copy of your store. For details, see the chapter Before the upgrade.
2. Retrieve the value of the variable $blowfish_key from the file <xcart_dir>/config.php of your existing X-Cart installation and temporarily save it
somewhere on your local computer.
You will be asked to provide the Blowfish key later on to allow X-Cart to decrypt the data in the upgraded database.
3. Obtain the upgrade pack(s) needed to bring your store to one of the versions for which a direct database upgrade to 4.5.x is provided (4.1.12,
4.2.3, 4.3.2 or 4.4.5).
For instructions on obtaining upgrade packs, see Obtaining upgrade packs and database upgrade scripts.
4. Apply the upgrade pack(s) to your development X-Cart installation. For instructions, see Applying upgrade packs and database upgrade
scripts. As a result, the version of your store should now be one of the following: 4.1.12, 4.2.3, 4.3.2 or 4.4.5.
5. Back up your store's database.
6. Obtain a database upgrade script to bring your store's database from the current version (4.1.12, 4.2.3, 4.3.2 or 4.4.5) to 4.5.0. See Obtaining
database upgrade scripts.
7. Apply the database upgrade script. For instructions, see Applying database upgrade scripts. As a result, the structure of your store's
database should now correspond to that of X-Cart version 4.5.0.
8. Install a fresh copy of X-Cart 4.5.0 in a new (empty) folder using the upgraded database's credentials (MySQL database name, MySQL user
name and MySQL password) (see also X-Cart:Installation).
IMPORTANT: At the step 'Preparing to Install X-Cart Database' of the installation wizard, select the check box 'Update config.php only' and
enter the Blowfish key for the upgraded database (the one that was retrieved earlier at step 2).
9. Complete the required post-upgrade tasks. For details, see the chapter After the upgrade.

See also:

How do I know which version of X-Cart I use

30
10 X-Cart:Moving store to another host
To move your store from one host to another:

1.

X-Cart 4.0or above


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 area.
This step is necessary for 4.0.x and earlier versions only. See also: FAQs: How do I know which version of X-Cart I use?
2. Backup the entire directory with your X-Cart based store; that's either the document root directory or one of its subdirectories. It is also recommended
to delete the content of the 'templates_c' directory before creating the backup file.

For 4.0.x and earlier versions the 'templates_c' directory is located in the root X-Cart directory. For 4.1.x and later versions - it is located within the
'<xcart_dir>/var' directory. See also: FAQs: How do I know which version of X-Cart I use?
3. Backup the database. You can do that using either the 'DB backup/restore' feature (see the corresponding section of the admin interface) or a
MySQL terminal utility (like mysqldump or phpMyAdmin).

4. Upload the entire directory with your X-Cart based store to a web-accessible directory on the new server.

5. Edit the config.php file and adjust the settings related 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 related to the X-Cart HTTP & HTTPS host and web directory where it is to be moved:

$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. Set proper file permissions on your newly uploaded X-Cart files and directories. See Restoring File Permissions for more information.

8. Upload the database backup file to the MySQL database on the new host using a MySQL terminal. If you have SSH access to your host, you can
upload the database using the command-line interface:

mysql -u<user> -p<pass> -h<host> <database> < <backup file>

where <user> is the MYSQL database user name, <host> - the MYSQL host name (typically 'localhost'), <pass> - the password to your MYSQL
database, and <database> is the database name itself. <backup file> is the name of your database backup file.

If you don't have any terminal access (SSH, telnet or others), check the control panel at your hosting: it may contain PHP MYSQL admin or other
MYSQL tools.

31
9. Test the newly uploaded X-Cart based store.

10. Move the images from the database to the file system if necessary.

10.1 Note on moving stores based on X-Cart 4.5.5 or later


If moving a live X-Cart 4.5.5 or later store that used to run on PHP 5.3.x to a new hosting, make sure the version of PHP on the new hosting is the same
or better than on the hosting you are moving from. Downgrading to PHP 5.2.x is not recommended because under certain conditions it may result in
losing the passwords of your existing users.

32
11 X-Cart:Moving store to web-root directory
Here are general instructions on how to move your cart to the web-root directory:

X-Cart 4.0or earlier


1. If you are using X-Cart 4.0.19 or earlier, make sure your product and category images are stored in the database. If they are stored on the filesystem,
you should temporarily move them to the database. You can do this under the "Images location" section of the admin interface.

2. Move all files from the directory where X-Cart installed to the root web directory. You can do this using either FTP or (better) SSH access. File
permissions must be preserved during the copying, otherwise you will need to adjust the permissions manually.

3. Edit config.php file adjusting $xcart_web_dir parameter. If your cart was installed in the "store" directory, you should replace the following string:

$xcart_web_dir ="/store";

with this:

$xcart_web_dir ="";

X-Cart 4.2or above


4. If you are using X-Cart version 4.2-4.4 and you have enabled clean urls in your .htaccess file, find the following lines in the file:

# Clean URLs [[[


Options +FollowSymLinks -MultiViews -Indexes
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /xcart/
RewriteCond %{REQUEST_URI} !^/xcart/(payment|admin|provider|partner)/
RewriteCond %{REQUEST_FILENAME} !\.(gif|jpe?g|png|js|css|swf|php|ico)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^(.*)$ dispatcher.php [L]
</IfModule>
# /Clean URLs ]]]

and replace them with the following:

# Clean URLs [[[


Options +FollowSymLinks -MultiViews -Indexes
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} !^/(payment|admin|provider|partner)/
RewriteCond %{REQUEST_FILENAME} !\.(gif|jpe?g|png|js|css|swf|php|ico)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^(.*)$ dispatcher.php [L]
</IfModule>
# /Clean URLs ]]]

X-Cart 4.4or above


5. If you are using X-Cart 4.4.x and you have enabled CSS and JavaScript optimization tools in your .htaccess file, find the following lines in the file:

# Speed-Up JS and CSS [[[


Options +FollowSymLinks -MultiViews -Indexes
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /xcart/
RewriteRule loader_(.+).css loader.php?type=css&md5_suffix=$1 [L]
RewriteRule loader_(.+).js loader.php?type=js&md5_suffix=$1 [L]
</IfModule>
# /Speed-Up JS and CSS ]]]

and replace them with the following:

# Speed-Up JS and CSS [[[


Options +FollowSymLinks -MultiViews -Indexes
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule loader_(.+).css loader.php?type=css&md5_suffix=$1 [L]
RewriteRule loader_(.+).js loader.php?type=js&md5_suffix=$1 [L]
</IfModule>
# /Speed-Up JS and CSS ]]]

6. If you have enabled clean urls in your .htaccess file

# Clean URLs [[[


Options +FollowSymLinks -MultiViews -Indexes
<IfModule mod_rewrite.c>

33
RewriteEngine On
RewriteBase /store/
RewriteCond %{REQUEST_URI} !^/xcart/(payment|admin|provider|partner)/
RewriteCond %{REQUEST_FILENAME} !\.(gif|jpe?g|png|js|css|swf|php|ico)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^(.*)$ dispatcher.php [L]
</IfModule>
# /Clean URLs ]]]

you have to go in and change those as well

# Clean URLs [[[


Options +FollowSymLinks -MultiViews -Indexes
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} !^/(payment|admin|provider|partner)/
RewriteCond %{REQUEST_FILENAME} !\.(gif|jpe?g|png|js|css|swf|php|ico)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^(.*)$ dispatcher.php [L]
</IfModule>
# /Clean URLs ]]]

5. Check if X-Cart is working fine on the new location.

6. Move images from the database back to the filesystem if necessary.

34