Jump to content

Upgrading 1.2.5.0 to 1.3


Recommended Posts

I've been testing PS Version 1.2.5.0 for an internal project and also a few of the 1.3 betas as they've come out but only as stand-alone instances, not upgrades. When the 1.3 final came out today, I tried it as an /upgrade/ following the guide at:
.

The upgrade seemed to go well, but there are some confusing things. By phpmyadmin, the 1.2 DB had 139 table; the 1.3 seems to have 135 and the merged one seems to have 140 (altho that might be the result of a bad upgrade). Which is right?

Also, after the upgrade, if I log into the newly created 1.3 cart (/presta13F) , the page looks similar to the 1.2 as I would expect, but the product URLs reference the previous 1.2 cart (/presta12) and clicking any of them takes me into the 1.2 cart. The footer doesn't indicate which codebase is running, but all the URLs also point to the /presta12 tree. The presta13 database (created previously) is UNpopulated with data from the 1.2 cart.

As to the admin page, if I try to log into the /presta13F admin page, none of the previous logins work (which may also be by design: if the upgrade is supposed to upgrade the /presta12 cart in place, the actual /presta13F tree would not be necessary.)

However, the file dates in the /presta12 tree are of the original installation, not the new one.

and the footer in the /presta12 admin page still says:

Powered by PrestaShop™ [ forum & contact ] - Version 1.2.5.0


Is this as it should be? Or should the /presta13F tree be the active one? In which case, what happened?
Link to comment
Share on other sites

I had no problem with my upgrade. Did you upload all of the PrestaShop v1.3 files (except modules/editorial/editorial.xml and the default images) or just the install folder? If you just copied the install folder, then your database will be v1.3, but your files will still be v1.2.5, which won't work. The number of database tables will depend on what modules you have installed.

Link to comment
Share on other sites

Very carefully this time...

I restored both presta12 php code tree and presta12 DB from backups. the shop works as before.


 $ unzip prestashop_1.3.zip  
Archive:  prestashop_1.3.zip
 Length     Date   Time    Name
--------    ----   ----    ----
       0  05-25-10 07:02   prestashop/
       0  05-25-10 07:00   prestashop/js/
   11520  12-01-08 07:37   prestashop/js/date.js
    1642  11-09-09 06:41   prestashop/js/sendMailTest.js
     142  04-03-10 08:46   prestashop/js/conditions.js
...etc




$ mv prestashop presta13F2   # <- new shop name

$ export P12=/var/www/presta12     # set some env vars to shorten the following:
$ export P13=/var/www/presta13F2
$ cp -a $P12/mails/*                 $P13/mails
$ cp -a $P12/img/*                   $P13/img
$ cp -a $P12/modules/*               $P13/modules
$ cp -a $P12/config/settings.inc.php $P13/config



(already backed up the db and shopcart files)

$ chmod 777 $P13/config
$ chmod 777 $P13/tools/smarty/compile
$ chmod 777 $P13/sitemap.xml
$ chmod -R 777 $P13/img
$ chmod -R 777 $P13/mails
$ chmod -R 777 $P13/modules
$ chmod -R 777 $P13/themes/prestashop/lang
$ chmod -R 777 $P13/translations



I get the warning:
Your configuration is invalid. Please fix the issues below:
(but everything is marked OK)

I click Next

Browser goes to next page.
View log gives me a bunch of SQL statements, starting with:

SET NAMES 'utf8'

/* ##################################### */ /* STRUCTURE     */ /* ##################################### */ ALTER TABLE `ps_product` CHANGE `reduction_from` `reduction_from` DATE NOT NULL DEFAULT '1970-01-01', CHANGE `reduction_to` `reduction_to` DATE NOT NULL DEFAULT '1970-01-01'

ALTER TABLE `ps_order_detail` CHANGE `tax_rate` `tax_rate` DECIMAL(10, 3) NOT 

..
..

and ending with:
ALTER TABLE `ps_image_lang` ADD INDEX `id_image` (`id_image`)

SET NAMES 'utf8'




$ cd presta13F2
$ mv install NOTinstall
$ rm readme_*



click "Discover your store"

takes me to -> http://host/presta13F2/

but as noted before, all URLs point to /presta12

## in shell

$ mv $P13/admin $P13/adminp13F2



I try to go to admin page:

-> http://host/presta13F2/adminp13F2 -> login panel

but none of the previous logins work. When I request a password reminder, I get sent one (the email message references /presta12: "You can now order on our Website: http://host/presta12/")

And the new password doesn't work (the /presta13F2 login pane just refreshes)

If I try to log in to the /presta12 admin site, it allows me to log in with the new password. BUT as I noted earlier, it's the 1.2.5.0 footer and all the links point to /presta12 URLs

So there seems to be no active 1.3 shop....?

Link to comment
Share on other sites

Did you move the files to another directory and forget to change PrestaShop's base directory? Edit config/settings.inc.php and check that the __PS_BASE_URI__ matches the directory. For example, if PrestaShop is in the presta13 directory, it should be '/presta13/', not '/presta12/'.

Link to comment
Share on other sites

You are correct. - I didn't do that. Did I miss it or is that particular bit of info undocumented? It doesn't appear to be in the upgrade instructions I read at:
.

