ISSUE RESOLVED.

My original SQL dump didn't have extra table options, like AUTO_INCREMENT, 
which cause the problem below.
Next I've been getting errors during rb-site upgrade command, but then 
after a couple of hours of research I realised that RB switched to InnoDB 
as a default table engine. So I search&replaced my sql dump file and ran 
the upgrade again with success.

Thanks for all your help.

-- 
Michał




On Tuesday, October 2, 2012 9:47:31 AM UTC+2, Michal Musial wrote:
>
> Hi Christian,
>
> Thanks very much for your reply.
> So I did what you suggested, but when running site upgrade I'm getting 
> mysql errors:
> ----------------------------------------
> Traceback (most recent call last):
>   File "/usr/local/bin/rb-site", line 8, in <module>
>     load_entry_point('ReviewBoard==1.6.12', 'console_scripts', 'rb-site')()
>   File 
> "/usr/local/lib/python2.7/site-packages/ReviewBoard-1.6.12-py2.7.egg/reviewboard/cmdline/rbsite.py",
>  
> line 1745, in main
>     command.run()
>   File 
> "/usr/local/lib/python2.7/site-packages/ReviewBoard-1.6.12-py2.7.egg/reviewboard/cmdline/rbsite.py",
>  
> line 1642, in run
>     site.sync_database()
>   File 
> "/usr/local/lib/python2.7/site-packages/ReviewBoard-1.6.12-py2.7.egg/reviewboard/cmdline/rbsite.py",
>  
> line 346, in sync_database
>     self.run_manage_command("syncdb", params)
>   File 
> "/usr/local/lib/python2.7/site-packages/ReviewBoard-1.6.12-py2.7.egg/reviewboard/cmdline/rbsite.py",
>  
> line 469, in run_manage_command
>     execute_manager(reviewboard.settings, [__file__, cmd] + params)
>   File 
> "/usr/local/lib/python2.7/site-packages/django/core/management/__init__.py", 
> line 438, in execute_manager
>     utility.execute()
>   File 
> "/usr/local/lib/python2.7/site-packages/django/core/management/__init__.py", 
> line 379, in execute
>     self.fetch_command(subcommand).run_from_argv(self.argv)
>   File 
> "/usr/local/lib/python2.7/site-packages/django/core/management/base.py", 
> line 191, in run_from_argv
>     self.execute(*args, **options.__dict__)
>   File 
> "/usr/local/lib/python2.7/site-packages/django/core/management/base.py", 
> line 220, in execute
>     output = self.handle(*args, **options)
>   File 
> "/usr/local/lib/python2.7/site-packages/django/core/management/base.py", 
> line 351, in handle
>     return self.handle_noargs(**options)
>   File 
> "/usr/local/lib/python2.7/site-packages/django/core/management/commands/syncdb.py",
>  
> line 109, in handle_noargs
>     emit_post_sync_signal(created_models, verbosity, interactive, db)
>   File 
> "/usr/local/lib/python2.7/site-packages/django/core/management/sql.py", 
> line 190, in emit_post_sync_signal
>     interactive=interactive, db=db)
>   File 
> "/usr/local/lib/python2.7/site-packages/django/dispatch/dispatcher.py", 
> line 172, in send
>     response = receiver(signal=self, sender=sender, **named)
>   File 
> "/usr/local/lib/python2.7/site-packages/django/contrib/auth/management/__init__.py",
>  
> line 30, in create_permissions
>     ctype = ContentType.objects.get_for_model(klass)
>   File 
> "/usr/local/lib/python2.7/site-packages/django/contrib/contenttypes/models.py",
>  
> line 38, in get_for_model
>     defaults = {'name': smart_unicode(opts.verbose_name_raw)},
>   File 
> "/usr/local/lib/python2.7/site-packages/django/db/models/manager.py", line 
> 135, in get_or_create
>     return self.get_query_set().get_or_create(**kwargs)
>   File "/usr/local/lib/python2.7/site-packages/django/db/models/query.py", 
> line 385, in get_or_create
>     obj.save(force_insert=True, using=self.db)
>   File "/usr/local/lib/python2.7/site-packages/django/db/models/base.py", 
> line 460, in save
>     self.save_base(using=using, force_insert=force_insert, 
> force_update=force_update)
>   File "/usr/local/lib/python2.7/site-packages/django/db/models/base.py", 
> line 553, in save_base
>     result = manager._insert(values, return_id=update_pk, using=using)
>   File 
> "/usr/local/lib/python2.7/site-packages/django/db/models/manager.py", line 
> 195, in _insert
>     return insert_query(self.model, values, **kwargs)
>   File "/usr/local/lib/python2.7/site-packages/django/db/models/query.py", 
> line 1436, in insert_query
>     return query.get_compiler(using=using).execute_sql(return_id)
>   File 
> "/usr/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py", 
> line 791, in execute_sql
>     cursor = super(SQLInsertCompiler, self).execute_sql(None)
>   File 
> "/usr/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py", 
> line 735, in execute_sql
>     cursor.execute(sql, params)
>   File 
> "/usr/local/lib/python2.7/site-packages/django/db/backends/mysql/base.py", 
> line 86, in execute
>     return self.cursor.execute(query, args)
>   File 
> "/usr/local/lib/python2.7/site-packages/MySQL_python-1.2.3-py2.7-freebsd-9.0-RELEASE-amd64.egg/MySQLdb/cursors.py",
>  
> line 174, in execute
>     self.errorhandler(self, exc, value)
>   File 
> "/usr/local/lib/python2.7/site-packages/MySQL_python-1.2.3-py2.7-freebsd-9.0-RELEASE-amd64.egg/MySQLdb/connections.py",
>  
> line 36, in defaulterrorhandler
>     raise errorclass, errorvalue
> _mysql_exceptions.OperationalError: (1364, "Field 'id' doesn't have a 
> default value")
> ----------------------------------------
>
> This seems to me is a consequence of changing mysql versions (5.0 -> 5.5). 
> Is there any automation to check for incompatibilities like this one so I 
> don't have to go through 46 table structures manually?
>
> -- 
> Michał
>
>
> On Monday, October 1, 2012 10:32:35 PM UTC+2, Christian Hammond wrote:
>>
>> Hi Michal,
>>
>> First, whatever you do, back up your database using mysqldump.
>>
>> You should be able to create a new site installation on the new box with 
>> the latest 1.6.x of Review Board. Then completely wipe the resulting MySQL 
>> database. You may also want to copy over anything else from your old site's 
>> media/uploaded directory.
>>
>> Once you've done that, import your old database, and then perform a site 
>> upgrade (rb-site upgrade /path/to/site).
>>
>> This should upgrade the database and get you in shape.
>>
>> If you hit any snags (1.0.5.x is pretty old), let us know.
>>
>> Christian
>>
>> -- 
>> Christian Hammond - chi...@chipx86.com
>> Review Board - http://www.reviewboard.org
>> VMware, Inc. - http://www.vmware.com
>>
>>
>> On Mon, Oct 1, 2012 at 9:33 AM, Michal Musial <michal....@gmail.com>wrote:
>>
>>> Hello Everyone,
>>>
>>> I am currently running a ReviewBoard 1.0.5.1 on FreeBSD 7.2 installation 
>>> from 3
>>> years ago with following software:
>>> - python 2.6.4
>>> - mysql 5.1.41
>>> - django 1.1.1
>>> - subversion 1.6.4
>>>
>>> I've got a new FreeBSD 9.0 server ready to upgrade & migrate the RB to:
>>> - python 2.7.3
>>> - mysql 5.5.27
>>> - django 1.3.3
>>> - subversion 1.7.6
>>>
>>> Can someone suggest a strategy for this? I'd like to upgrade to latest 
>>> stable
>>> (1.6.12).
>>>
>>> I was hoping there was a way to import data from the old version and do 
>>> an
>>> upgrade on the new server to avoid touching a live server and to avoid
>>> dependencies upgrades which potentially can fail and cause a lot more 
>>> work, but
>>> I worry that I newer software version on the new server won't handle it 
>>> well.
>>>
>>> Will `easy_install -U ReviewBoard` take care of the upgrade process 
>>> nicely and
>>> upgrade necessary (python) dependencies if required? If this goes well, 
>>> should I
>>> expect any problems with different MySQL and Subversion versions on the 
>>> servers?
>>>
>>> It's probably worth noting that I have near-zero experience with RB and 
>>> Python,
>>> but I am decent with FreeBSD and web servers.
>>>
>>> -- 
>>> Regards,
>>> Michał.
>>>
>>> PS. First time poster here, I hope I didn't break any rules.
>>>
>>>  -- 
>>> Want to help the Review Board project? Donate today at 
>>> http://www.reviewboard.org/donate/
>>> Happy user? Let us know at http://www.reviewboard.org/users/
>>> -~----------~----~----~----~------~----~------~--~---
>>> To unsubscribe from this group, send email to 
>>> reviewboard...@googlegroups.com
>>> For more options, visit this group at 
>>> http://groups.google.com/group/reviewboard?hl=en
>>
>>
>>

-- 
Want to help the Review Board project? Donate today at 
http://www.reviewboard.org/donate/
Happy user? Let us know at http://www.reviewboard.org/users/
-~----------~----~----~----~------~----~------~--~---
To unsubscribe from this group, send email to 
reviewboard+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/reviewboard?hl=en

Reply via email to