Upgrading from 2.08 to 2.18.5

77 views
Skip to first unread message

Jim Gregory

unread,
Jun 12, 2019, 4:13:38 PM6/12/19
to web2py-users
I will be moving a legacy application from my old shared host to a new VPS, and would like to upgrade web2py at the same time from 2.08 to the current version (2.18.5).  How should I go about doing this?  What changes will I need to make?  I'm satisfied for now with the currently layout (which uses Bootstrap 2), so I don't want to change it if I don't need to.  TIA.

黄祥

unread,
Jun 12, 2019, 4:32:17 PM6/12/19
to web2py-users
I will be moving a legacy application from my old shared host to a new VPS, and would like to upgrade web2py at the same time from 2.08 to the current version (2.18.5).  How should I go about doing this? 

since you said from shared host to a new host, perhaps can do it manually:
- backup your apps (pack)
- download and extract web2py latest version to new vps
- then restore your apps (unpack).
 
What changes will I need to make? 

think there's a lot of improvement and bug fixing compared to 2.0.8 version, should see the changelog for that (in web2py/changelog)

suggestion
pls experiment first in different environment first, to test how your webapps run in web2py latest version, after you satisfied then do it in prod environment (your new vps)

best regards,
stifan

Dave S

unread,
Jun 12, 2019, 5:43:20 PM6/12/19
to web2py-users


On Wednesday, June 12, 2019 at 1:13:38 PM UTC-7, Jim Gregory wrote:
I will be moving a legacy application from my old shared host to a new VPS, and would like to upgrade web2py at the same time from 2.08 to the current version (2.18.5).  How should I go about doing this?  What changes will I need to make?  I'm satisfied for now with the currently layout (which uses Bootstrap 2), so I don't want to change it if I don't need to.  TIA.


Current versions use Bootstrap 4, and along the way nested menus got limited to one child level.  For mobile devices (or small screens), the navbar becomes a "hamburger" menu.  I don't remember what other Bootstrap changes you'll notice; most things are compatible.

One other change is the introduction of the appconfig.ini in myapp/private, which lets you take site-specific items out of models/db.py.  Look at the latest [web2py/applications/welcome/models/db.py for an example.

Javascript changes are mostly under the hood, and pydal changes are likewise.

/dps


/dps

Massimo Di Pierro

unread,
Jun 12, 2019, 11:11:21 PM6/12/19
to web2py-users
the cleanest option is to install the new web2py and then copy or symlink your application under the applications folder. Check that everything works well before deploying. I'd b interested to know if anything break. I do not expect anything to break.

Dave S

unread,
Jun 13, 2019, 2:51:46 AM6/13/19
to web2py-users
Doh!  in the methods described by Massimo and Stifan, you will likely just carry over the css and js from your current setup.  You can use the newer versions if you copy them from the latest welcome app, though.

/dps

Jim Gregory

unread,
Jun 14, 2019, 3:57:38 PM6/14/19
to web2py-users
OK, I installed the current version of web2py on my laptop and copied over the 'init' application and a 'blog' application.  I've launched the test server and opened the blog app in my browser. 

The main problem I'm having now is URL rewriting.  Here's routes.py in my blog app:

default_controller = 'default'  # ordinarily set in app-specific routes.py
default_function
= 'index'  # ordinarily set in app-specific routes.py
#
routes_in
= (
   
('/blog/category/$anything', '/blog/default/tag/$anything'),
   
('/blog/static/$anything', '/blog/static/$anything'),
   
('/blog', '/blog/default/index'),
   
('/blog/$anything', '/blog/default/post/$anything'),
)
routes_out
= [(y,x) for (x,y) in routes_in]

And here's the index template of the blog:

{{ response.files.append(URL('static/css/blog.css')) }}
{{extend '../../init/views/layout.html'}}
<h1>Latest Blog Posts:</h1>
{{ for post in posts: }}
<div class="post">
<h2 class="title"><a href="{{ =URL('index',args=[post.slug]) }}">{{ =post.title }}</a></h2>
{{ if post.thumbnail: }}
<img class=blog_thumbnail src="{{ =URL(post.thumbnail) }}" alt="{{ =post.title }}">
{{ pass }}
<p class="description">
{{ =post.meta_description }} &nbsp;&nbsp;
<a href="{{ =URL('index',args=[post.slug]) }}">More &gt;&gt;</a>
</p>
</
div>
{{ pass }}

On the old version of my blog, I would get relative URLs '/blog/<post_slug>', but now I'm getting '/blog/default/<post_slug>'.   SImilar behavior is occurring in the top-level navigation.  Has routing behavior changed?

Jim Gregory

unread,
Jun 15, 2019, 7:33:37 AM6/15/19
to web2py-users


On Friday, June 14, 2019 at 2:57:38 PM UTC-5, Jim Gregory wrote:

On the old version of my blog, I would get relative URLs '/blog/<post_slug>', but now I'm getting '/blog/default/<post_slug>'.   SImilar behavior is occurring in the top-level navigation.  Has routing behavior changed?

I had forgotten to copy the root routes.py file from my old web2py directory.  Once I did that and restarted the server, all my app's routes.py rewrote URLs as expected.

Everything seems to be working :-).  Thanks for everyone's help.
Reply all
Reply to author
Forward
0 new messages