Sorry for the delay in responding: was looking to see if I could find
anything relevant in my notes from the migrations I've done on
tidldyspace.com. And having dinner.
On Thu, 14 Mar 2013, Kim Rostgaard Christensen wrote:
>>> Now twanager migrate gives me
>>> ERROR: OperationalError: ('(OperationalError) (1005, "Can\'t create
>> table
>>> \'tiddlyspace.current_revision\' (errno: 150)")',)
>>
>
> The errors (1005 and 150) indicate that it is a foreign key constraint that
> fails.
>
http://dev.mysql.com/doc/refman/5.5/en/innodb-foreign-key-constraints.html
Hard to know at this point if this is cause or symptom of something
else. Before each migration attempt make sure you are dropping the
new database, to clear any metadata. I found that innodb gets very
very persnickety when the starting conditions aren't just right.
Searching google shows that that error will often show up when
creating tables (that have foreign key relations) fails for any reason.
If the tables aren't all created at the same time, there can be issues.
>> * Have you set privileges properly on tiddlyspace
>
> How do I test this?
I meant "tiddlyspace2", meaning "did you do the GRANT" step? Sorry for
the typo.
>> * Are you running `twanager migrate` as the user who is configured to
>> be able to access the database (both according target_store's values
>> and the values you used when granting privileges)
>>
> The two users don't have access to each others databases, I will try to
> give them that, for the time being.
Assuming you are configuring the user for the databases in the
server_store and target_store entries, then using a different database
user for each should be okay. In my own use of tiddlyweb and mysql I
always use the same Unix user for the tiddlyweb web instance and for
the database user (so don't need to config the user in server_store
and target_store). As you've discovered you can set the user and
password for the database in config and that ought to work.
As far as I know you're the second person to attempt this and you're
doing it under difficult circumstances given the awkward starting
conditions.
My notes from going from mysql2 to mysql3 are here
http://cdent.tiddlyspace.com/20120321
but not likely to be that useful. Most of my problems came about from
mysqld getting very upset when I tried to rename the database.
Actually just now writing "difficult circumstances" has given me an
idea. You've already upgraded the tiddlyspace code, which means that
your server_store is pointing indirectly to mysql3 thus trying to use
the wrong schema on an existing database, so try this:
* Make sure anything (like apache) that would be reading the tiddlyweb
store is shut down.
* Determine if your old tiddlyweb mysql code was
tiddlywebplugins.mysql or tiddlywebplugins.mysql2. Looking in
/usr/local/lib/python2.6/dist-packages/tiddlywebplugins/ will likely
have 2 of mysql, mysql2 and mysql3. Whichever of mysql or mysql2 you
have, use that in server_store below.
* Edit tiddlywebconfig.py in the instance to set target_store and
override server_store:
'server_store': ['tiddlywebplugins.mysql', { 'db_config':
'mysql:///tiddlyspace?user=blala&pass=nothintoseehere}],
'target_store': ['tiddlywebplugins.mysql3', { 'db_config':
'mysql:///tiddlyspace2?user=tiddlyweb&charset=utf8&use_unicode=0'}]
* Do the `twanager migrate`
* Edit tiddlywebconfig.py again to change target_store to
'target_store': ['tiddlywebplugins.tiddlyspace.store', { 'db_config':
'mysql:///tiddlyspace2?user=tiddlyweb&charset=utf8&use_unicode=0'}]
OR update the config.py file in dist-packages you were using originally,
accordingly.
* Do the lbags and other recommended tests.
* Let me know if it works. If it does I'll update the migration
tiddler to include special instructions for tiddlyspace.
>> If you're an IRC user, I'll be on
irc.freenode.net in the #tiddlyspace
>> and #tiddlyweb channels throughout most of this evening if you continue
>> to have issues and you prefer that kind of interaction. Here's fine too.
>>
> I'm also on freenode, but here is fine for now - it's up to you.
>
> Personally, I think it is better to leave it public for others who may be
> in the same situation.
Ah nice, if only more people felt this way.