Before I can import projects, I need to import users.

I have an export script that will dump all user data to a CSV.  So now I need to write another script to read that CSV and create a new member object for each row.

Apparently it is not possible (at least not easily possible) to create a Plone member through a zopectl script.  Trying to reuse code from opencore’s member join view fails with strange exceptions.  So does this script

The exceptions are things like AttributeError: unicodeEncode on the context object in Archetypes schema validation code, or “Called without a request as the context” messages in Products.Five.i18n calls.

It turns out these are all (one way or another) happening because we’re running it from a zopectl run script.  If you run the same code through a browser view, it works — because there you have a real request and have access to pythonscript content that doesn’t exist outside of an HTTP request.  (The unicodeEncode method is apparently one of these.)

So, I’m going to create a site-manager-only view in opencore/browser/ which will trigger the member import code.

Filed June 2nd, 2013 under openfsm

Today I will:

* Commit the fixes I made the other week when dealing with real content exports

* Add code to write each backup file to a text flie, so that I can find them later during import, and keep track of which projects have already been updated

* Run a new partial export and then try an import from it

* Blog again here  

Filed June 2nd, 2013 under Uncategorized