backslash problem when upgrading from 1.4.7 to 1.6.1

In this board you can talk about general questions about phpMyFAQ

Moderator: Thorsten

telenut
Posts: 68
Joined: Thu Sep 09, 2004 10:13 am

backslash problem when upgrading from 1.4.7 to 1.6.1

Post by telenut »

Hi,

When I try to upgrade from 1.4.7 to 1.6.1 there is a problem with the backslashes. They are all doubled...
looks like: deze \'FAQ\' aangepast naar ICTDOC. Deze is bereikbaar via http:\\\\smeagol\\ictdoc. Of rechtstreeks via http:\\\\smeagol

Is this a bug in the update script?
Thorsten
Posts: 15562
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,

did you ran the update script?

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
telenut
Posts: 68
Joined: Thu Sep 09, 2004 10:13 am

Post by telenut »

I did...

actually... I installed version 1.6.1 to make sure it worked.
It looked good, so then I installed 1.4.7 (the current version we use in 'production')
That did not worked so good :-) But that was no problem, I had to copy the files on the production server over the files I just installed. After that, I had to edit some files (database connection had to be set ).
Than I logged in, and did a restore of the database.

Now I had an exact copy on an other server.

next step: copy the files of the 1.6.1 version over the 1.4.7 version. (I also replaced the templates, that will not couse the problem I guess?)
And than ran the updatescript.
Everything went fine, and it looked good. except for the backslashes.

I had the bright idea to make a backup, do a search and replace, and than a restore. But that dit nog worked eather, as you can read in the other topic.

thx for looking at it!
matteo
Posts: 572
Joined: Sun Nov 20, 2005 6:53 pm
Location: Italy

What was the version selected in the 1^ update stage?

Post by matteo »

Hi,
during the update stage did you choose the right starting version? I.e. in your case this should be:

Code: Select all

phpMyFAQ 1.6.1 Update (Step 1 of 5)
  ...
  Please select your current version:
  phpMyFAQ 1.4.4 and later
TIA for providing this info,
Matteo
phpMyFAQ QA / Developer
Amazon.co.uk Wishlist
telenut
Posts: 68
Joined: Thu Sep 09, 2004 10:13 am

Post by telenut »

Yes I did.. Had a look at the code too.
Is there a way to 'redo' the upgrade?
matteo
Posts: 572
Joined: Sun Nov 20, 2005 6:53 pm
Location: Italy

Post by matteo »

HI,
in theory you can extract the install/update.php file from the PMF 1.6.1 package and put it into your [PATH_TO_PMFINSTALL]/install/update.php BUT you need to perform the update stage upon the "old" PMF 1.4.7 database.
FYI, you can easily change the PMF database going to [PATH_TO_PMFINSTALL]/inc/data.php and modify the values according to your DB coord.
phpMyFAQ QA / Developer
Amazon.co.uk Wishlist
telenut
Posts: 68
Joined: Thu Sep 09, 2004 10:13 am

Post by telenut »

thx,
I will look at it monday!
telenut
Posts: 68
Joined: Thu Sep 09, 2004 10:13 am

Post by telenut »

I did not mentioned what monday :-)
Now I ran the updatescript again, same problem...
Would it help to select an other older version.
I guess there is an error in the updatescript, will have a look at it myself, but help is verry welcome :-)
telenut
Posts: 68
Joined: Thu Sep 09, 2004 10:13 am

Post by telenut »

Re run the updatescript did not help.

So I just made a backup of the database with phpmyadmin, than did a search and replace ( //// -> // and //'' -> /' ).
After that imported the data back in the database and the problem was solved. Not a nice way, but it worked.
Would I have forgotten something with this method? (other characters that have an escapcharacter?
matteo
Posts: 572
Joined: Sun Nov 20, 2005 6:53 pm
Location: Italy

Post by matteo »

Hi,
glad to see that you manually solved the issue! :)
For helping us to replicate the issue and discovering the bug could you kindly post a rich set of "broken" record data?
In your first post you've written about this sentence:

Code: Select all

deze \'FAQ\' aangepast naar ICTDOC. Deze is bereikbaar via http:\\\\smeagol\\ictdoc. Of rechtstreeks via http:\\\\smeagol 
Is this the only broken sentence?
We'd like to create a small DB to test the update stage (if you look at the code you'll find that we made some "big" changes starting from PMF 1.5.5): it is possibile that the fixing of unuseful slashes is performed upon a subset of the needed set.

