You are here: Home / Blog / posts / Pixelworkers of CAES DO / Plone 4 migration test-run!

Plone 4 migration test-run!

by pgang — published Feb 21, 2011 11:00 PM, last modified Jan 28, 2014 02:54 PM
You can ignore this, I'm just gonna putz around my personal server and see if I can't upgrade a few 3.1.7 websites to plone 4.0.2... (Spoiler alert: migration FAIL.)

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:

  1. 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.
  2. 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.
  3. To copy the data.fs over, ssh in to your server and do the following: 
    1. Stop the Plone 4 instance. Go to /webapps/yourPlone4instance/zinstance/bin and do ./instance stop
    2. 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.
    3. Stop your Plone 3 instance. Do something like /webapps/yourPlone3instance/zinstance/bin/instance stop
    4. Copy the data.fs over from there to here, so cp /webapps/yourPlone3instance/zinstance/var/filestorage/data.fs . <-- that last dot means "here" 
    5. Start up both instances again with /webapps/theinstancename/zinstance/bin/instance start
  4. 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. 
    1. 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__'
    2. ...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.
    3. 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...
    4. Oh man, one error:
      The version, 1.1.2, is not consistent with the requirement, 'plone.app.jquerytools>=1.2dev'.
      While:
        Installing instance.
      Error: Bad version 1.1.2

      Fffffuuuuu....
    5. 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...
      1. 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:
        NotFound('
        Site Error
        \n
        An error was encountered while publishing this resource.\n
        \n
        Resource not found
        \n\n Sorry, the requested resource does not exist.
        Check the URL and try again.
        Resource: http://new.apiq.webfactional.com/blah/front-page/document_view
        \n 

        ... 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.
  5. (In theory, this is where I'll pick up when hitting the @@plone-upgrade works).

 

When:

Where:

Contact