How to Upgrade an Old Version of Plone?

I need help with updating a very old version—Plone 4.0.7—to at least Plone 4.3. Is there any step-by-step guide anyone can offer? The current build is on CentOS 6.

Hi @Everlasting!

This should get you going: https://docs.plone.org/4/en/manage/upgrading/version_specific_migration/index.html

Be sure to do that on a local copy and have backups available!

Let us know if you have any issue.

I've seen that page, but I have trouble locating the "setup.py" file which contains that line of code.

I've also tried updating through the way stated on this site: https://docs.plone.org/manage/upgrading/version_specific_migration/plone4_minor_upgrade.html

But I am given errors on several files whenever I run bin/buildout.

Would you mind posting the actual errors? This will be more useful for us, so we can diagnose the problem.

While:
Initializing.

An internal error occured due to a bug in either zc.buildout or in a
recipe being used:
Traceback (most recent call last):
File "/home/webadmin/[SITE NAME]/buildout-cache/eggs/zc.buildout-1.4.4-py2.6.egg/zc/buildout/buildout.py", line 1682, in main
user_defaults, windows_restart, command)
File "/home/webadmin/[SITE NAME]/buildout-cache/eggs/zc.buildout-1.4.4-py2.6.egg/zc/buildout/buildout.py", line 198, in init
data['buildout'].copy(), override))
File "/home/webadmin/[SITE NAME]/buildout-cache/eggs/zc.buildout-1.4.4-py2.6.egg/zc/buildout/buildout.py", line 1358, in _open
_update(eresult, _open(base, fname, seen, dl_options, override))
File "/home/webadmin/[SITE NAME]/buildout-cache/eggs/zc.buildout-1.4.4-py2.6.egg/zc/buildout/buildout.py", line 1306, in _open
path, is_temp = download(filename)
File "/home/webadmin/[SITE NAME]/buildout-cache/eggs/zc.buildout-1.4.4-py2.6.egg/zc/buildout/download.py", line 96, in call
local_path, is_temp = self.download(url, md5sum, path)
File "/home/webadmin/[SITE NAME]/buildout-cache/eggs/zc.buildout-1.4.4-py2.6.egg/zc/buildout/download.py", line 173, in download
tmp_path, headers = urllib.urlretrieve(url, tmp_path)
File "/home/webadmin/[SITE NAME]/Python-2.6/lib/python2.6/urllib.py", line 93, in urlretrieve
return _urlopener.retrieve(url, filename, reporthook, data)
File "/home/webadmin/[SITE NAME]/Python-2.6/lib/python2.6/urllib.py", line 239, in retrieve
fp = self.open(url, data)
File "/home/webadmin/[SITE NAME]/Python-2.6/lib/python2.6/urllib.py", line 207, in open
return getattr(self, name)(url)
File "/home/webadmin/[SITE NAME]/Python-2.6/lib/python2.6/urllib.py", line 362, in open_http
return self.http_error(url, fp, errcode, errmsg, headers)
File "/home/webadmin/[SITE NAME]/Python-2.6/lib/python2.6/urllib.py", line 379, in http_error
return self.http_error_default(url, fp, errcode, errmsg, headers)
File "/home/webadmin/[SITE NAME]/Python-2.6/lib/python2.6/urllib.py", line 385, in http_error_default
raise IOError, ('http error', errcode, errmsg, headers)
IOError: ('http error', 404, 'Not Found', <httplib.HTTPMessage instance at 0x20bbdd0>)

I'm also using a cloned site to test the update on, if that's somehow relevant.

good-py.appspot.com has been shutdown. You've to dowload this: https://archive.plone.org/good-py.appspot.com.tar.gz, unpack it, find your correct version of good-py, delete good-py extends entries in buildout.cfg and add the version of packages in [version] section of buildout.cfg.

I did this recently.

Plone community: please create a static version with the former tar.gz of good-py and tell people to replace good-py entries with the new address. That would help a lot in such cases. Or register the site again, maybe, with static content?

What do you mean by this? Is the correct version somewhere inside the download?

Yes. In buildout.cfg you should have agood-py entry, with an egg name and a version number. Match them in the tar.gz from the download.

These are the only things in the "versions" section:

[versions]
Cheetah = 2.2.1
Paste = 1.7.5.1
PasteScript = 1.7.3
Pillow = 1.7.2
Products.DocFinderTab = 1.0.4
ZopeSkel = 2.19
collective.recipe.backup = 1.7
collective.recipe.omelette = 0.10
plone.recipe.command = 1.1
plone.recipe.osxcontroller = 0.4
plone.recipe.unifiedinstaller = 4.0rc1

don't you've any goo-py entries in buildout.cfg? Check also base.cfg.

If not, check any external url you may have in your .cfg, one of them is returning 404 (Not Found)

No, wait. I found it in the "buildout" section.

extends =
base.cfg
versions.cfg
http://good-py.appspot.com/release/plone.app.registry/1.0b2
# http://dist.plone.org/release/4.0-latest/versions.cfg