Maybe, for your convenience, you could direclty email the sql data of the affected records to: matteo@phpmyfaq.de.
phpMyFAQ QA / Developer
Amazon.co.uk Wishlist
telenut
Posts: 68
Joined: Thu Sep 09, 2004 10:13 am

Post by telenut »

Hi,

Now I had a look at the backup and I'm verry sorry that I did not did dhat before...
It seems that the backup I made has the errors too...

It was created with a mysql command, not with phpmyfaq.

here is the script:

Code: Select all

@ECHO OFF
for /f "tokens=1-4 delims=/ " %%a in ('date/t') do (
set dw=%%a
set mm=%%b
set dd=%%c
set yy=%%d
)

SET bkupdir=D:\backupmysql\
SET dbname=phpmyfaq
SET dbuser=root
SET dbpwd=xxxxxx

mysqldump -B %dbname% -u %dbuser% -p%dbpwd% > %bkupdir%\dbBkup_%dbname%_%yy%%mm%%dd%.sql
maybe I use the wrong command? But that is the only way to do an automatic backup each day.[/code]
matteo
Posts: 572
Joined: Sun Nov 20, 2005 6:53 pm
Location: Italy

Post by matteo »

Hi,
telenut wrote:

Code: Select all

...
mysqldump -B %dbname% -u %dbuser% -p%dbpwd% > %bkupdir%\dbBkup_%dbname%_%yy%%mm%%dd%.sql
[/quote]maybe I use the wrong command? But that is the only way to do an automatic backup each day.
you're dumping only one database so the -B flag is not needed, maybe this has broken your dump.
If you open the backup file with, e.g., Notepad, could you see some SQL statements? It's no matter to have a complete working backup: it would be sufficient to have only those data record (faqdata table, content column) that you manually changed.
This will help us to focus on the fixing of the bug, but we could work just on your sentence previously posted :wink:.
phpMyFAQ QA / Developer
Amazon.co.uk Wishlist
telenut
Posts: 68
Joined: Thu Sep 09, 2004 10:13 am

Post by telenut »

As far as I know, there is no bug!
Not in the update script of phpmyfaq. The error seems te be in the backup I create. It allready has the errors in it. So it is normal the errors remain after an update.
Thx for the help you try to offer, I will change the command and have a look at the sql file.

edit: Wheater is nice, I'm not going to work the next 4 days. So it will be for monday :-)
matteo
Posts: 572
Joined: Sun Nov 20, 2005 6:53 pm
Location: Italy

Post by matteo »

Hi,
telenut wrote:As far as I know, there is no bug!
Not in the update script of phpmyfaq. The error seems te be in the backup I create. It allready has the errors in it. So it is normal the errors remain after an update.
Thx for the help you try to offer, I will change the command and have a look at the sql file.
glad to read that my usually being in rush drives me to this misunderstanding :wink:

Have a nice long weekend!
Ciao,
Matteo
phpMyFAQ QA / Developer
Amazon.co.uk Wishlist
calande
Posts: 70
Joined: Sat Sep 02, 2006 7:01 am

Post by calande »

I have the same backslash problem here. I updated to 1.6.4. For instance click here: http://faqs.pcbsd.org/ and in the left menu, hover over "Package Installation", the tooltip has a backslash and reads "FAQ\'s related to installing packages" :(

In other places of the page I have seen this problem, especially in the news, but editing the news and removing the backslashes manually solved this. I guess this is due to the update script.
Post Reply