forum.coppermine-gallery.net

Support => cpg1.6.x Support => cpg1.6 upgrading => Topic started by: littbarski on October 13, 2018, 10:05:49 am

Title: upgrade from 1.5, installer and Google index
Post by: littbarski on October 13, 2018, 10:05:49 am
hello,

I use Coppermine 1.5.20, now my provider will switch to PHP 7 and I have to make an upgrade. First, thank you all developers and supporters for this great gallery and that it's also developed for the future (PHP 7).

I would like to know:
- do the paths and filenames of my images remain exactly the same after the upgrade? I ask because of the Google index and ranking.
- is it for a beginner as I am the best to use this installer?
http://forum.coppermine-gallery.net/index.php/topic,79013.msg383037.html#msg383037
- can I create like a test area on the server where I make a copy of my gallery, then make the upgrade there and at the end just rename the root path of it?

Thank you!
Title: Re: upgrade from 1.5, installer and Google index
Post by: ron4mac on October 13, 2018, 03:54:55 pm
The paths and filenames will remain the same.

You can use  this method to easily upgrade to CPG 1.6.x:
http://forum.coppermine-gallery.net/index.php/topic,78505.msg381584.html#msg381584

I'm not sure about upgrading a gallery copy. Best is to backup your current gallery (which you can do by copying to a different location on your server) and to backup your database.

Any problems will be from plugins or your theme. Before doing the upgrade, rename all the plugin folders in the plugin directory (i.e. opensearch => sv_opensearch). This will keep you from having to uninstall them, and lose their configurations. Rename them back one at a time, checking for proper function. Or, if you provide a list of the plugins that you use, we can possibly check their compatibility with CPG 1.6.
Title: Re: upgrade from 1.5, installer and Google index
Post by: littbarski on October 13, 2018, 04:05:53 pm
thank you for your answer.
so the two first thing are already very good, that's great.

about the renaming my idea was just like this:
- I copy the complete gallery on the server (for example in a FTP program), for example "gallery" >"gallery1"
- I make the upgrade in the copy "gallery1" and test everything
- if it's ok then I delete the old "gallery" and rename the "gallery1" into "gallery".

I am no expert at all so I guess the above is just nonsense. Indeed I even don't know anything about databases, I will have to check this in my provider's tools, I saw it once.
Title: Re: upgrade from 1.5, installer and Google index
Post by: ron4mac on October 13, 2018, 05:28:15 pm
about the renaming my idea was just like this:
- I copy the complete gallery on the server (for example in a FTP program), for example "gallery" >"gallery1"
- I make the upgrade in the copy "gallery1" and test everything
- if it's ok then I delete the old "gallery" and rename the "gallery1" into "gallery".

Or another way:
- You copy the complete gallery on the server (for example in a FTP program), for example "gallery" >"gallery1".
- You make the upgrade in "gallery" and test everything.
- if it's NOT ok then you delete the "gallery" and rename the "gallery1" into "gallery".

Because the upgrade will make some database changes, you will need a database backup if you will want to revert completely to the old gallery.
Title: Re: upgrade from 1.5, installer and Google index
Post by: littbarski on October 13, 2018, 07:30:04 pm
Thank you again. I will look into all those tools and options I have (never have done anything with any database) and then probably will ask here again :).
At least it seems to be something that I could achieve, this upgrade.
Title: Re: upgrade from 1.5, installer and Google index
Post by: phill104 on October 13, 2018, 10:58:24 pm
A lot of people worry about databases. In essence all they are are files, just like any other. The only difference is they are not in the same place as your normal files. Most hosts provide tools to work with them that make everything easy, phpmyadmin is the more common one. Take a look in your hosts cPanel and I am sure you will find it. From there a few clicks is all it takes to make a backup and download it to your local machine.
Title: Re: upgrade from 1.5, installer and Google index
Post by: littbarski on October 18, 2018, 04:20:41 pm
Hello again.

I found now the area where I can manage my databases on my provider's website. I can export them as well, what I want to do, of course. I exported with the quick export option, but the advanced option also exists and I wonder if I should use it and what I should choose there. Here I show the options and how they are chosen by default.

