Zen Cart Logo
Forums / Upgrading to 1.5.x / Upgrade strategy ... (and server move)

Upgrade strategy ... (and server move)

Views: 5,382

Results 1 to 20 of 82
19 Dec 2014, 6:48 PM
#1
montello1984 avatar

montello1984

New Zenner

Join Date:
Dec 2014
Location:
United Kingdom
Posts:
49
Plugin Contributions:
0

Upgrade strategy ... (and server move)

Hi,

First post and I'm no high tech guy but I manage ...

I have a perfectly good working Zencart site here: http://www.petticrows.co.uk/catalog/index.php

This has been working 6 years without problem but I have to move servers ...

The new server has php version of 5.4 so will not work with this install.

The old server/install has the below details:

Zen Cart 1.3.8a
Database Patch Level: 1.3.
Patch: 1::
8
v1.3.8 [2008-04-18 11:28:49] (Fresh Installation)
v1.3.8 [2008-04-18 11:28:49] (Fresh Installation)

SERVER INFORMATION
Server Host: https://www.petticrows.co.uk (192.168.0.33)
Server OS: Linux plesk1.hosting.astutium.com 2.4.21-63.EL #1 Tue Nov 3 18:32:44 EST 2009 i686
PHP Version: 4.4.2 (Zend: 1.3.0)
Database: MySQL 4.1.19
HTTP Server: Apache/2.0.46 (CentOS)

What is my best upgrade / migration strategy here?

19 Dec 2014, 7:24 PM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Upgrade strategy ... (and server move)

It appears as though your site has very few customisations, save perhaps the header graphic and a slight bit of colour changing via CSS. So that makes upgrading quite straightforward.