Unless I read the wrong upgrade instructions...?

But you are entirely correct - that solved it. The new shop with all the data intact now shows up under the new /presta13 with all the URLs converted, etc.

Thanks very much for your help.
hjm

Link to comment
Share on other sites

What you suggest (having the existing shop be updated) would have been fine for me, but that didn't happen; the /presta12 code tree *wasn't* updated (tho the DB was).

In order for this to happen you would have to unpack the upgrade zip file, copy the old dirs/files into the new version, and then copy the new version over the old version, THEN run the update. And if that was the process, it wasn't documented either.

Incidentally, how did you do your update? You're obviously much more knowledgeable about PS than I am.

It may be whining a bit too much, but maybe a short shell script might be useful for those doing this, as I did above.
All the users would have to do is define 3 vars (WEB_ROOT, OLD_SHOP_NAME, NEW_SHOP_NAME, then run the web upgrade script, and finally do the cleanup.

I include the one that I used below:

BACK UP BOTH YOUR SHOP CODE TREE AND YOUR SHOP DATABASE
BACK UP BOTH YOUR SHOP CODE TREE AND YOUR SHOP DATABASE
BACK UP BOTH YOUR SHOP CODE TREE AND YOUR SHOP DATABASE

READ THE FOLLOWING SCRIPT FIRST - IT WORKS FOR ME BUT THAT'S ALL.

set the following 3 variables, then paste the rest into a root shell

export WEB_ROOT=/var/www         # <- set to web root of shop 

export OLD_SHOP_NAME=presta12     # <- set old shop name
export NEW_SHOP_NAME=SWD          # <- set new shop name

export OLD_SHOP_PATH=${WEB_ROOT}/${OLD_SHOP_NAME}    # defines old shop path
export NEW_SHOP_PATH=${WEB_ROOT}/${NEW_SHOP_NAME}    # defines new shop path

cd $WEB_ROOT
unzip prestashop_1.3.zip      # assumes that the new zipfile is in the WEB_ROOT
mv prestashop $NEW_SHOP_NAME

cp -a $OLD_SHOP_PATH/mails/*                 $NEW_SHOP_PATH/mails
cp -a $OLD_SHOP_PATH/img/*                   $NEW_SHOP_PATH/img
cp -a $OLD_SHOP_PATH/modules/*               $NEW_SHOP_PATH/modules
cp -a $OLD_SHOP_PATH/config/settings.inc.php $NEW_SHOP_PATH/config


#(already backed up the db and shopcart files)

# chmod the required dirs/files NON-recursively
chmod 777 $NEW_SHOP_PATH/config
chmod 777 $NEW_SHOP_PATH/tools/smarty/compile
chmod 777 $NEW_SHOP_PATH/sitemap.xml

# chmod the required dirs/files RECURSIVELY
chmod -R 777 $NEW_SHOP_PATH/img
chmod -R 777 $NEW_SHOP_PATH/mails
chmod -R 777 $NEW_SHOP_PATH/modules
chmod -R 777 $NEW_SHOP_PATH/themes/prestashop/lang
chmod -R 777 $NEW_SHOP_PATH/translations

# stream-edit the config file to make sure the NEW SHOP is the set
perl -e "s/\/${OLD_SHOP_NAME}\//\/${NEW_SHOP_NAME}\//gi" -p -i.bak   $NEW_SHOP_PATH/config/settings.inc.php




Then, point browser to
and go thru the installation procedure
(I still get an error message altho all green checkmarks are in place, and the rest of the upgrade seems to go well)

mv $NEW_SHOP_PATH/install $NEW_SHOP_PATH/NOT_install_anymore # mv it out of the way temporarily
rm $NEW_SHOP_PATH/readme_*



Click on the "Discover Your Store" button.

The updated store will be the NEW_SHOP_NAME and all URLs will reference the NEW_SHOP_NAME.

The underlying database remains the old name (in my case presta12, but it will be whatever it was when you set it up originally

Link to comment
Share on other sites

When I upgrade, I open the new PrestaShop zip file in WinZip, sort the files by last modified date and then extract all the files that have been modified since the previous PrestaShop zip file and the whole install directory. Next, I overwrite those files on my local site, then upload them to my server. I then run the installer and choose the "Upgrade" option to upgrade my database. Lastly, I compare the modified prestashop theme files to my customised nethcon theme and copy over the changes. This usually works for me, though sometimes files like zoom.php are deleted, so I have to remember to manually delete those files. I'm not sure whether this is the best way of upgrading, but it works for me.

Link to comment
Share on other sites

If I was going to do it manually, I would do it the way you described. I was simply following the provided directions & so assumed that those directions were the best way.
I'm slow, but I can be taught.. :)

Thanks again for your help.
Harry

Link to comment
Share on other sites

  • 2 weeks later...

I attempted an upgrade to 1.3 previously but had problems with the database so rolled back to 1.2.5.

It seems that a number of tables were modified on the most recent releases.

Can anyone suggest how to solve this?

I compared the databases with :
http://www.addictivetips.com/windows-tips/compare-two-mysql-database-with-mysql-structure-compare/

Is there a way to export the products from prestashop?

The tricky part is all the attribute tables.

All suggestions appreciated!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...