Upgrade 1.4.2 to 1.7.5 Clear Instructions.

Get help with installation and running phpwcms here. Please do not post bug reports or feature requests here.
Post Reply
Geek_Girl
Posts: 3
Joined: Sun 12. Oct 2014, 20:53

Upgrade 1.4.2 to 1.7.5 Clear Instructions.

Post by Geek_Girl » Sun 12. Oct 2014, 21:07

Can anyone provide me with the procedure to upgrade a 1.4.2 version to 1.7.5 with English as their first language? I have read through the upgrade instructions and tried several different ways with failure each time. There has to be some clear concise instructions without such vague things as "adjust new with old". I am not a noob at this stuff and know how to work with php and mySQL databases.

I will not rebuild the whole website from scratch, I will dump phpwcms for another CMS solution before I will do that. There should be better upgrade scripts; If one can create phpwcms; which is a complex application, then one should be able to write a clean upgrade script that does not have the user running around copying and changing files all over the place.

User avatar
Oliver Georgi
Site Admin
Posts: 9560
Joined: Fri 3. Oct 2003, 22:22
Location: Moscow, Russia
Contact:

Re: Upgrade 1.4.2 to 1.7.5 Clear Instructions.

Post by Oliver Georgi » Mon 13. Oct 2014, 05:46

Sure, there could be better upgrade script. But it is a question of time as always.

The easy way is (I recommend to do it locally, using MAMP or XAMP or any other local web server solution):
  1. Backup your site
  2. Create a full working copy of this backup with own database. Just change config/phpwcms /conf.inc.php with new path and database information. If you cannot create a new database use the current but rename table names with prefix — see this.
  3. If you use RENAME on current installation do not forget to set new prefix in config value $phpwcms['db_prepend'].
  4. When the copy is working as expected, upload new phpwcms files. Keep an eye on modules (include/inc_module) and template folder — merge old customised files with new one. I recommend using tools like WinMerge on PC or Changes/Kaleidoscope on Mac.
  5. Start upgrading database with setup/upgrade.php — follow instructions there.
  6. When there is no SQL upgrade script left, open login mask and you are done.
  7. If all is working, update old templates if necessary. The jump from 1.4.x to current is not that difficult
  8. Current releases have built-in db update script.
And if you cannot handle it yourself there is always someone who can do it for you. Is around 30 minutes to 1 hour of work. Update process itself takes no longer than 5 minutes.
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон

Geek_Girl
Posts: 3
Joined: Sun 12. Oct 2014, 20:53

Re: Upgrade 1.4.2 to 1.7.5 Clear Instructions.

Post by Geek_Girl » Mon 13. Oct 2014, 20:01

Thanks, this seems clearer than what I read before. Yes, I could do this either on the sever or with the AMPPS installed locally.

Geek_Girl
Posts: 3
Joined: Sun 12. Oct 2014, 20:53

Re: Upgrade 1.4.2 to 1.7.5 Clear Instructions.

Post by Geek_Girl » Tue 14. Oct 2014, 05:07

Why would I have duplicate columns? This is the report I got after running the upgrade:

CREATE TABLE IF NOT EXISTS `ron_phpwcms_log_seo` (
`id` int(11) NOT NULL auto_increment,
`create_date` timestamp NOT NULL,
`domain` varchar(255) NOT NULL DEFAULT '',
`query` varchar(255) NOT NULL DEFAULT '',
`pos` int(11) NOT NULL DEFAULT 0,
`referrer` text NOT NULL,
PRIMARY KEY (`id`)
);
ERROR: Duplicate column name 'article_menutitle' -> ALTER TABLE `phpwcms_article` ADD `article_menutitle` VARCHAR( 255 ) NOT NULL DEFAULT '';
ERROR: Duplicate column name 'cref_module' -> ALTER TABLE `phpwcms_crossreference` ADD `cref_module` VARCHAR( 255 ) NOT NULL DEFAULT '' AFTER `cref_type`;
ALTER TABLE `phpwcms_crossreference` ADD INDEX ( `cref_module` );
ERROR: Duplicate column name 'f_sort' -> ALTER TABLE `phpwcms_file` ADD `f_sort` INT NOT NULL DEFAULT '0';
ALTER TABLE `phpwcms_file` ADD INDEX ( f_sort );
ERROR: Duplicate column name 'detail_regkey' -> ALTER TABLE `phpwcms_userdetail` ADD `detail_regkey` VARCHAR( 255 ) NOT NULL DEFAULT '' AFTER `detail_id`;
ERROR: Duplicate column name 'detail_salutation' -> ALTER TABLE `phpwcms_userdetail` ADD `detail_salutation` VARCHAR( 255 ) NOT NULL DEFAULT '' AFTER `detail_title`;
ALTER TABLE `phpwcms_userdetail` ADD INDEX ( detail_regkey );
ERROR: Duplicate column name 'shopprod_track_view' -> ALTER TABLE `phpwcms_shop_products` ADD `shopprod_track_view` INT( 11 ) NOT NULL DEFAULT '0';
ALTER TABLE `phpwcms_shop_products` ADD INDEX ( `shopprod_track_view` );
CREATE TABLE IF NOT EXISTS `phpwcms_log` (
`log_id` int(11) NOT NULL AUTO_INCREMENT,
`log_created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`log_type` varchar(50) NOT NULL DEFAULT '',
`log_ip` varchar(30) NOT NULL DEFAULT '',
`log_user_agent` varchar(255) NOT NULL,
`log_user_id` int(11) NOT NULL DEFAULT '0',
`log_user_name` varchar(255) NOT NULL,
`log_referrer_id` int(11) NOT NULL DEFAULT '0',
`log_referrer_url` text NOT NULL,
`log_data1` varchar(255) NOT NULL DEFAULT '',
`log_data2` varchar(255) NOT NULL DEFAULT '',
`log_data3` varchar(255) NOT NULL DEFAULT '',
`log_msg` text NOT NULL,
PRIMARY KEY (`log_id`),
KEY `log_referrer_id` (`log_referrer_id`),
KEY `log_type` (`log_type`)
);
ALTER TABLE `phpwcms_calendar` CHANGE `calendar_refid` `calendar_refid` VARCHAR( 255 ) NOT NULL DEFAULT '';

User avatar
Oliver Georgi
Site Admin
Posts: 9560
Joined: Fri 3. Oct 2003, 22:22
Location: Moscow, Russia
Contact:

Re: Upgrade 1.4.2 to 1.7.5 Clear Instructions.

Post by Oliver Georgi » Tue 14. Oct 2014, 05:52

Can happen, because the old db update process is not perfect. if you can compare your updated db against current default schema (setup/default_sql). In general all is fine with those "duplicate error messages" and can be understood as notice only. Just keep in mind when later problems might occur.
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон

HyteRaph
Posts: 44
Joined: Wed 20. Mar 2013, 15:35

Re: Upgrade 1.4.2 to 1.7.5 Clear Instructions.

Post by HyteRaph » Wed 29. Jul 2015, 16:46

Oliver Georgi wrote:Sure, there could be better upgrade script. But it is a question of time as always.

The easy way is (I recommend to do it locally, using MAMP or XAMP or any other local web server solution):
  1. Backup your site
  2. Create a full working copy of this backup with own database. Just change config/phpwcms /conf.inc.php with new path and database information. If you cannot create a new database use the current but rename table names with prefix — see this.
  3. If you use RENAME on current installation do not forget to set new prefix in config value $phpwcms['db_prepend'].
  4. When the copy is working as expected, .....
So I tryed to get a fully working copy of my isntallation within a subdirectory on my webspace. I created a new db, edited the new db into the conf.inc.php. Then I edited, better to say tryed to edit, the new path. I assumed it'll be as easy as adding the subdir to the "$phpwcms['site'] " and "$phpwcms['DOC_ROOT'] " or at least "$phpwcms['root'] "..

So what I have tryed to far to update my new path:

Code: Select all

$phpwcms['site']              = 'http://'.$_SERVER['SERVER_NAME'].'/upgrade'
$phpwcms['DOC_ROOT']          = $_SERVER['DOCUMENT_ROOT']
$phpwcms['root']              = ''
-> index is working, first link clicked directs to .../upgrade/link.html -> now every secondary clicked link directs to root/link.html instead of root/upgrade/link.html

Code: Select all

$phpwcms['DOC_ROOT']          = $_SERVER['DOCUMENT_ROOT'].'/upgrade'
-> index is working but every link on index directs to the root/link.html

Code: Select all

$phpwcms['root']              = 'upgrade'
-> index is working, first link clicked directs to .../upgrade/link.html -> now every secondary clicked link directs to root/link.html instead of root/upgrade/link.html

Code: Select all

$phpwcms['site']              = 'http://'.$_SERVER['SERVER_NAME'].'/upgrade'
$phpwcms['DOC_ROOT']          = $_SERVER['DOCUMENT_ROOT']
$phpwcms['root']              = 'upgrade'
-> index shown without any css - simple site with all the links and text - links direct to /upgrade/upgrade/link.html

Code: Select all

$phpwcms['site']              = 'http://'.$_SERVER['SERVER_NAME'].'/upgrade'
$phpwcms['DOC_ROOT']          = $_SERVER['DOCUMENT_ROOT'].'/upgrade'
$phpwcms['root']              = ''
-> index is working, first link clicked directs to .../upgrade/link.html -> now every secondary clicked link directs to root/link.html instead of root/upgrade/link.html

Code: Select all

$phpwcms['site']              = 'http://'.$_SERVER['SERVER_NAME'].''
$phpwcms['DOC_ROOT']          = $_SERVER['DOCUMENT_ROOT'].'/upgrade'
$phpwcms['root']              = 'upgrade'
-> index not working (looking for root/upgrade/upgrade/index)


So i have absolutely no clue what to do. My backend templates do not have any hardlinks to root/link.html.
It should be possible to install a fully working copy within a simple subdirectory, shouldn't it?

Any help will be appreciated!! :)

I'll be back next week. May I'll find any help by then? :)

best regards

User avatar
Oliver Georgi
Site Admin
Posts: 9560
Joined: Fri 3. Oct 2003, 22:22
Location: Moscow, Russia
Contact:

Re: Upgrade 1.4.2 to 1.7.5 Clear Instructions.

Post by Oliver Georgi » Wed 29. Jul 2015, 16:58

Code: Select all

$phpwcms['site']              = 'http://'.$_SERVER['SERVER_NAME'].'/';
$phpwcms['DOC_ROOT']          = $_SERVER['DOCUMENT_ROOT'];
$phpwcms['root']              = 'upgrade';
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон

HyteRaph
Posts: 44
Joined: Wed 20. Mar 2013, 15:35

Re: Upgrade 1.4.2 to 1.7.5 Clear Instructions.

Post by HyteRaph » Wed 5. Aug 2015, 14:15

Thank you very much for your hint.
//edit:
I missed a semicolon...

But when I user your instructions, I get:
Parse error: syntax error, unexpected '$phpwcms' (T_VARIABLE) in .../upgrade/config/phpwcms/conf.inc.php on line 28
while line 28 says:
$phpwcms['root'] = 'upgrade';''
Nevertheless, the first clicked link on the index functions normal but the second links to the old version again.
This ist what happens:
1. link.de/upgrade/ {enter} -> link.de/upgrade/index.php?home_de
2. link.de/upgrade/index.php?home_de {click} -> link.de/upgrade/random_nav_link_de.html
3. link.de/upgrade/random_nav_link_de.html {click/mouse_hover} -> link.de/random_nav_link_de.html

I can't find any hardlinks within the site templates. While there is a seperate template for the start site and one for all other sites, there might be a problem?

Ouh, there might be a rewrite problem. I'll check that.

HyteRaph
Posts: 44
Joined: Wed 20. Mar 2013, 15:35

Re: Upgrade 1.4.2 to 1.7.5 Clear Instructions.

Post by HyteRaph » Thu 6. Aug 2015, 13:57

Since I have absolutely no idea what to do and how to use mod_rewrite and I am afraid of messing up more than fixing.... I'll just leave that sh** as it is. But I am quite sure there must be the freaking solution. Since everything seems to work for that copy except for subfolder links.... I will go on upgrading now..

Old Boy
Posts: 1110
Joined: Fri 23. Nov 2012, 13:52

Re: Upgrade 1.4.2 to 1.7.5 Clear Instructions.

Post by Old Boy » Thu 6. Aug 2015, 14:34

Are you using modRewrite?

Then have look into your .htaccess file!
Is it activated?

There it might be necessary, to change some lines, because of the fact, you are now working inside a subdirectory!!!

HyteRaph
Posts: 44
Joined: Wed 20. Mar 2013, 15:35

Re: Upgrade 1.4.2 to 1.7.5 Clear Instructions.

Post by HyteRaph » Thu 6. Aug 2015, 15:36

Old Boy wrote:Are you using modRewrite?

Then have look into your .htaccess file!
Is it activated?

There it might be necessary, to change some lines, because of the fact, you are now working inside a subdirectory!!!

You were right! After many try&fail's I've managed to get it working properly. Thank you old boy and Oli!
RewriteEngine On
DirectoryIndex index.html index.php

#HTTPS rewrite:
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

# Installed in Subfolder http://www.example.com/subfolder/
RewriteRule ^([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)\.html$ /upgrade/index.php?id=$1,$2,$3,$4,$5,$6&%{QUERY_STRING}

RewriteRule ^(.+)\.html$ /upgrade/index.php?$1&%{QUERY_STRING}

#
RewriteCond %{REQUEST_URI} index/(.*)\.html$
RewriteRule (.*)\.html$ /upgrade/index.php?$1

HyteRaph
Posts: 44
Joined: Wed 20. Mar 2013, 15:35

Re: Upgrade 1.4.2 to 1.7.5 Clear Instructions.

Post by HyteRaph » Thu 6. Aug 2015, 15:52

aaaaaaaaaaand....
Please proof location of "conf.inc.php".
:oops: :oops: :oops:

//edit1

/setup/upgrade.php:

Code: Select all

$_this_path = realpath(dirname(__FILE__).'/../');
if(is_file($_this_path.'/include/config/conf.inc.php')) {
	require_once ($_this_path.'/include/config/conf.inc.php');
} else {
	die('Please proof location of "conf.inc.php".');
}
may i just alter the path to /config/phpwcms/conf.inc.php or shell I copy the conf.inc.php to /include/config/?

//edit2
copying the conf.inc.php file to that folder made "upgrade" function at least viewable.
the screen asks me to upgrade sql data base. i've been given a couple of update scripts .. It look like for every version there was an update script for sql. while the most recent script was from 1.4 to 1.5 and I am running 1.6.531 there was nothing for me to do. visiting the login screen and logging in went well ... it is like there are all articles and templates still there...

but looking at the actual website it is absolutely messed up. it can't be that difficult to upgrade phpwcms, can it???


//edit3:
got it working. config.inc.php was messed up.

Old Boy
Posts: 1110
Joined: Fri 23. Nov 2012, 13:52

Re: Upgrade 1.4.2 to 1.7.5 Clear Instructions.

Post by Old Boy » Thu 6. Aug 2015, 20:06

The place for the configuration files have been mooved from:

.../config/phpwcms/take all the files from here

to

.../include/config/put all the files in here

you can now delete the empty folders .../config/phpwcms/no more files here

HyteRaph
Posts: 44
Joined: Wed 20. Mar 2013, 15:35

Re: Upgrade 1.4.2 to 1.7.5 Clear Instructions.

Post by HyteRaph » Mon 10. Aug 2015, 15:08

Thank you very much! Now the upgraded version is online and runs fine (as far as I say).

BTW: Kalaidoscope did a good job in merging the templates.

Post Reply