I know it's in German, so perhaps somebody could give André a hint about this thread. Or maybe English speakers can also give me an answer, as many options show the English names as well.
or short question: is there anything very important to check in an export?
Title: Re: upgrade from 1.5, installer and Google index
Post by: ron4mac on October 18, 2018, 04:42:00 pm
You should be okay with just the quick option.

Only reason to do advanced is perhaps to choose 'Add DROP TABLE', which makes it a little easier to restore because you don't have to remove existing tables first.
Title: Re: upgrade from 1.5, installer and Google index
Post by: littbarski on October 21, 2018, 04:39:07 pm
hello, I made the upgrade and everything seems fine (although I did not yet test it after changing the PHP to 7), but the start page (index.php) gives an error. It is probably not in the theme. The log says:

ORDER BY ' in index.php on line 338 the following error was encountered:
1064 : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 7

(and the error on the start page says in red:
Kritischer Fehler
Beim Ausführen einer Datenbank-Abfrage ist ein Fehler aufgetreten)

I can open all albums and images, everything is there, so perhaps I just can change the start page parameters somehow? that it opens just a random image for example?
Title: Re: upgrade from 1.5, installer and Google index
Post by: littbarski on October 21, 2018, 04:42:16 pm
sorry, I did not show all the message:

21. Oktober 2018 um 14:25 - While executing query 'SELECT aid, title, r.description, keyword, alb_hits, category, visibility, r.thumb, r.owner, depth AS level, lft, '0' AS pic_count
FROM bildergaleriecategories AS c
INNER JOIN bildergaleriealbums AS r ON r.category = c.cid
WHERE c.depth >= 0 + 1

ORDER BY ' in index.php on line 338 the following error was encountered:
1064 : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 7
Title: Re: upgrade from 1.5, installer and Google index
Post by: littbarski on October 21, 2018, 07:32:15 pm
in the meantime I get this error also when I login as Administrator, and I can't use tha admin tools anymore.
I can rename my old gallery and everything is fine again (including login). When I change back to 1.6 (renaming in FTP) I can use the admin tools--- until I logout or login again.

So my question now would only be: can I define the admin user as "logged in" in the SQL database tool?
this would be at least a workaround. as everything else is fine, the gallery works well, also in PHP 7.
Title: Re: upgrade from 1.5, installer and Google index
Post by: ron4mac on October 21, 2018, 09:24:37 pm
If you can get to the Config settings, go to Config->Album list view and set Sort order for albums; then save the config.  See if that makes a difference.
Title: Re: upgrade from 1.5, installer and Google index
Post by: ron4mac on October 21, 2018, 09:34:49 pm
Also ... make sure you ran <your_site>/update.php

If you used the installer_stub, it should have done that for you.
Title: Re: upgrade from 1.5, installer and Google index
Post by: littbarski on October 21, 2018, 09:36:48 pm
Thank you - but, at the beginning, it was only because of the index.php, after that the error always occured when I logged in, also for example from admin.php and without opening the index.php

but... I tried really quite a lot of things, and at the moment I think that it works: I made a manual upgrade with the files from Github, made a new database from my back up and now it works... will have to make some tests though. could it be that some plugins did crash the automatic upgrade? I did rename the folders as indicated above, but I guess best would be just to remove and delete all plugins before the upgrade?

---
yes of course I always used update.php

could it also have been because of the "sql version" ?
at the moment in my config.inc.php there is

$CONFIG['dbtype'] =      'mysql';

so not msqli - a problem, or even good in my case?
Title: Re: upgrade from 1.5, installer and Google index
Post by: littbarski on October 21, 2018, 09:41:21 pm
of course I meant mysqli at the end.

but my provider writes on his website that it has to be always mysqli today in PHP, so is this config option in Coppermine not that important if it works though for me in that way, or should I change that?
Title: Re: upgrade from 1.5, installer and Google index
Post by: littbarski on October 21, 2018, 09:50:13 pm
and, last thing for today: I even could not copy all files with my FTP program, but everything now just works fine :).

