You are not logged in.
Pages: 1 2
Note: These instructions were written for the purpose of moving a old-style Plone 2.5.x instance to a Plone 2.5 buildout. If you want to create a Plone 3 buildout, please see http://forum.webfaction.com/viewtopic.php?id=2533
Today I moved my old, insecure Zope/Plone app to a shiny new buildout instance.. it's working well, so I thought I'd share the steps I took to do this.
Why use buildout?
WebFaction's control-panel-based app installers are great, but they don't give you an easy way to upgrade your Zope. What you install today might show up as "insecure" tomorrow. Each migration to a newer version requires that you create a new Zope app, move all of your products, and either move your Data.fs or export/import your Plone sites to the new Zope instance. Once all of that is done, you have to go through the app/domain/website mappings in the control panel and point all of your sites at the new Zope. Then, you get to do it all over again after the next vulnerability comes out. Quite a hassle!
If you use a buildout as a custom app, the control panel doesn't know anything about the software you're running. When you need to upgrade, you can just reconfigure and regenerate your buildout under the same app, so there's no need to create new apps, shuffle products and data around, and no need to reconfigure your site mappings.
Another excellent benefit of a Plone buildout is that you can keep your buildout configuration in subversion, which makes it a lot easier to develop locally and deploy on your live site when you're ready.
The only caveat here is that since WebFaction doesn't know what Zope/Plone versions you are running, the control panel will not advise you if you are running something that's insecure - so you need to stay on top of that yourself.
In this example, we're going to create a Plone 2.5 buildout as a custom application named 'newzope', then migrate our old Plone 2.5 app named 'zope' to the buildout.
Ok, moving right along...
Creating your buildout
What follows is not a comprehensive tutorial on buildout - for that, please see the excellent buildout tutorial at plone.org.
1. Log in to your WebFaction control panel account and create a new application named 'newzope'. Select 'Custom application (listening on port)' the type. Make a note of the port number that WebFaction assigns to your app. (more info here). While you're in the control panel, set up a subdomain and website for the new app so you can test it before you migrate.
2. Log in to your WebFaction account via SSH.
3. Install ZopeSkel - this will give you the tools you need to create the buildout.
easy_install-2.4 -d $HOME/lib/python2.4 -s $HOME/bin ZopeSkel
4. cd into the webapps directory:
cd ~/webapps
5. Create the buildout:
~/bin/paster create -t plone2.5_buildout newzope
6. The paster script will Q&A you through the initial setup. You can safely accept the defaults for everything EXCEPT the admin user name, admin password, and port number. Username and password should be the same as the old 'zope' app (since we're going to migrate it), and the port number should be the port number that was assigned to your app in step 1.
7. cd into the buildout directory:
cd newzope
8. Bootstrap the buildout environment:
python2.4 bootstrap.py
Note: if you already know what you're doing, you can tweak buildout.cfg before moving on to the next step.
9. Run the buildout:
./bin/buildout
10. Go grab some coffee or whatever while the buildout process installs and configures Zope and Plone.
11. When the buildout is complete, you can start your new Zope instance in the foreground with:
./bin/instance fg
If all went well, you'll see the usual long string of Zope startup junk. In your browser, go to the domain that you set up in step 1 to verify that Zope is running.
Note: you might want to shut down your old Zope before starting the new one to avoid blowing your RAM limit.
12. Stop your new Zope from the ZMI control panel, or with CTRL-C at the shell.
Migrating your old Zope
1. We don't want the old Zope restarting during this process, so we need to disable the restart job in the crontab:
crontab -e
Comment out (#) the line in your crontab that restarts your Zope. (It's the line that has the path to the old Zope app)
2. Stop your old Zope:
~/webapps/zope/Zope/bin/zopectl stop
3. Copy your old Zope data to the new Zope:
cp ~/webapps/zope/Zope/var/Data* ~/webapps/newzope/var/filestorage/
4. Copy any add-on Products (NOT core Plone products) to your new Zope:
cp -r ~/webapps/zope/Zope/Products/SomeProduct ~/webapps/newzope/products/
Note: the prior step is not the only (nor the preferred) way to get your old add-on products into your buildout, but it is the easiest way. See "Installing a third-party product" for more info.
5. Start your new Zope in the foreground:
./bin/instance fg
(Since we're moving from a functioning Plone 2.5 instance to a new Plone 2.5 instance, we shouldn't have any problem with products, but running Zope in the foreground will tell you for sure.)
6. If the new Zope started with no problems, and your old Plone instances are working, go ahead and stop Zope. If you had problems, stop Zope and fix them ![]()
7. Go back to your crontab ("crontab -e") and modify the command so it points to your new Zope. It should look something like this:
17,37,57 * * * * /home2/you/webapps/newzope/bin/instance start > /dev/null 2>&1
8. Start the new Zope in daemon mode:
./bin/instance start
9. In your browser, go to the WebFaction sites control panel and change all of your site app mappings from 'zope' to 'newzope'. (You'll only have to do this once - any future upgrades will occur within the buildout environment, which means the app remains the same.)
10. Check your sites on their actual domains. I received a 'bad gateway' response or something like that for the first couple of minutes, but the problem resolved itself.
11. Once you're convinced that everything is working as it should, you can delete the old Zope app from the WebFaction app control panel. (of course, it never hurts to make a backup first!)
That's it - you're finished!
If you try this, please let me know how it works out for you. And of course, if you have any questions about these steps, feel free to ask. ![]()
Last edited by sfulmer (2007-11-12 16:27:22)
Offline
I really was starting to wonder if I'd ever understand buildout enough to take advantage of it. Thanks to your How-To, I think I can use it now, understand it later. This is a HUGE help.
I have two questions:
1. When the next Plone release arrives, say, 2.5.5, what will the steps be to migrate to it?
2. The "copy products" step hides a fair amount of work to recall which products you've installed (not all are visible in Plone) and then copy them over. I decided to create a simple script for this, with the idea that from now on as I add products I'll update that script. But is there a way to automate this step? For example, copy all products installed after the products/README.TXT file was created? My script-fu is pretty weak, I'm afraid.
Regardless, thanks for writing and sharing this.
Offline
Like I said, this HOWTO is not a buildout tutorial, but...
mcombs64 wrote:
1. When the next Plone release arrives, say, 2.5.5, what will the steps be to migrate to it?
Look in your buildout.cfg for:
[plone] recipe = plone.recipe.distros urls = http://plone.googlecode.com/files/Plone-2.5.4-2.tar.gz nested-packages = Plone-2.5.4-2.tar.gz version-suffix-packages = Plone-2.5.4-2.tar.gz
Change the urls and packages to point to the appropriate versions, then re-run bin/buildout. You'll also want to check the ZMI for migration steps.
mcombs64 wrote:
2. The "copy products" step hides a fair amount of work to recall which products you've installed (not all are visible in Plone) and then copy them over. I decided to create a simple script for this, with the idea that from now on as I add products I'll update that script. But is there a way to automate this step? For example, copy all products installed after the products/README.TXT file was created? My script-fu is pretty weak, I'm afraid.
The HOWTO also is not a shell scripting tutorial ![]()
You should always keep track of your add-on products. If you can't figure out which products to copy, download a Plone tarball that matches your old version and look at the products it includes (CONTENTS.txt, or just look at the product dirs themselves) to determine which of your old products are Plone core, and which are not.
Read the plone.org buildout tutorial to learn how to set up third-party products in your buildout.cfg to avoid this kind of problem in the future, and to eliminate the need to write your own script to manage your add-ons.
Last edited by sfulmer (2007-11-13 10:51:31)
Offline
Thanks for the tutorial, i have setup the buildout without any problems, but i do have difficulty to transfer my Data.fs file.
it seems that it will copy the file to the root of my newzope and the controlpanel will be replaced with portal_controlplane, any ideas?
I would like to transfer my previous plone data to the new plone instance. (which i created with "add plone site" under zope"
Thank you,
StevenC
Offline
Stop both zopes and copy ~/webapps/oldzope/Zope/var/Data* to ~/webapps/newzope/var/filestorage/, then start the new zope. That's all there is to it.
Offline
Hi, i did exact that, the Data.fs does got copy over, but
my zope's "control_panel" was replaced with "portal_contralpanel" any ideas?
Thank you,
Offline
I'm almost certain that you are not accurately describing what you are seeing.
portal_controlpanel is the Plone tool responsible for managing Plone's control panel configlets. It does not replace the Zope app's control panel.
Are you sure you're at the top level of your ZMI?
Try creating a new subdomain mapped to newzope:/ , then go to thatdomain/manage.
Last edited by sfulmer (2007-11-13 14:05:36)
Offline
sfulmer, thanks for all the help.
Before i copy the Data.fs over, it shows top level's control_panel, after i copy over the database the domain will show plone's controlpanel, not sure where the topmost ZMI goes,
Also i have created a new subdomain to mapped to newzope, but it still pointing to the same portal_controlpanel.
Right now i am manually copy and pasting the content of my site, which is very painful. >_<
Offline
You shouldn't have to copy and paste anything. In fact, I don't even know how you would copy and paste from your old Zope to your new Zope.
If you have set up a new subdomain and mapped it to '/' on newzope here, and you're still being redirected to the plone site where you go to subdomain/manage, then maybe you've got a VHM mapping or a siteroot object or an access rule or a combination of those three in the way.. although I don't know why they would affect the new zope in this way and not the old.
Maybe instead of copying your Data.* stuff, you could export your old Plone sites from your old zope, delete Data.* on the new zope, start new zope (which will create new Data.*) then import the exported Plone sites into the new zope.
Last edited by sfulmer (2007-11-13 17:50:33)
Offline
You are correct, it is the VHM mapping that get me the trouble.
The old zope has VHM mapping set up so that all the other sub-domain will points to the zope/plone site, that's why i can not reach the top zope.
Again, thanks for all the help.
Offline
I'm still playing around with this but I thought I'd post my experience.
I tried changing my buildout.cfg to include most of the 3rd party products I'm using (example below). One simple benefit of this is that it not only provides a record of the products I'm using, it shows where I got them from.
After running buildout, I saw it had copied the source tar files into /downloads and the products into /parts/productdistros.
There were a few products that didn't fit this model:
* CalendarX. When you untar it, you get CalendarX-0.6.6 folder which must be manually renamed CalendarX. Putting it in the version-suffix-packages section didn't seem to help. The same thing happens for FSDump-0.9.3. I'm just renaming these by hand, but I have to do it after each buildout.
* The theme products I've built. For those products, I just copied them to the /products folder as your instructions showed.
* Products from SVN. I modified my buildout.cfg to get those products and put them into parts/svnproducts. I couldn't figure out how to put them in the same folder with other products.
Here's what I did. At the top of the file, I added a line for the svnproducts:
[buildout]
parts =
plone
zope2
productdistros
svnproducts
In the productdistros section, I put in most of my products.
[productdistros]
recipe = plone.recipe.distros
urls =
http://plone.org/products/archecsv/rele … checsv.zip
http://plone.org/products/cachefu/relea … Fu-1.1.tgz
http://prdownloads.sourceforge.net/cale … z?download
http://plone.org/products/cmfdifftool/r … ta1.tar.gz
http://plone.org/products/cmfeditions/r … 1.0rc1.tgz
http://plone.org/products/cmfsin/releas … in-0-7.tgz
http://plone.org/products/linguaplone/r … 0.1.tar.gz
http://plone.org/products/ploneformgen/ … _1-1-3.tgz
http://prdownloads.sourceforge.net/coll … z?download
http://plone.org/products/ploneboard/re … 1.0.tar.gz
http://plone.org/products/richdocument/ … 2-0.tar.gz
http://plone.org/products/richtopic/rel … 1-1-tar.gz
http://plone.org/products/scriptablefie … ds-1-1.tgz
http://plone.org/products/simpleportlet … 1.1.tar.gz
http://plone.org/products/dcworkflowdum … mp-1.2.tgz
http://www.zope.org/Members/shh/DocFind … 0.2.tar.gz
http://www.zope.org/Members/tseaver/FSD … 9.3.tar.gz
nested-packages =
CacheFu-1.1.tgz
CMFEditions-1.0rc1.tgz
LinguaPlone-1.0.1.tar.gz
scriptablefields-1-1.tgz
version-suffix-packages =
#CalendarX and FSDump must be manually renamed to remove the version number
Then, I added this section after [productdistros] to bring in products from subversion:
[svnproducts]
recipe = infrae.subversion
urls =
http://svn.plone.org/svn/collective/DCW … raph/trunk DCWorkflowGraph
Finally, I added a line so the subversion products would be found:
products =
${buildout:directory}/products
${productdistros:location}
${buildout:directory}/parts/svnproducts
${plone:location}
So far, it appears to install a working Zope instance with all of my sites. I've had trouble cutting over to the newzope, though. On most of my sites I'm getting "AttributeError: getHTTPCachingHeaders". I can access them through the ZMI, but no directly.
I think it's because I had cacheFu installed, and there's something in this process that isn't working correctly with cacheFu. That's just a total guess at this point, though.
Last edited by mcombs64 (2007-11-21 09:12:41)
Offline
I found out how to make CalendarX and FSDump install correctly using buildout. Change the version-suffix-packages to this:
version-suffix-packages =
CalendarX-0.6.6.tar.gz?download
FSDump-0.9.3.tar.gz
I was thrown off by the fact that CalendarX needed the ?download on the end, since there's a ?download on the end of its URL.
Offline
ZopeVersionControl, needed for CMFEditions, took me a little longer to find the URL for buildout. Here it is:
http://cvs.zope.org/Products/ZopeVersio … trol-0_3_4
Basically, you go to the page, then copy the URL from the "download tarball" link.
http://cvs.zope.org/Products/ZopeVersio … _4#dirlist
Offline
SFulmer, are you going to post this as a how-to on Plone.org/documenation?
Offline
mcombs64 wrote:
SFulmer, are you going to post this as a how-to on Plone.org/documenation?
Why would I? These are WebFaction-specific instructions, and the existing buildout tutorial already covers the general procedure.
A more appropriate place, IMO, would be in WebFaction's knowledge base.
Last edited by sfulmer (2007-11-26 16:13:25)
Offline
I think your how-to (versus a tutorial with explanation) is very helpful. I never quite got through the tutorial but your instructions made it work. If you removed some of the Webfaction-specifics and blended in my notes on adding products, it would be pretty complete and pretty short, the perfect how-to criteria.
I'd be willing to do it for you, if you think it's appropriate.
And yes, the version you have here should be in the Webfaction Knowledgebase.
Last edited by mcombs64 (2007-11-27 16:05:34)
Offline
I am in the process of trying to migrate from Plone 3.0.0 to Plone 3.0.5. I am not a programmer and I have VERY limited exposure to Linux. Translation: I know just enough about all this to be dangerous to myself and others. 80% of the terminology used on these fora (forums?) are either completely new to me or look very much like a sub-dialect of Ancient Akkadian and read totally different to how they look like they should read.
Here are my questions:
1. Where do I find the basic information to explain things like how to read a .txt file (there is a README.txt in my zope folder)
2. Is using the "tar process" a good way to backup my current information?
3. Where do I find information (tutorial or otherwise) on what Plone/Zope does with the information created within their site structures?
4. Where do I find information on the location of things like the data.fs file and what the devil to *do* with the data.fs file once I've found it.
5. How would one suggest I proceed in the matter of learning enough to actually manage my site without feeling like I have dived off the top floor of a cruise ship into the Atlantic Ocean, somewhere between Barbados and the Azores?
Signed,
Lost and overwhelmed--aka Shannon
Offline
I'm not too familiar with Plone/Zope but I'll answer what I can.
1) How do you see the .txt file? Are you using an FTP client, an SSH client, or something else?
2) Yeah.
4) Data.fs is located in ~/webapps/(Application Name)/Zope/var/. As for what to do with it, can you tell us what's telling you that you need to do something with it?
Re questions three and five, given Plone/Zope's complexity I'd imagine that a book is the way to go. Try searching Amazon?
Offline
3) & 5) You can start with "The Definitive Guide To Plone" - it is somewhat out-of-date, particularly regarding development topics, but still has excellent general info on Plone. Plus, it's a free book ![]()
If you're doing development, "Professional Plone Development" is indispensable.
Generally, the Plone documentation section of plone.org is an excellent resource, as are the Plone support forums and IRC channels. Since you mentioned migration in your original question, you should have a look at the Upgrade Guide.
Last edited by sfulmer (2008-01-30 13:53:33)
Offline
this just worked great for me, thanks!
one question i have concerns the "best match" for the ZopeSkel: on my local
(OSX) machine it matched to 2.7 while on webfaction it matches to 2.8. both
buildouts seem to have completed just fine, but as i want to keep the two as
parallel as possible, should i care?
Offline
rik wrote:
this just worked great for me, thanks!
one question i have concerns the "best match" for the ZopeSkel: on my local
(OSX) machine it matched to 2.7 while on webfaction it matches to 2.8. both
buildouts seem to have completed just fine, but as i want to keep the two as
parallel as possible, should i care?
You've probably got an older Python2.4 (or some other dependency) on your Mac that's holding the version of ZopeSkel back. WebFaction is using 2.4.3, so if you want to match versions, start there.
IMO, if your local Zope is functionally identical to your WF Zope, then don't worry about it ![]()
Offline
Will this buildout method work for Plone 3.1.4? I noticed that the universal installer requires Python 2.4.4 (rather than 2.4.3 you folks have installed).
Thanks
Offline
Pages: 1 2