In your unique case I imagine the following would suffice:

  1. On your new server, install the latest version of Zen Cart. During installation, tell it to use the same "table prefix" as your old site currently uses (see DB_PREFIX in the old site's /includes/configure.php file on the server)
  2. Take a database backup from the old server using phpMyAdmin: http://www.zen-cart.com/content.php?144
  3. Import that database onto your new server, using phpMyAdmin on the new server.
  4. Run the conversion script to convert the imported data to utf8: http://www.zen-cart.com/downloads.php?do=file&id=1318
  5. Run zc_install on the new server to then upgrade the imported data to work with the latest Zen Cart.
  6. Copy over your product images (the /images/ folder) from your old server to the new server.
  7. Re-do any edits to language files like you did on the old site.
  8. Make any template tweaks, such as logo, colour, etc.
  9. Reconfigure any modules (payment, shipping) as needed. There might be updates to some plugins that you may need to install for some of those modules that you'd previously added.

As a sanity check, it's good to take a copy of the old site's PHP files, onto your PC, and then run a tool like WinMerge to compare all those files against an original copy of ZC v1.3.8 (your old version) in order to highlight any customisations you'd made, so you have a list of the kinds of changes you'll want to re-make in the new version's files. (Don't just copy old version's files into new version, since that might remove things that are needed by the new version.)

Recommended reading:
http://www.zen-cart.com/entry.php?3-How-do-I-rebuild-my-site-on-the-new-version-instead-of-upgrading

22 Dec 2014, 9:40 AM
#3
montello1984 avatar

montello1984

New Zenner

Join Date:
Dec 2014
Location:
United Kingdom
Posts:
49
Plugin Contributions:
0

Re: Upgrade strategy ... (and server move)

Thanks - the install is standard apart from colours.

I have had the database copied over by the hosting company.

The install does not conduct ecommerce; rather people place orders but there is no final payment option usually because the items are odd shapes and shipping is complexed combined with overseas sales and import tax problems.

What is utf8? and what would my current db be?

I'm not too bothered about the order history in the db but I do want all the product listings and photos to be preserved.

22 Dec 2014, 3:59 PM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Upgrade strategy ... (and server move)

utf8 is the format in which the data is stored. Using utf8 will make your site more compatible with future versions, and is the industry standard. Older versions used iso-8859-1 which didn't support non-english characters without some odd complicated translation. Running the conversion utility fixes those.

27 Jan 2015, 9:12 AM
#5
montello1984 avatar

montello1984

New Zenner

Join Date:
Dec 2014
Location:
United Kingdom
Posts:
49
Plugin Contributions:
0

Re: Upgrade strategy ... (and server move)

In which case do I have to do that? I only have English characters in my datebase

27 Jan 2015, 2:10 PM
#6
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Upgrade strategy ... (and server move)

montello1984:

In which case do I have to do that? I only have English characters in my datebase
In my opinion you should make the conversion. It takes 90 seconds using the tool I mentioned in #4 in my earlier post.
That will leave your database in utf8 format, which means it will be compatible with future versions of Zen Cart, and will also mean you won't have to change a bunch of PHP files in every new ZC version to tell it NOT to use utf8 when it's designed for utf8.

27 Jan 2015, 2:12 PM
#7
montello1984 avatar

montello1984

New Zenner

Join Date:
Dec 2014
Location:
United Kingdom
Posts:
49
Plugin Contributions:
0

Re: Upgrade strategy ... (and server move)

Ok - I have made some progress ...

The Database is on the new server; and is in the utf8 format.

All the product images have been uploaded.

I have a virgin installation of Zen Cart up on my staging server ....

But it is not picking up the SQL database or the product images ... :-(

Any tips?

27 Jan 2015, 2:14 PM
#8
montello1984 avatar

montello1984

New Zenner

Join Date:
Dec 2014
Location:
United Kingdom
Posts:
49
Plugin Contributions:
0

Re: Upgrade strategy ... (and server move)

To see the old install go to https://www.petticrows.co.uk and click "On-line shop"

To see the staging version you will need to add this line to your hosts file:

80.76.216.10 https://www.petticrows.co.uk

27 Jan 2015, 2:21 PM
#9
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Upgrade strategy ... (and server move)

On the old server, in /includes/configure.php what is the setting for DB_PREFIX ?
What is the same setting on the new server?

27 Jan 2015, 2:25 PM
#10
montello1984 avatar

montello1984

New Zenner

Join Date:
Dec 2014
Location:
United Kingdom
Posts:
49
Plugin Contributions:
0

Re: Upgrade strategy ... (and server move)

here is the file; seems to have the correct DB credentials:

<?php /** * @package Configuration Settings circa 1.5.4 * @copyright Copyright 2003-2014 Zen Cart Development Team * @copyright Portions Copyright 2003 osCommerce * @license <http://www.zen-cart.com/license/2_0.txt> GNU Public License V2.0 * File Built by zc_install on 2015-01-27 11:45:51 */ /*************** NOTE: This file is similar, but DIFFERENT from the "admin" version of configure.php. ***********/ /*************** The 2 files should be kept separate and not used to overwrite each other. ***********/ // Define the webserver and path parameters // HTTP_SERVER is your Main webserver: eg-http://www.your_domain.com // HTTPS_SERVER is your Secure webserver: eg-https://www.your_domain.com define('HTTP_SERVER', 'http://www.petticrows.co.uk'); define('HTTPS_SERVER', 'https://www.petticrows.co.uk'); // Use secure webserver for checkout procedure? define('ENABLE_SSL', 'false'); // NOTE: be sure to leave the trailing '/' at the end of these lines if you make changes! // * DIR_WS_* = Webserver directories (virtual/URL) // these paths are relative to top of your webspace ... (ie: under the public_html or httpdocs folder) define('DIR_WS_CATALOG', '/catalog/'); define('DIR_WS_HTTPS_CATALOG', '/catalog/'); define('DIR_WS_IMAGES', 'images/'); define('DIR_WS_INCLUDES', 'includes/'); define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . 'functions/'); define('DIR_WS_CLASSES', DIR_WS_INCLUDES . 'classes/'); define('DIR_WS_MODULES', DIR_WS_INCLUDES . 'modules/'); define('DIR_WS_LANGUAGES', DIR_WS_INCLUDES . 'languages/'); define('DIR_WS_DOWNLOAD_PUBLIC', DIR_WS_CATALOG . 'pub/'); define('DIR_WS_TEMPLATES', DIR_WS_INCLUDES . 'templates/'); define('DIR_WS_PHPBB', '/'); // * DIR_FS_* = Filesystem directories (local/physical) //the following path is a COMPLETE path to your Zen Cart files. eg: /var/www/vhost/accountname/public_html/store/ define('DIR_FS_CATALOG', '/home/dragon/public_html/catalog/'); //the following path is a COMPLETE path to the /logs/ folder eg: /var/www/vhost/accountname/public_html/store/logs ... and no trailing slash define('DIR_FS_LOGS', '/home/dragon/public_html/catalog/logs'); define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/'); define('DIR_FS_DOWNLOAD_PUBLIC', DIR_FS_CATALOG . 'pub/'); define('DIR_WS_UPLOADS', DIR_WS_IMAGES . 'uploads/'); define('DIR_FS_UPLOADS', DIR_FS_CATALOG . DIR_WS_UPLOADS); define('DIR_FS_EMAIL_TEMPLATES', DIR_FS_CATALOG . 'email/'); // define our database connection define('DB_TYPE', 'mysql'); define('DB_PREFIX', ''); define('DB_CHARSET', 'utf8'); define('DB_SERVER', 'localhost'); define('DB_SERVER_USERNAME', 'dragon_petticrow'); define('DB_SERVER_PASSWORD', '****************'); define('DB_DATABASE', 'dragon_onlineshop'); // The next 2 "defines" are for SQL cache support. // For SQL_CACHE_METHOD, you can select from: none, database, or file // If you choose "file", then you need to set the DIR_FS_SQL_CACHE to a directory where your apache // or webserver user has write privileges (chmod 666 or 777). We recommend using the "cache" folder inside the Zen Cart folder // ie: /path/to/your/webspace/public_html/zen/cache -- leave no trailing slash define('SQL_CACHE_METHOD', 'none'); define('DIR_FS_SQL_CACHE', '/home/dragon/public_html/catalog/cache'); // EOF
27 Jan 2015, 2:55 PM
#11
montello1984 avatar

montello1984

New Zenner

Join Date:
Dec 2014
Location:
United Kingdom
Posts:
49
Plugin Contributions:
0

Re: Upgrade strategy ... (and server move)

Ah .... it seems to be connected now ... dunno why that has suddenly changed.

I think I just now need to do some customisation of colours.

Thanks for all your help so far.

27 Jan 2015, 3:09 PM
#12
montello1984 avatar

montello1984

New Zenner

Join Date:
Dec 2014
Location:
United Kingdom
Posts:
49
Plugin Contributions:
0

Re: Upgrade strategy ... (and server move)

OK - I think I have sort of worked it out ...

Something a bit odd is going on regarding how various components are connecting.

If I add the text:
80.76.216.10 https://www.petticrows.co.uk
to my hosts file I see the staging site on the new server and a virgin ZC install with no products.

If I then remove that line from my hosts file I see a virgin ZC install with my products.

If I view the site on another PC I see the old site as I expected ... old ZC install

Something odd is going on when I mess with the hosts file to re-direct the browser to the staging site.

Any thoughts?

27 Jan 2015, 3:15 PM
#13
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Upgrade strategy ... (and server move)

montello1984:

OK - I think I have sort of worked it out ...

Something a bit odd is going on regarding how various components are connecting.

If I add the text:
80.76.216.10 www.petticrows.co.uk
to my hosts file I see the staging site on the new server and a virgin ZC install with no products.

If I then remove that line from my hosts file I see a virgin ZC install with my products.

If I view the site on another PC I see the old site as I expected ... old ZC install

Something odd is going on when I mess with the hosts file to re-direct the browser to the staging site.

Any thoughts?
That would be the normal caching that your browser does, as well as IP address caching that your PC does.
You'll need to clear your browser cache and cookies, and also "flush IP routes" (google for "windows flush routes"). Or just use 2 PCs.

27 Jan 2015, 4:46 PM
#14
montello1984 avatar

montello1984

New Zenner

Join Date:
Dec 2014
Location:
United Kingdom
Posts:
49
Plugin Contributions:
0

Re: Upgrade strategy ... (and server move)

OK - had a bit of a clean up and rebooted and using a new browser in private mode and I can now see the staged version.

Sadly it is not linking to the DB where as when the IP routing was slightly muddled it was ...

Any tips/ideas?

27 Jan 2015, 5:03 PM
#15
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Upgrade strategy ... (and server move)

I still don't really know what you mean by "is not linking to the database".

27 Jan 2015, 5:06 PM
#16
montello1984 avatar

montello1984

New Zenner

Join Date:
Dec 2014
Location:
United Kingdom
Posts:
49
Plugin Contributions:
0

Re: Upgrade strategy ... (and server move)

The ZC shop is not picking up all the product listings that are contained in the SQL data base and the product images.

For a while it looked almost done when the browser was obviously getting IP routing a bit confused and all the products were listed.

Now all I see is what looks like a completely blank ZC install with no product listings as the install is not connecting with the SQL database which contains all the shop details.

27 Jan 2015, 5:08 PM
#17
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Upgrade strategy ... (and server move)

montello1984:

The ZC shop is not picking up all the product listings that are contained in the SQL data base and the product images.

For a while it looked almost done when the browser was obviously getting IP routing a bit confused and all the products were listed.

Now all I see is what looks like a completely blank ZC install with no product listings as the install is not connecting with the SQL database which contains all the shop details.
That's exactly symptomatic of having a different DB_PREFIX on the new site than what you had on the old site. Thus, the database is being told to look at tables which are named differently in both databases, thus you're making it look at a completely separate set of data.
That's why step #1 in my instructions earlier told you to note and use the same prefix on the new site as you did on the old.

27 Jan 2015, 5:17 PM
#18
montello1984 avatar

montello1984

New Zenner

Join Date:
Dec 2014
Location:
United Kingdom
Posts:
49
Plugin Contributions:
0

Re: Upgrade strategy ... (and server move)

I believe I have:

Here is the section from the current live site:

// define our database connection
define('DB_TYPE', 'mysql');
define('DB_PREFIX', '');
define('DB_SERVER', 'localhost');
define('DB_SERVER_USERNAME', 'petticrows');
define('DB_SERVER_PASSWORD', '****************');
define('DB_DATABASE', 'onlineshop');
define('USE_PCONNECT', 'false');
define('STORE_SESSIONS', 'db');
// for STORE_SESSIONS, use 'db' for best support, or '' for file-based storage

Here is the same section from the staged site:

// define our database connection
define('DB_TYPE', 'mysql');
define('DB_PREFIX', '');
define('DB_CHARSET', 'utf8');
define('DB_SERVER', 'localhost');
define('DB_SERVER_USERNAME', 'dragon_petticrow');
define('DB_SERVER_PASSWORD', '**************');
define('DB_DATABASE', 'dragon_onlineshop');

27 Jan 2015, 5:29 PM
#19
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Upgrade strategy ... (and server move)

montello1984:

I have had the database copied over by the hosting company.
Can you explain what you mean by this?

27 Jan 2015, 5:32 PM
#20
montello1984 avatar

montello1984

New Zenner

Join Date:
Dec 2014
Location:
United Kingdom
Posts:
49
Plugin Contributions:
0

Re: Upgrade strategy ... (and server move)

My hosting company moved(took a copy) the SQL database from my old Plesk based server (which is currently still live) to my new cPanel server which I am working on at present in the background.

I didn't migrate the database myself.

I am operating on the fringes of my expertise here ... :blush: (thanks for helping)