Step by step directions to move your Zen cart to a new domain or folder

By Melanie Prough on Thursday, June 18, 2009
Filed Under: Zen Cart Tutorials












How to move your Zen Cart installation

1. Your Zen Cart files must physically be moved to the new folder or hosting account location.

2. Load up phpMyAdmin, or similar SQL utility, in the old account. Browse to your current Zen Cart database, if you are not sure which database, find it here admin/includes/configure.php. Next, select the export tab, make sure all tables are selected. Tick the box which says “Add Drop Table” and tick the box to save it as a file… Then submit or go. Save the file on your PC, we will need it in just a bit.

3. On the NEW hosting account create a new, empty SQL database. Make certain to create a new database user and give that user full privileges for the database as well. Record the database name, database username and password for later. Use strong 10 character minimum alpha numeric passwords. This step is not required for moving your Zen Cart to a new folder in the same hosting account.

4. Now open phpMyAdmin, on the new hosting account. Browse to the new database you just created and select import from the tabbed menu. Select your SQL file (dump) you previously exported and check the box to continue if it times out. This will work for MOST databases. Really large databases will need added in smaller sections. To do this, open the SQL dump you made from the old site in a plain text editor and select the SQL tab in the new site’s phpMyAdmin. Now select sectioned (ending with 😉 small chunks of the syntax in the dump, paste them in the field and hit go… Until you have inserted them all. This step is not required for same account moves.

5. In order to configure your Zen Cart to work properly with the new domain or folder, you will need to modify the two configure.php files in includes/ and admin/includes/ folders to reflect the new path and database information (IF new hosting or domain).

6. It is very likely that you will need to make these files writable first. So in yourhosting control panel’s file manager in control panel CHMOD these files each to 644. You will not likely be able to make these writeable in FTP… Use file manager.

The settings that should be changed in includes/configure.php are:

If the account is the same you just change the path to be correct —- NO trailing slash for example http://newdomain.com/store for folders.

HTTP_SERVER – you should change this to your new domain name, e.g. http://newdomain.com:

define(’HTTP_SERVER’, ‘http://newdomain.com’);

HTTPS_SERVER – change this to:

define(’HTTPS_SERVER’, ‘https://newdomain.com’);

define(’DIR_FS_SQL_CACHE’, ‘/enter/your/path/to/public_html_or_htdocs/and/zencart/here/zen/cache’);

‘DIR_FS_SQL_CACHE – change this to:

define(’DIR_FS_SQL_CACHE’, ‘/enter/yourNEW_hosting_path’);

In admin/includes/configure.php you should modify:

HTTP_SERVER – you should change this to your new domain name, e.g. http://newdomain.com:

define(’HTTP_SERVER’, ‘http://newdomain.com’);

HTTP_CATALOG_SERVER – again, this should be changed to your new domain name:

define(’HTTP_CATALOG_SERVER’, ‘http://newdomain.com’);

You WILL need to use the www in ALL of the url settings if you choose to use the www in your urls.

define(’DIR_FS_SQL_CACHE’, ‘/enter/your/path/to/public_html_or_htdocs/and/zencart/here/zen/cache’);

‘DIR_FS_SQL_CACHE – change this to:

define(’DIR_FS_SQL_CACHE’, ‘/enter/yourNEW_hosting_path’);

If you are using SSL, you should also change (once your SSL is installed):

HTTPS_SERVER – change this to:

define(’HTTPS_SERVER’, ‘https://newdomain.com’);

HTTPS_CATALOG_SERVER – change this to:

define(’HTTPS_CATALOG_SERVER’, ‘https://newdomain.com’);

Lastly… In these files, near the bottom you will see your current database information. IF you created a new database, these must be updated as well. Be certain that the single quotes of each setting DB Password, DB and DB User are intact after editing.

6. Once you are up and running there are 2 settings to update in your Zen Cart admin….

Configuration >> Logging >> Log Destination (Update your path)
Configuration >> Sessions >> Session Directory (Update your patch)

7. VERY IMPORTANT SECURITY MATTER!!! Now that your Zen Cart is moved and running right go in to file manager once again and change these to files to CHMOD 444…

includes/configure.php and admin/includes/configure.php

NOTE:
If you experience any issues… or just for peace of mind, running this cache key fix is recommended.

Tags: , , , , , , , ,

Comments are closed.

Template Original