Mailing List Archive

Zope 4 migration
hi all,

Python 2 is nearing end of life and the next weeks will be a horrible time
of migration and swearing for me. I will simply abandon many old
projects and websites but there is still a lot to do.

I have started looking into Zope 4. The recommended way to install it is to
use zc.buildout:

python3.7 -m venv .
bin/pip install -U pip zc.buildout
bin/buildout

Python 2 does not have a venv module and the recommended way to migrate is to
first migrate to Zope 4 with Python 2. Does the buildout thing work with
Python 2?

I managed to install Zope 4 using pip and get an instance running with
runwsgi. Now I am wondering how to stop it? How am I supposed to stop a
running instance? There seems to be no command and no option in the GUI.

Regards,

Michael Brunnbauer

--
++ Michael Brunnbauer
++ netEstate GmbH
++ Geisenhausener Stra?e 11a
++ 81379 M?nchen
++ Tel +49 89 32 19 77 80
++ Fax +49 89 32 19 77 89
++ E-Mail brunni@netestate.de
++ https://www.netestate.de/
++
++ Sitz: M?nchen, HRB Nr.142452 (Handelsregister B M?nchen)
++ USt-IdNr. DE221033342
++ Gesch?ftsf?hrer: Michael Brunnbauer, Franz Brunnbauer
++ Prokurist: Dipl. Kfm. (Univ.) Markus Hendel
Re: Zope 4 migration [ In reply to ]
hi all,

I made a first test with Zope 4 under Python 2 and my old ZODB. I followed
the instruction to delete all objects in the Products folder and pack the ZODB
with Zope 2:

https://zope.readthedocs.io/en/latest/migrations/zope4/zodb.html#delete-zodb-objects-that-no-longer-exist-under-zope-4

Then I shut down the old Zope and copied the Data.fs* files to Zope 4.
Now on calling http://hostname:8080 in my browser (the ZMI), I get:

Error Type: KeyError
Error Value: zope_quick_start

Am I missing something here? My old Zope is still 2.13.27 and not 2.13.29 but
I can't find anything in the Changelog hinting that this could be relevant.

Regards,

Michael Brunnbauer

On Wed, Dec 11, 2019 at 12:42:04PM +0100, Michael Brunnbauer wrote:
>
> hi all,
>
> Python 2 is nearing end of life and the next weeks will be a horrible time
> of migration and swearing for me. I will simply abandon many old
> projects and websites but there is still a lot to do.
>
> I have started looking into Zope 4. The recommended way to install it is to
> use zc.buildout:
>
> python3.7 -m venv .
> bin/pip install -U pip zc.buildout
> bin/buildout
>
> Python 2 does not have a venv module and the recommended way to migrate is to
> first migrate to Zope 4 with Python 2. Does the buildout thing work with
> Python 2?
>
> I managed to install Zope 4 using pip and get an instance running with
> runwsgi. Now I am wondering how to stop it? How am I supposed to stop a
> running instance? There seems to be no command and no option in the GUI.
>
> Regards,
>
> Michael Brunnbauer
>
> --
> ++ Michael Brunnbauer
> ++ netEstate GmbH
> ++ Geisenhausener Stra?e 11a
> ++ 81379 M?nchen
> ++ Tel +49 89 32 19 77 80
> ++ Fax +49 89 32 19 77 89
> ++ E-Mail brunni@netestate.de
> ++ https://www.netestate.de/
> ++
> ++ Sitz: M?nchen, HRB Nr.142452 (Handelsregister B M?nchen)
> ++ USt-IdNr. DE221033342
> ++ Gesch?ftsf?hrer: Michael Brunnbauer, Franz Brunnbauer
> ++ Prokurist: Dipl. Kfm. (Univ.) Markus Hendel



--
++ Michael Brunnbauer
++ netEstate GmbH
++ Geisenhausener Stra?e 11a
++ 81379 M?nchen
++ Tel +49 89 32 19 77 80
++ Fax +49 89 32 19 77 89
++ E-Mail brunni@netestate.de
++ https://www.netestate.de/
++
++ Sitz: M?nchen, HRB Nr.142452 (Handelsregister B M?nchen)
++ USt-IdNr. DE221033342
++ Gesch?ftsf?hrer: Michael Brunnbauer, Franz Brunnbauer
++ Prokurist: Dipl. Kfm. (Univ.) Markus Hendel
Re: Zope 4 migration [ In reply to ]
hi all,