is there any file where I should really worry extremely about here?
Title: Re: upgrade from 1.5, installer and Google index
Post by: ron4mac on October 21, 2018, 09:56:24 pm
There are some things that are not right (mysql instead of mysqli is one). And many of those files are important. You should place the installer_stub (http://forum.coppermine-gallery.net/index.php/topic,79013.0.html) in the root of your CPG1.6 instance and run it.
Title: Re: upgrade from 1.5, installer and Google index
Post by: ron4mac on October 21, 2018, 10:00:20 pm
If your site runs under PHP 7 and the 'dbtype' is set to 'mysql' then your host has installed a hack to make PHP 7 accept mysql queries. I don't think this is a good thing.
Title: Re: upgrade from 1.5, installer and Google index
Post by: littbarski on October 22, 2018, 09:05:17 am
ok, thank you again.

I will try the stub. Before I do it, the question: this changes the database also, right? Then I make a backup of both m FTP files and the database.

And: I made the following: create a copy of my old 1.5.20 Coppermine gallery, then copy all 1.6 files from GitHub and overwrite in the FTP program. So in this case (1.5.20 > 1.6) the stub is working?

Title: Re: upgrade from 1.5, installer and Google index
Post by: littbarski on October 22, 2018, 10:59:49 am
me again :).

I was wrong about the DB config file, there is indeed "mysqli" as configuration in it. Sorry, I had 4 folders with different coppermine versions at the time, looked at the wrong place. So at least this is ok.

about the files I showed in the screenshot: here also, I looked again a bit better. There were those errors in the FTP upload from my local GitHub files for the files mentioned. but: I see now all those files in my current Coppermine folder (FTP), and they also habe exactly the same Byte size.

So after all I still wonder if I should really touch my running Coppermine system now.

So my question now would be: if the mysqli option is correct, and all files from my Screenshot are there with the correct Byte size (although not copied probably from the FTP program), what is the risk, or what is the reason you would use the stub installer still?

I would like to add that this gallery has 1 user (me), no options for downloading, rating, comments and so on. Only a gallery that shows albums and images. No personal data anywhere.
Title: Re: upgrade from 1.5, installer and Google index
Post by: ron4mac on October 22, 2018, 02:19:28 pm
If everything is running okay, then I guess there is no reason to do anything else. If there are problems, then it didn't get installed correctly and should be re-installed.

If you installed CPG1.6 and then reloaded a database backup over it ... this would have been a wrong thing to do.

It's really a simple procedure:
- back up your files and database if you choose (not to be needed/used unless by some small chance you want to revert to CPG1.5)
- place the installer_stub in the root folder of your installation
- run the installer_stub
- done; enjoy your CGP 1.6.x gallery
Title: Re: upgrade from 1.5, installer and Google index
Post by: littbarski on October 22, 2018, 03:43:02 pm
thank you again for all your help. As said at the beginning, it's great to have such an image gallery you can use and also change (themes etc.) that easily. I like it to have control over my website and its files (not the case in many easy website builders).

so I will leave it as it is, as it works fine. to repeat what I did (perhaps interesting for anyone reading this): I wanted to upgrade from 1.5.20 to 1.6. The upgrader.php did not work, perhaps because of plugins, perhaps because of some of the many adaptions I made to the theme and options. So I copied the old (working) 1.5.20 to a new directory in FTP, connected it to a new database where I imported before the old (working) database of 1.5.20. Then I copied all 1.6 files from GitHub via FTP into the new directory I created for the new Coppermine version. Then I startet update.php and everything works fine (except some FTP copy errors which were perhaps not even errors).

As I like, as mentioned, to change some things in the Coppermine gallery, I also notice which functions I don't need.

so my last question is for kind of "clean up" now: when everyhing with install or upgrade of a Coppermine gallery is fine, can I just delete the php functions in FTP I don't need? I don't want to delete a lot or things I don't know anything about, just the basic features I DON'T use like:
contact.php
addfav.php
captcha.php
ecard.php
delfav.pph
calendar.php
zipdownload.php

I don't use them and there is no UI options for them in my gallery. So is it ok to delete those file then in my FTP folder?