Upgrading Python version for existing Plone installation

I have a Plone 4 site running on Ubuntu 14.04, with Python 2.7.6. The server was setup with our ansible playbook, so it's a pretty standard buildout with virtualenv, but the Python it uses is the default one that comes with Ubuntu 14.04.

If I wanted to upgrade to a more recent version of Python (for TLS 1.2 reasons), is there any way to do it "in place"?
My naive approach would be to install (or build) the newer Python, then start from scratch with a new virtualenv, buildout, etc. Once everything was working I would then delete the old installation. But if there is a quicker way, I'd love to know.

Thanks

Depends on...what I usually do is:

  • cd into existing buildout directory
  • rm bin libs include folder
  • virtualenv-2.7 .
  • bin/pip install zc.buildout
  • bin/buildout bootstrap
  • bin/buildout -c your.cfg

In some rare cases it might be necessary to remove the related eggs cache directory.

-aj

You should be able to just edit the shebangs of the generated scripts to point to the new Python as the scripts themselves manage the site packages for you.

If you build your own Python you will have to delete the compiled eggs (e.g., rm -rf *-py2.7-linux-x86_64.egg).
The *-py2.7.egg eggs are safe.

1 Like

Thanks, guys! I'll report back when I embark in this project.

If one is just bugfix updating within the same Python version, should they not still remain ABI compliant?

Relying on any LD_* magic voids most warranties by being so far off the beaten path, though.