uhhhh disregard that one - the ZMI is at /manage of course :-)

It works but zodbverify seems to complain about more than it should:

Found 4 records that could not be loaded.
Exceptions and how often they happened:
ImportError: No module named ZODBMountPoint.MountedObject: 1
ImportError: No module named SiteErrorLog.SiteErrorLog: 2
ImportError: No module named Product: 1

Regards,

Michael Brunnbauer

On Wed, Dec 11, 2019 at 01:18:20PM +0100, Michael Brunnbauer wrote:
>
> hi all,
>
> I made a first test with Zope 4 under Python 2 and my old ZODB. I followed
> the instruction to delete all objects in the Products folder and pack the ZODB
> with Zope 2:
>
> https://zope.readthedocs.io/en/latest/migrations/zope4/zodb.html#delete-zodb-objects-that-no-longer-exist-under-zope-4
>
> Then I shut down the old Zope and copied the Data.fs* files to Zope 4.
> Now on calling http://hostname:8080 in my browser (the ZMI), I get:
>
> Error Type: KeyError
> Error Value: zope_quick_start
>
> Am I missing something here? My old Zope is still 2.13.27 and not 2.13.29 but
> I can't find anything in the Changelog hinting that this could be relevant.
>
> Regards,
>
> Michael Brunnbauer
>
> On Wed, Dec 11, 2019 at 12:42:04PM +0100, Michael Brunnbauer wrote:
> >
> > hi all,
> >
> > Python 2 is nearing end of life and the next weeks will be a horrible time
> > of migration and swearing for me. I will simply abandon many old
> > projects and websites but there is still a lot to do.
> >
> > I have started looking into Zope 4. The recommended way to install it is to
> > use zc.buildout:
> >
> > python3.7 -m venv .
> > bin/pip install -U pip zc.buildout
> > bin/buildout
> >
> > Python 2 does not have a venv module and the recommended way to migrate is to
> > first migrate to Zope 4 with Python 2. Does the buildout thing work with
> > Python 2?
> >
> > I managed to install Zope 4 using pip and get an instance running with
> > runwsgi. Now I am wondering how to stop it? How am I supposed to stop a
> > running instance? There seems to be no command and no option in the GUI.
> >
> > Regards,
> >
> > Michael Brunnbauer
> >
> > --
> > ++ Michael Brunnbauer
> > ++ netEstate GmbH
> > ++ Geisenhausener Stra?e 11a
> > ++ 81379 M?nchen
> > ++ Tel +49 89 32 19 77 80
> > ++ Fax +49 89 32 19 77 89
> > ++ E-Mail brunni@netestate.de
> > ++ https://www.netestate.de/
> > ++
> > ++ Sitz: M?nchen, HRB Nr.142452 (Handelsregister B M?nchen)
> > ++ USt-IdNr. DE221033342
> > ++ Gesch?ftsf?hrer: Michael Brunnbauer, Franz Brunnbauer
> > ++ Prokurist: Dipl. Kfm. (Univ.) Markus Hendel
>
>
>
> --
> ++ Michael Brunnbauer
> ++ netEstate GmbH
> ++ Geisenhausener Stra?e 11a
> ++ 81379 M?nchen
> ++ Tel +49 89 32 19 77 80
> ++ Fax +49 89 32 19 77 89
> ++ E-Mail brunni@netestate.de
> ++ https://www.netestate.de/
> ++
> ++ Sitz: M?nchen, HRB Nr.142452 (Handelsregister B M?nchen)
> ++ USt-IdNr. DE221033342
> ++ Gesch?ftsf?hrer: Michael Brunnbauer, Franz Brunnbauer
> ++ Prokurist: Dipl. Kfm. (Univ.) Markus Hendel