This, right?

Yes, exactly! Comment it (adding # before it) and add the "versions" of plone.app.registry/1.0b2 from the good-py tar.gz you download from archive.plone.org: https://archive.plone.org/good-py.appspot.com.tar.gz

they should be these one:

collective.z3cform.datetimewidget = 1.0
plone.app.registry = 1.0b2
plone.app.textfield = 1.0b6
plone.app.z3cform = 0.5.0
plone.autoform = 1.0b4
plone.directives.form = 1.0b7
plone.formwidget.autocomplete = 1.0
plone.formwidget.contenttree = 1.0b1
plone.formwidget.namedfile = 1.0b5
plone.namedfile = 1.0b5
plone.registry = 1.0b2
plone.scale = 1.1
plone.supermodel = 1.0b5
plone.z3cform = 0.7.0
uuid = 1.30
z3c.batching = 1.1.0
z3c.blobfile = 0.1.4
z3c.form = 2.3.3
z3c.formwidget.query = 0.5
zc.sourcefactory = 0.6.0
zope.filerepresentation = 3.6.0
zope.schema = 3.6.4

Add them after the other versions in the [version] section, the final result should be:

[versions]
Cheetah = 2.2.1
Paste = 1.7.5.1
PasteScript = 1.7.3
Pillow = 1.7.2
Products.DocFinderTab = 1.0.4
ZopeSkel = 2.19
collective.recipe.backup = 1.7
collective.recipe.omelette = 0.10
plone.recipe.command = 1.1
plone.recipe.osxcontroller = 0.4
plone.recipe.unifiedinstaller = 4.0rc1
collective.z3cform.datetimewidget = 1.0
plone.app.registry = 1.0b2
plone.app.textfield = 1.0b6
plone.app.z3cform = 0.5.0
plone.autoform = 1.0b4
plone.directives.form = 1.0b7
plone.formwidget.autocomplete = 1.0
plone.formwidget.contenttree = 1.0b1
plone.formwidget.namedfile = 1.0b5
plone.namedfile = 1.0b5
plone.registry = 1.0b2
plone.scale = 1.1
plone.supermodel = 1.0b5
plone.z3cform = 0.7.0
uuid = 1.30
z3c.batching = 1.1.0
z3c.blobfile = 0.1.4
z3c.form = 2.3.3
z3c.formwidget.query = 0.5
zc.sourcefactory = 0.6.0
zope.filerepresentation = 3.6.0
zope.schema = 3.6.4

Should they be added only in the "versions" section or in the "buildout" section too? And which line do I comment out exactly? The one with the good-py link?

Only in the "versions" section, the one beginning with [versions]. Yes, comment the one with good-py link.

One more thing. Where should I unpack the files from the tar.gz? In the same directory as the buildout.cfg?

You don't have to unpack, just copy the text content. I've done it for you in a previous message:

[versions]
Cheetah = 2.2.1
Paste = 1.7.5.1
PasteScript = 1.7.3
Pillow = 1.7.2
Products.DocFinderTab = 1.0.4
ZopeSkel = 2.19
collective.recipe.backup = 1.7
collective.recipe.omelette = 0.10
plone.recipe.command = 1.1
plone.recipe.osxcontroller = 0.4
plone.recipe.unifiedinstaller = 4.0rc1
collective.z3cform.datetimewidget = 1.0
plone.app.registry = 1.0b2
plone.app.textfield = 1.0b6
plone.app.z3cform = 0.5.0
plone.autoform = 1.0b4
plone.directives.form = 1.0b7
plone.formwidget.autocomplete = 1.0
plone.formwidget.contenttree = 1.0b1
plone.formwidget.namedfile = 1.0b5
plone.namedfile = 1.0b5
plone.registry = 1.0b2
plone.scale = 1.1
plone.supermodel = 1.0b5
plone.z3cform = 0.7.0
uuid = 1.30
z3c.batching = 1.1.0
z3c.blobfile = 0.1.4
z3c.form = 2.3.3
z3c.formwidget.query = 0.5
zc.sourcefactory = 0.6.0
zope.filerepresentation = 3.6.0
zope.schema = 3.6.4

I tried executing bin/buildout now, and I think it updated to 4.0.10 successfully. But when I tried updating further to 4.3 this way, I get the following error:

Error: There is a version conflict.
We already have: zc.buildout 1.4.4
but zc.recipe.egg 1.3.2 requires 'zc.buildout>=1.5.0'.

The problem is that I already have zc.buildout 2.9.4.

Upgrade to 4.3 means reading the guide:

https://docs.plone.org/4/en/manage/upgrading/version_specific_migration/p40_to_p41_upgrade.html Upgrading from 4.0 to 4.1

and

https://docs.plone.org/4/en/manage/upgrading/version_specific_migration/p42_to_p43_upgrade.html

Upgrading Plone 4.2 to 4.3

This means also check if the versions are still needed, check the extensions compatibility and so on.