Plone 4 migration test-run!
Who wakes up on the Monday of a three-day weekend and says, my look how sunny it is outside! I think today is a great day to upgrade my Plone server! Well apparently, it happens. Here're the deets: I haz one personal server hosted by Webfaction (they're awesome by the way, always quick & thorough with their customer service) that houses a few extracurricular or volunteer websites. They've been on Plone 3.1.7 since I first set up the account.
First thoughts — where the hell do I start? Luckily a Google search turned up one article from Webfaction's support docs that suggests just starting up a new Plone 4 instance, copying over the data.fs from the old Plone 3 instance, and then just doing the migrations on there. Sure, sounds good. Here's what I did:
- On Webfaction's control panel, creating a new instance is as easy as clicking a few buttons. Went to Domains/Websites > Applications. Hit the Add new button in the bottom right, and choose App Category: Zope, then App: Zope 2.12.13 - Plone 4.0.2. Give your instance a name, hit Create, set it, aaand forget it! A few minutes later you're golden.
- Once it's all good, create a Domain for it under Domains/Websites > Domain. Then go to Websites under Domains/Websites > Websites and create a new one for your new instance. Select the Subdomain you just made from the list, and in Site apps choose the name of your new instance. Enter a / for the URL Path.
- To copy the data.fs over, ssh in to your server and do the following:
- Stop the Plone 4 instance. Go to /webapps/yourPlone4instance/zinstance/bin and do ./instance stop
- Go to your data.fs, it's in /webapps/yourPlone4/instance/zinstance/var/filestorage. I think you can just empty this directory, but since I'm paranoid I just renamed all the existing data.fs.whatevs files there to data.fs.whatevs-old.
- Stop your Plone 3 instance. Do something like /webapps/yourPlone3instance/zinstance/bin/instance stop
- Copy the data.fs over from there to here, so cp /webapps/yourPlone3instance/zinstance/var/filestorage/data.fs . <-- that last dot means "here"
- Start up both instances again with /webapps/theinstancename/zinstance/bin/instance start
- Good! Now get into the ZMI of your new Plone 4 server (http://whateveryournewdomainis.com/manage). Once you click into any of your sites, you'll be prompted with a nice big warning that, oh shit you've got an old version of Plone here! Click the Continue with upgrade link there and proceed to step 5.
- But wait, what if you click into a site and get an error? I hit this on one of my sites:
Error Type: AttributeError
Error Value: type object 'ICalendarSupport' has no attribute '__iro__'
- ...a nice reminder that I had add-on products installed and completely forgot about 'em! Much like Macaulay Culkin in Home Alone, they're less than pleased with the situation.
- Okay so from here, I went back and copied in the eggs I needed from my old buildout.cfg to my new buildout.cfg (and the zcml's as necessary!). Ran buildout, seemingly ended well, started up the instance but no dice!
Error: error opening file /home/blah/webapps/zope2/zinstance/parts/instance/etc/zope.conf: [Errno 2] No such file or directory: '/home/blah/webapps/zope2/zinstance/parts/instance/etc/zope.conf'
Missing zope.conf? Turns out this just means buildout didn't run as successfully as I'd hoped. So looking back...
- Oh man, one error:
The version, 1.1.2, is not consistent with the requirement, 'plone.app.jquerytools>=1.2dev'.
Error: Bad version 1.1.2
- Right. Googling that, I found that maybe Products.PloneFormGen is requiring a newer version of jquerytools, but that pinning an older version (<=1.7dev) should work. (Here and here.) Side note, because I didn't know what pinning an older version meant: apparently you can just put Products.PloneFormGen<=1.7dev in the egg section of buildout.cfg! Fancy that. Run buildout, start the instance, and...
- Okay new dilemma. The instance starts fine! The offending project from above (AttributeError) now opens correctly and can proceed to the next step. Some of my other sites, however, are not so lucky. The new error, when clicking on the name in the ZMI, is:
('Could not adapt', , )
What's that? Adapt what, now? And then the error that shows up when trying to access the page directly is, oddly:
An error was encountered while publishing this resource.\n
Resource not found
\n\n Sorry, the requested resource does not exist.
Check the URL and try again.
... Okay I think I need to throw in the towel for today. Accessing a different website gives me this lovely super long error, and Google has not been my friend for the past hour (and to be honest I left and got Korean food, because I thought that would help :P). Ah well, it was so promising! I suppose when I pick this back up, I'll try uninstalling the products I don't need on the Plone 3 instance and then re-importing the Data.fs. Til next time.
- (In theory, this is where I'll pick up when hitting the @@plone-upgrade works).