> _______________________________________________
> Zope maillist - Zope@zope.org
> https://mail.zope.org/mailman/listinfo/zope
> ** No cross posts or HTML encoding! **
> (Related lists -
> https://mail.zope.org/mailman/listinfo/zope-announce
> https://mail.zope.org/mailman/listinfo/zope-dev )


--
++ Michael Brunnbauer
++ netEstate GmbH
++ Geisenhausener Stra?e 11a
++ 81379 M?nchen
++ Tel +49 89 32 19 77 80
++ Fax +49 89 32 19 77 89
++ E-Mail brunni@netestate.de
++ https://www.netestate.de/
++
++ Sitz: M?nchen, HRB Nr.142452 (Handelsregister B M?nchen)
++ USt-IdNr. DE221033342
++ Gesch?ftsf?hrer: Michael Brunnbauer, Franz Brunnbauer
++ Prokurist: Dipl. Kfm. (Univ.) Markus Hendel
Re: Zope 4 migration [ In reply to ]
Hi Michael,

we are all in the same boat with migrating old projects.

Although there is some pain, I am very happy that Zope is kept alive. Imagine you had to rewrite all Zope based applications from scratch.

There was an enormous effort from both the Zope and the Plone community to port it to Python 3.

In Python 2 you would use the `virtualenv` command to create a virtual environment
https://virtualenv.pypa.io/en/latest/

And yes, you can deploy Zope on Python 2 with buildout - that's how I run my app currently.

>I managed to install Zope 4 using pip and get an instance running with
>runwsgi. Now I am wondering how to stop it? How am I supposed to stop a
>running instance? There seems to be no command and no option in the GUI.

So, how did you start Zope?


As an advice - this list ist extremely low traffic, and I do not know how many Zope developers still read it.

There are two places where you usually get answers:
Either visit the Plone forum https://community.plone.org/ -> tag your question with "Zope"
or directly ask a question at github, for Zope e.g. https://github.com/zopefoundation/Zope
or concerning your other question about zodbupdate at https://github.com/zopefoundation/zodbupdate

I'd go for the community forum first (except you think you found a bug).

Best,
J?rgen
_______________________________________________
Zope maillist - Zope@zope.org
https://mail.zope.org/mailman/listinfo/zope
** No cross posts or HTML encoding! **
(Related lists -
https://mail.zope.org/mailman/listinfo/zope-announce
https://mail.zope.org/mailman/listinfo/zope-dev )
Re: Zope 4 migration [ In reply to ]
Hello J?rgen,

On Wed, Dec 11, 2019 at 12:47:13PM +0000, J?rgen Gmach wrote:
> So, how did you start Zope?

../4.1.3/bin/runwsgi -v etc/zope.ini

(my instance home is outside the virtual environment I installed Zope in)

I suppose I can send a signal to runwsgi to shut it down properly but which one?

> As an advice - this list ist extremely low traffic, and I do not know how many Zope developers still read it.

OK. What's the scope of this list? Am I also off topic?

> There are two places where you usually get answers

I'll try it there for further questions.

> or concerning your other question about zodbupdate at https://github.com/zopefoundation/zodbupdate

I did not mention zodbupdate, only zodbverify. Should I use zodbupdate
even in the step from Zope 2 to 4 with Python 2?

Regards,

Michael Brunnbauer

--
++ Michael Brunnbauer
++ netEstate GmbH
++ Geisenhausener Stra?e 11a
++ 81379 M?nchen
++ Tel +49 89 32 19 77 80
++ Fax +49 89 32 19 77 89
++ E-Mail brunni@netestate.de
++ https://www.netestate.de/
++
++ Sitz: M?nchen, HRB Nr.142452 (Handelsregister B M?nchen)
++ USt-IdNr. DE221033342
++ Gesch?ftsf?hrer: Michael Brunnbauer, Franz Brunnbauer
++ Prokurist: Dipl. Kfm. (Univ.) Markus Hendel
Re: Zope 4 migration [ In reply to ]
Hi Michael,

Am 11.12.2019 um 12:42 schrieb Michael Brunnbauer <brunni@netestate.de>:
[…]
> I have started looking into Zope 4. The recommended way to install it is to
> use zc.buildout:
>
> python3.7 -m venv .
> bin/pip install -U pip zc.buildout
> bin/buildout
>
> Python 2 does not have a venv module and the recommended way to migrate is to
> first migrate to Zope 4 with Python 2.

That’s right. See https://zope.readthedocs.io/en/4.x/zope4/migration/index.html for detailed information.

> Does the buildout thing work with Python 2?

The documentation says to use virtualenv instead of venv on Python 2.7, see
https://zope.readthedocs.io/en/4.x/INSTALL.html#built-in-standard-buildout-configuration

> I managed to install Zope 4 using pip and get an instance running with
> runwsgi. Now I am wondering how to stop it? How am I supposed to stop a
> running instance? There seems to be no command and no option in the GUI.

When using plain Zope Ctrl-C on the command line should be enough.
There is no button in the UI any more because the web server is no longer part of Zope itself. Instead you are able to use a WSGI server of your choice.
See https://zope.readthedocs.io/en/4.x/wsgi.html#choosing-wsgi-server-software for recommandations and example configurations.

--
Mit herzlichen Grüßen
Michael Howitz
Re: Zope 4 migration [ In reply to ]
Am 11.12.2019 um 13:44 schrieb Michael Brunnbauer <brunni@netestate.de>:
[…]
> It works but zodbverify seems to complain about more than it should:
>
> Found 4 records that could not be loaded.
> Exceptions and how often they happened:
> ImportError: No module named ZODBMountPoint.MountedObject: 1
> ImportError: No module named SiteErrorLog.SiteErrorLog: 2
> ImportError: No module named Product: 1

This means you have to install some packages (how to do this depends on your installation variant.)

ZODBMountPoint.MountedObject lives in the package Products.TemporaryFolder.
The SiteErrorLog lives in Products.SiteErrorLog.


--
Mit herzlichen Grüßen
Michael Howitz
Re: Zope 4 migration [ In reply to ]
Am 11.12.2019 um 14:03 schrieb Michael Brunnbauer <brunni@netestate.de>:
[…]
> I did not mention zodbupdate, only zodbverify. Should I use zodbupdate
> even in the step from Zope 2 to 4 with Python 2?

Best practice is to follow the upgrade steps described in the documentation.
Do not experiment with other ways unless you exactly know what you are doing.
If you have questions or the described way does not work, post to this list or open an issue in https://github.com/zopefoundation/Zope/issues.

--
Mit freundlichen Grüßen
Michael Howitz
Re: Zope 4 migration [ In reply to ]
Hello Michael,

On Thu, Dec 12, 2019 at 07:42:21AM +0100, Michael Howitz wrote:
> This means you have to install some packages (how to do this depends on your installation variant.)
>
> ZODBMountPoint.MountedObject lives in the package Products.TemporaryFolder.
> The SiteErrorLog lives in Products.SiteErrorLog.

Thank you very much for your help. I have some reservations about installing
Products.TemporaryFolder. See here:

https://pypi.org/project/Products.Sessions/

"The default session support under Zope 2 relied on Products.TemporaryFolder
for storing session data, which in turn used the tempstorage package.
tempstorage is no longer recommended because it has unfixed and possibly
unfixable issues under Zope 4 that lead to corrupted temporary storages."

Also, for me this means installing 8 Products after installing Zope with pip:
Sessions, ExternalMethod, PythonScripts, ZSQLMethods, ZMySQLDA, MailHost,
TemporaryFolder, SiteErrorLog.

Would the standard zc.buildout install already contain some of those?
I somehow got attached to the pip way over the years but maybe I should
really switch.

> The documentation says to use virtualenv instead of venv on Python 2.7, see
> https://zope.readthedocs.io/en/4.x/INSTALL.html#built-in-standard-buildout-configuration

Can't remember seeing that note yesterday :-) In any case - thanks!

Regards,

Michael Brunnbauer

--
++ Michael Brunnbauer
++ netEstate GmbH
++ Geisenhausener Stra?e 11a
++ 81379 M?nchen
++ Tel +49 89 32 19 77 80
++ Fax +49 89 32 19 77 89
++ E-Mail brunni@netestate.de
++ https://www.netestate.de/
++
++ Sitz: M?nchen, HRB Nr.142452 (Handelsregister B M?nchen)
++ USt-IdNr. DE221033342
++ Gesch?ftsf?hrer: Michael Brunnbauer, Franz Brunnbauer
++ Prokurist: Dipl. Kfm. (Univ.) Markus Hendel
Re: Zope 4 migration [ In reply to ]
Am 12.12.2019 um 10:22 schrieb Michael Brunnbauer <brunni@netestate.de>:
[…]
> Thank you very much for your help. I have some reservations about installing
> Products.TemporaryFolder.

You seem only to need ZODBMountPoint. But maybe you do not use server side sessions so you can live without TemporaryFolder which needs ZODBMountPoint to mount the temporary folder.
There is https://github.com/zopefoundation/Products.TemporaryFolder/issues/12 to extract ZODBMountPoint into its own package. Feel free to comment there if you actually need ZODBMountPoint without TemporaryFolder.

> See here:
>
> https://pypi.org/project/Products.Sessions/
>
> "The default session support under Zope 2 relied on Products.TemporaryFolder
> for storing session data, which in turn used the tempstorage package.
> tempstorage is no longer recommended because it has unfixed and possibly
> unfixable issues under Zope 4 that lead to corrupted temporary storages.“

This is only the case when using tempstorage, a RAM based storage implementation.
You could also configure an additional ZODB for the server side session data and mount it instead of using Products.TemporaryFolder.
This makes server side sessions persistent between restarts.

> Also, for me this means installing 8 Products after installing Zope with pip:
> Sessions, ExternalMethod, PythonScripts, ZSQLMethods, ZMySQLDA, MailHost,
> TemporaryFolder, SiteErrorLog.

That’s right, some Products were part of Zope2 or install dependencies.
Zope 4 is a but more lightweight. So you have to install the Products you need.

> Would the standard zc.buildout install already contain some of those?

No, you have to add them to buildout.cfg.

> I somehow got attached to the pip way over the years but maybe I should
> really switch.

If you know how to use pip: It’s okay to use it.
I personally find Buildout more convenient.

--
Mit freundlichen Grüßen
Michael Howitz
Re: Zope 4 migration [ In reply to ]
Hello Michael,

thanks. I'll install Products.TemporaryFolder to avoid the warnings but will
replace /temp_folder with a normal folder as recommended by the maintainers
of the Sessions product. Now let's see how the more complicated setups cope
with Zope 4 - LOL.

Regards,

Michael Brunnbauer

On Fri, Dec 13, 2019 at 07:46:29AM +0100, Michael Howitz wrote:
> Am 12.12.2019 um 10:22 schrieb Michael Brunnbauer <brunni@netestate.de>:
> [???]
> > Thank you very much for your help. I have some reservations about installing
> > Products.TemporaryFolder.
>
> You seem only to need ZODBMountPoint. But maybe you do not use server side sessions so you can live without TemporaryFolder which needs ZODBMountPoint to mount the temporary folder.
> There is https://github.com/zopefoundation/Products.TemporaryFolder/issues/12 to extract ZODBMountPoint into its own package. Feel free to comment there if you actually need ZODBMountPoint without TemporaryFolder.
>
> > See here:
> >
> > https://pypi.org/project/Products.Sessions/
> >
> > "The default session support under Zope 2 relied on Products.TemporaryFolder
> > for storing session data, which in turn used the tempstorage package.
> > tempstorage is no longer recommended because it has unfixed and possibly
> > unfixable issues under Zope 4 that lead to corrupted temporary storages.???
>
> This is only the case when using tempstorage, a RAM based storage implementation.
> You could also configure an additional ZODB for the server side session data and mount it instead of using Products.TemporaryFolder.
> This makes server side sessions persistent between restarts.
>
> > Also, for me this means installing 8 Products after installing Zope with pip:
> > Sessions, ExternalMethod, PythonScripts, ZSQLMethods, ZMySQLDA, MailHost,
> > TemporaryFolder, SiteErrorLog.
>
> That???s right, some Products were part of Zope2 or install dependencies.
> Zope 4 is a but more lightweight. So you have to install the Products you need.
>
> > Would the standard zc.buildout install already contain some of those?
>
> No, you have to add them to buildout.cfg.
>
> > I somehow got attached to the pip way over the years but maybe I should
> > really switch.
>
> If you know how to use pip: It???s okay to use it.
> I personally find Buildout more convenient.
>
> --
> Mit freundlichen Gr??en
> Michael Howitz
>



--
++ Michael Brunnbauer
++ netEstate GmbH
++ Geisenhausener Stra?e 11a
++ 81379 M?nchen
++ Tel +49 89 32 19 77 80
++ Fax +49 89 32 19 77 89
++ E-Mail brunni@netestate.de
++ https://www.netestate.de/
++
++ Sitz: M?nchen, HRB Nr.142452 (Handelsregister B M?nchen)
++ USt-IdNr. DE221033342
++ Gesch?ftsf?hrer: Michael Brunnbauer, Franz Brunnbauer
++ Prokurist: Dipl. Kfm. (Univ.) Markus Hendel