How Do I Configure Zen Cart to Work on a New Domain?

Here are the step by step directions to move your Zen cart to a new domain.

Firstly, you must physically move all of your Zen Cart files to the new location.

Secondly, load up phpMyAdmin, or similar, in the old account. Browse to your Zen Cart database, if you are not sure which one 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. Save the file on your PC, we will need it in a bit.

On the NEW hosting account create a new, empty SQL database. Make certain to create a new user and give that user full privileges for the database as well... Record the database name, database username and password for later.

Now open phpMyAdmin, on the new hosting account. Browse to the new database you just created and select import from the tabs. Select you SQL file you previously exported and check the box to continue if it times out. This will work for MOST databases. Really large database will need dropped in 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 small chunks of the syntax in the dump, paste them in the field and hit go... Until you have inserted them all.

In order to configure your Zen Cart to work properly with the new domain, you will need to modify the two configure.php files in includes/ and admin/includes/ folders to reflect the new domain.

It is very likely that you will need to make these files writable first. So in your file manager in control panel CHMOD these files each to 644.

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

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.

Very last step, 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 path)

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.

© 2003-2014 PRO-Webs, Inc. Woodbine, GA 31569-2051