advice about upgrading

Questions & Problems about Installing or Upgrading with Version 3 phpList.
Forum rules
Please help the volunteers to help you by supplying the version of phpList you are using, browser & version and if possible, a link to your phpList installation.

advice about upgrading

Postby pfb » 10:03pm, Wed 18 Feb, 2015

Hi all,

I have version 2.10.18 of phplist, and I think the time has come for an upgrade :)
I'm a bit worried though. I am afraid I could ruin something that, after all, is still working, so I was wondering what's the best way to install the latest version of phplist while keeping the old one, at least for a while.

If I get it right, the tip at the bottom of the relevant documentation page suggests exactly this.

There are a couple of things I am not sure about, and I'd like to ask for advice.

1) folder name. Clearly (I guess), the test version should go in a folder other than the standard one, i.e. "lists". Apparently this requires to edit the "$pageroot" field in config.php, as suggested inthis post.
Probably the same goes for "$adminpages".

Is there anything else I should take care of in this respect?

2) Database. What does exactly happen when I "link" the new version of phplist to the same database used by the old version? Will the old tables be re-used, overwritten, ignored?
Of course what I'd really like is that the old user list appears in the new version of phplist.
Would that happen if I use the same $usertable_prefix ("phplist_")?
Of course I made a backup of everything. Yet, I'm still a bit nervous, also because the procedure for the database backup was a bit different than explained here.


Probably I'll have more questions down the road, but I think that for the moment I'll be happy with some help about the above two points.
Of course, any further advice is welcome.

Thanks a lot for your assistance

Francesco
pfb
PL Nut
 
Posts: 29
Joined: 3:19pm, Mon 04 Mar, 2013

Re: advice about upgrading

Postby duncanc » 4:16am, Thu 19 Feb, 2015

If you want to create a second instance of phplist as a test system for the latest release then you need to copy your existing database and use that, to avoid changing your current one. It is more important to ensure that your database is kept intact, rather than the phplist code, which can easily be reinstalled.

But the safest way to upgrade is to not delete or overwrite anything until you know that the new release is working.

1) backup your phplist database. Look at the backup file, probably a zip file, to ensure that it really has worked.
2) rename your 'lists' folder to 'lists_2.10.18'
3) install the latest phplist into 'lists'
4) copy your config.php file from lists_2.10.18/config/config.php to lists/config/config.php. The file will work with the latest phplist.

Then login to phplist with the same admin id / password. It will prompt you to upgrade the database, which might take a few minutes depending on the size of your tables.

If everything looks ok then keep using the new release. If you have problems and want to revert then
1) restore the phplist database from the backup
2) rename 'lists' folder to 'lists_3.0.12'
3) rename 'lists_2.10.18' folder to 'lists'
and you should be back where you were. Of course, any changes, such as new message or new users, after the upgrade will now have been lost.
duncanc
Moderator
 
Posts: 2440
Joined: 6:34am, Sat 08 May, 2010
Location: London

Re: advice about upgrading

Postby pfb » 4:18pm, Thu 19 Feb, 2015

Hi duncanc

thanks a lot for your detailed reply.

I tried to make a backup of my database following the instructions here, but I had the impression they did not entirely apply to the phpmyadmin version I have access to.
Specifically, I could not really follow the second sub-item in item 7...
I hope my backup is ok anyway.

What is most important for me is to keep the 500+ users I have slowly and painfully included in my database. I also exported all of my users using the phplist "export" function. This produced a csv file.

Should anything go wrong with the upgrade procedure you described, could I at least re-import the users in the csv file into a fresh installation of phplist?

Also, in your instructions (point 4) you suggest to copy the old config file into the new version of phplist. Is this ok even if the two versions (2.10.18 and 3.0.12) are very far apart? Wouldn't I risk to miss some new features?
Or has the structure of the config file remained the same across versions?

Thanks again for your patience
Francesco
pfb
PL Nut
 
Posts: 29
Joined: 3:19pm, Mon 04 Mar, 2013

Re: advice about upgrading

Postby duncanc » 4:54pm, Thu 19 Feb, 2015

You can import your csv file of users into a new phplist, but hopefully that will not be necessary. If you ran the backup then you should have a file, either .sql or .zip. Just check that you can open the file and that it looks to contain your data.

The config file is compatible with the latest phplist. There will be new settings but the default values will usually be ok.

To upgrade your config file, edit the file config_extended.php in the new phplist and transfer settings from your current config.php. Then save config_extended.php and rename to simply config.php.
duncanc
Moderator
 
Posts: 2440
Joined: 6:34am, Sat 08 May, 2010
Location: London

Re: advice about upgrading

Postby pfb » 12:22am, Mon 23 Feb, 2015

