One of the most common issues organizations face with their website occurs when major upgrades to either the programming framework (e.g., Plone) and/or the programming language (e.g., Python) are announced. It’s critical for organizations to keep their websites on the latest supported version of the software to ensure their content stays secure, but the migration can get delayed due to cost, time and sometimes a general fear of what might break.
For small updates, the upgrade can take just a few hours, but for major updates, a complete migration will require an expert developer and weeks of work.
Six Feet Up, a software company that helps organizations build apps faster, innovate with AI, simplify Big Data and leverage cloud technology, recently completed a migration of its website from Plone 5.1.4 to Plone 5.2.4 and from Python 2.7 to Python 3. Because the website has a variety of add-ons and custom features that wouldn’t be compatible with Plone 5.2.4 and Python 3, Six Feet Up’s expert developers knew the migration would require a significant amount of testing and custom coding, but the benefits of upgrading to Python 3 far outweigh the risks.
To implement the upgrade, the developer’s first step was to examine the website’s existing content and functionality, including all add-ons that were previously installed. Specifically:
The older the site, the more complex this evaluation process is.
Six Feet Up’s website — which was built on Plone 5.0 — was relatively new, so there was limited cruft to update. Some add-ons, which were listed via Buildout and the backend of Plone, were deleted. Other add-ons — like PloneFormGen which is not compatible with Python 3 — had to be removed and replaced.
Once the evaluation was complete, the developers began writing and testing code. To ensure a seamless migration and limited downtime for the end-user, the developer made a copy of the website and housed it on their local machine.
First, all known incompatible add-ons were removed. Then, the website was moved to the latest version of Plone. Finally, everything was converted to Python 3. In addition to these 10 Tips for Upgrading to Python 3, resources from Plone and Python’s open-source communities including the Python Package Index’s (PyPI’s) zest.zodbupdate project description and forum posts in community.plone.org helped guide the process.
Each step in the process had a unique set of coding needs, so Six Feet Up’s senior Python developer and current Plone Foundation President, Chrissy Wainwright, worked on three different branches.
“It’s important to put as much into upgrade steps as you can so that you’re not having to do it manually through the web,” said Wainwright. “In the code repository, I had four branches for the Six Feet Up website migration. I had the code that was running on production, the code that was reviewed as part of the evaluation, the code that was needed to move everything to Plone 5.2.4, and the code that was needed to move everything to Python 3. This way, I have different versions of the code so that I can run all of my steps sequentially and it’s automating the process as much as possible.”
During this process, the developer added code, removed code and tested the upgraded site multiple times before migrating the database and officially sending the website to production.
After the website was evaluated and the code was updated to work on Plone 5.2.4 and Python 3, Six Feet Up’s RelStorage database — which was created in Python 2.7 — had to be migrated.
Specifically, the developers followed the below procedure (for more information about the technical background, read “Why do I have to migrate my database?”):
zodbupdate
will not update your database history and will leave old objects in place and you will not be able to pack your database in the future).zodbverify
. Solve integrity problems, if there are any.zodbupdate
.zodbverify
. If there are any problems, solve them and redo the migration.During the migration of Six Feet Up’s database, the developers ran into an issue with blobs (a.k.a. images and files) because of how they were mounted on the server. Newer versions of RelStorage recommend that blobs be part of the database. Once the developers moved the blobs into Postgres, the issue was corrected.
Following numerous tests and updates, the Six Feet Up website was published — complete with backend updates, community support and new features — on Plone 5.2.4 and Python 3.
As a result of the migration to Plone 5.2.4 and Python 3, Six Feet Up’s site:
Read more about the benefits of upgrading to Python 3 here.