Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7603993
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T23:47:39+00:00 2026-05-30T23:47:39+00:00

my.packages is a custom archetypes package in the src directory. Thousands of items in

  • 0

my.packages is a custom archetypes package in the src directory. Thousands of items in the Plone instance are added with its types. I want to rename the package as my.package. By simply uninstalling my.packages and installing my.package, I find http://localhost:8080/mysite/myfolder/my-item showing <persistent broken my.packages.content.mytype.MyType instance '\x00\x00\x00\x00\x00Un^'>. Should I have to do migration? Or is there a simple way to fix this issue?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T23:47:41+00:00Added an answer on May 30, 2026 at 11:47 pm

    You can create an alias for backward compatibility, by fudzing with sys.modules. Do this in your package __init__.py:

     import sys
     sys.modules['my.packages'] = sys.modules[__name__]
    

    This way the persistence machinery can find your classes still.

    What happens is that when your Archetypes instances are persisted in the ZODB, the persistence machinery stores a module path for the class (a dotted python path such as my.packages.types.foobar.FooBar) in the stored data. When restoring an object from the ZODB, that same path is then used to re-create your instances. When you rename your package, all these references are broken.

    With the above trick, the nice thing is that if your object were changed and written to the ZODB again in a transaction, the new module path will be stored. You could thus conceivable cause a write to all your Archetypes instances from this package to make the migration permanent so you can remove the above work-around again.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to setup a custom site-package directory (Python 2.6 on Windows Vista). For
I have 2 custom objects: 'Package' and 'Order'. 'Order' includes 'Package' field and some
Is including a application package prefix while defining a custom action string is convention
In a VS Package (Visual Studio Extensibility), I have a custom extension registered (for
The following is the custom class, whose object I am trying to pass: package
SSIS (SQL 2005) packages that have a script task that invoke custom .NET dlls
I'm using a custom NuGet feed for deploying own NuGet packages. I'm using semver
We have a set of VS 2008 packages which leverages custom Project/Item templates, designers
We build all our packages to the same output directory. The directory includes both
In my custom Burn managed bootstrapper application, I want a way to set the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.