So,
I'have finally found some time to upgrade my old version of php.
I have been following duncanc's instructions (I think), but I'm having some trouble.
Specifically, when I point my browser to /lists/admin/ I'm not getting a login page, but a "500 Internal Server Error" (The server encountered an internal error or misconfiguration and was unable to complete your request.).

I looked into the /lists/.htaccess file, as per troubleshooting tip n. 4, but I don't see any occurrence of "php_flag magic_quotes_gpc".

Also, I'm getting the login page all right, when I point my browser to the (renamed) old /lists_2p10p18/admin/.

Any advice?

In more detail, what I did is:

1) rename the old "lists" folder into lists_2p10p18/
2) copy the new "lists" folder from phplist-3.0.12/html_public/ to my web folder (at the same level as the renamed old lists folder).
3) copy the config.php file from the old lists folder to the new one.
4) to be sure, I also tried using the new config.php file, manually entering the old value in each parameter. Btw, this config.php is pretty short. My old config.php looks more like the new config_extended.php.

I am not sure that 2) (i.e. simply copying) qualifies as "installing" the new phplist. I assumed the "installation" part came after logging for the first time. Is there something I'm missing?
Should I contact the server administrator?


Thanks a lot for your help

Francesco
pfb
PL Nut
 
Posts: 29
Joined: 3:19pm, Mon 04 Mar, 2013

Re: advice about upgrading

Postby duncanc » 7:40am, Mon 23 Feb, 2015

If possible look at the web server error log, or ask the adminsitrator to do that, for any errors reported there.

One frequent problem is that some files might have the wrong permission. Check
the lists folder itself
the file lists/index.php, dl.php, lt.php, ut.php
the lists/admin folder itself
the file lists/admin/index.php

all of these should not be group writeable. The directories should have permission 755. not 775, and the files should have 644, not 664.
duncanc
Moderator
 
Posts: 2440
Joined: 6:34am, Sat 08 May, 2010
Location: London

Re: advice about upgrading

Postby pfb » 10:38am, Mon 23 Feb, 2015

Hi duncanc,

thanks again for your help.
The file permissions look ok. They are the same as in the corresponding files/folders in the old "lists".
I'm going to contact the administrator and ask him for the server error log.

cheers
Francesco
pfb
PL Nut
 
Posts: 29
Joined: 3:19pm, Mon 04 Mar, 2013

Re: advice about upgrading

Postby pfb » 6:19pm, Wed 04 Mar, 2015

Hi,

my administrator finally replied to my inquiries. He identified the problem in the .htaccess file in lists/. He observed that the login page loaded without problems after disabling .htaccess altogether. As to the identification of the problem inside the .htaccess file, he left it to me.

I had a look into it, and made some tests.

First of all I have to apologize, because that .htaccess file did contain a line with "php_flag magic_quotes_gpc". I do not know why I did not see/find it earlier. I'm not even sure I looked at the right file. Maybe it was the late hour.
However, commenting out the line "php_flag magic_quotes_gpc" did not do the trick.

Here's the .htaccess file I have

Code: Select all
DirectoryIndex index.php

<FilesMatch "\.(php|inc)$">
Order allow,deny
deny from all
</FilesMatch>
<FilesMatch "(index.php|dl.php|ut.php|lt.php|download.php|connector.php)$">
Order allow,deny
allow from all
</FilesMatch>

# if you want more than this for attachments, you can increase these values
# but you really, really should consider uploading them somewhere
# and only sending a link in your mails
# bigger than this really doesn't make sense in emails

## these lines are now commented out, to avoid 500 errors, https://mantis.phplist.com/view.php?id=9937
## but you should consider adding them

#php_value upload_max_filesize 3M
#php_value post_max_size 4M

php_flag magic_quotes_gpc


I tried and commented out also each of the remaining three set of instructions, separately.
It turned out that the "culprit" is the very first line. Commenting it out, along with the last one about the magic quotes, works.

I'm not sure that this is safe, though. I guess that the first line is simply "identifying" who the index file is. My "lists/" folder does contain an "index.php", with permissions 644, so I do not know what's happening.
Perhaps this is related to troubleshooting tip n. 1?

On a brighter note, (partially) disabling the .htaccess allowed me to log into the new phplist and to upgrade the database successfully.
pfb
PL Nut
 
Posts: 29
Joined: 3:19pm, Mon 04 Mar, 2013

Re: advice about upgrading

Postby danwaterloo » 11:53pm, Wed 04 Mar, 2015

This should work for your .htaccess:



Code: Select all
DirectoryIndex index.php

<FilesMatch "\.(php|inc)$">
Order allow,deny
deny from all
</FilesMatch>
<FilesMatch "(index.php|dl.php|ut.php|lt.php|download.php|connector.php)$">
Order allow,deny
allow from all
</FilesMatch>

# if you want more than this for attachments, you can increase these values
# but you really, really should consider uploading them somewhere
# and only sending a link in your mails
# bigger than this really doesn't make sense in emails

## these lines are now commented out, to avoid 500 errors, https://mantis.phplist.com/view.php?id=9937
## but you should consider adding them

#php_value upload_max_filesize 3M
#php_value post_max_size 4M
danwaterloo
PL Master
 
Posts: 276
Joined: 3:51am, Wed 30 Oct, 2013
Location: http://www.phplistsupport.com

Re: advice about upgrading

Postby pfb » 12:21am, Thu 05 Mar, 2015

Hi danwaterloo,

and thanks for your suggestion.
It seems to me that the .htaccess you propose is exactly the same as mine, except for the fact that you entirely removed the "php_flag magic_quotes_gpc" line.

I already tried commenting that line, which should be the same as deleting it. As I mention in my previous message, that was not enough.
To be on the safe side, I also tried canceling the line altogether -- as in your .htaccess -- but, as I suspected, this makes no difference.

So far, I found out only two ways of logging in:
1) removing the .htaccess file entirely.
2) commenting out the first and last line of my .htaccess. That is

Code: Select all
#DirectoryIndex index.php

[... same as above ...]

#php_flag magic_quotes_gpc


If either of these lines is uncommented, I get the 500 Internal server error.´
Is the first line important? Does commenting it compromise the security of my phplist?

Oh, I also tried removing (actually renaming) the index.html file, as suggested in the troubleshooting page. That did not make any difference either.
pfb
PL Nut
 
Posts: 29
Joined: 3:19pm, Mon 04 Mar, 2013

Re: advice about upgrading

Postby pfb » 12:27pm, Fri 06 Mar, 2015

So, after further exchange with my administrator, we decided that it's ok to comment out the first line in the lists/.htaccess file.

Code: Select all
#DirectoryIndex index.php


I was testing the system just now, and something weird happens.
Rather than starting a new post, I'm continuing this one, because chances are that I've done something wrong with the installation.

First off, at least at first glance all the stuff of version 2 has been successfully imported in version 3.

However, from time to time the phplist "ends up in the wrong place", as explained below.
My phplist is in a website hosted in the domain of my institution.
The url is something like: http://www.institution.it/website/lists/admin/
From time to time the browser is directed to http://www.institution.it/lists/admin/ and of course it reacts with a 404 error.

This happened to me e.g. while playing with templates.
I suppose there is some incorrect parameter setting, but I could not find anything appropriate in config.php.
pfb
PL Nut
 
Posts: 29
Joined: 3:19pm, Mon 04 Mar, 2013

Re: advice about upgrading

Postby duncanc » 1:23pm, Fri 06 Mar, 2015

Check the values for $pageroot in config.php and the "website address" on the admin Settings page.

website address should be www.institution.it
$pageroot should be "/website/lists"
duncanc
Moderator
 
Posts: 2440
Joined: 6:34am, Sat 08 May, 2010
Location: London

Re: advice about upgrading

Postby pfb » 2:11pm, Fri 06 Mar, 2015

Hi duncanc,

thanks again for your time.

There was no $pageroot in my config.php. I found it in config_extended.php, though.
So I copied that bit in my config.php and set it to
Code: Select all
$pageroot = 'website/lists';


The "website address" field in the Admin setting pages was already set to "website/lists/".
Should I change it into "www.institution.it"?

Thanks
Francesco
pfb
PL Nut
 
Posts: 29
Joined: 3:19pm, Mon 04 Mar, 2013

Re: advice about upgrading

Postby duncanc » 2:28pm, Fri 06 Mar, 2015

I thought that you were using the same config.php as before the upgrade? But set each to exactly the value I specified.

You should also review the urls for signup, unsubscribe etc, in the Subscription group on the Settings page, as they may now also be incorrect.
duncanc
Moderator
 
Posts: 2440
Joined: 6:34am, Sat 08 May, 2010
Location: London

Re: advice about upgrading

Postby pfb » 2:54pm, Fri 06 Mar, 2015

I did follow your original instructions of using the "old" config.php, initially.
But then I made some "experiments", on account of the 500 server error, and I probably lost track of them. Unfortunately I can work at this only in my spare time. Also, I did not do anything for a several days, while waiting for the administrator to reply to my inquiries.

By the way, I think I just did something very stupid. I copied the old config.php in the new folder, without saving the current version, which was incomplete but at least it sort of worked.
Now I am not even able to log in any more, and I'm not finding where the password is stored.
Crap!

I apologize for this messy way of proceeding.
Thanks a lot for your patience, really.
Francesco
pfb
PL Nut
 
Posts: 29
Joined: 3:19pm, Mon 04 Mar, 2013

Next

Return to Installing and Upgrading

Who is online

Users browsing this forum: No registered users and 1 guest