Hi Kevin,

I meant wiping it before doing any imports. Just making sure you're
importing into a fresh, empty database.

The order you'll want is:

1) Create the database (or wipe it if it already exists).
2) Import the SQL dump.
3) Run rb-site upgrade.

Christian

-- 
Christian Hammond - chip...@chipx86.com
Review Board - http://www.reviewboard.org
Beanbag, Inc. - http://www.beanbaginc.com


On Fri, Mar 14, 2014 at 3:42 PM, Kevin Phillips <
kevin.grenville.phill...@gmail.com> wrote:

> Christian;
>
> Thanks for the quick response. I definitely agree that the monkey-patches
> I made are not fit for production (I just really wanted to make it work).
> As it turns out, I didn't even need them. django-evolutions is at 0.6.9 per
> your suggestion. My tables are MYISAM, which I must be converted to InnoDB
> to play well. I feared I might be locked into mod_python, but it sounds
> like I can go with -- and really SHOULD -- mod_wsgi (which I prefer).
>
> Can you clarify what you mean by completely wiping the database? Do you
> mean schema and data or just data?
>
> We have two sites, one 1.5.2 and another that is 1.7.14. We made very
> heavy modifications to post-review for both versions. Given the amount of
> work to re-wrap post-review, I would rather unify the environment and reuse
> what I have already done. It is partially because I don't have time to
> investigate the changes between versions and mitigate any of the associated
> risks/missteps.
>
>  I had figured you would need more detailed information so I ran through
> the migrate this morning. Here is what I have.
> 1. easy_install Reviewboard==1.7.14 Django==1.4.10 MySQL-python
> python-memcached
> 2. mysql -u root -p < restore_reviewboard_db.sql (this includes users, but
> given your suggestion to wipe the db I do not restore schema or table rows)
> 3. scp user@oldhost:/var/www/review.company.com /var/www/
> 4. sudo rb-site --version (verfiy I am using 1.7.14)
> 5. sudo scp user@oldhost:/var/www/
> review.company.com/conf/settings_local.py/usr/local/lib/python2.7/dist-packages/Reviewboard-1.7.14-py2.7.egg/reviewboard/
> 6. if [[ $(grep -q 'evolution-0.6.9
> /usr/local/lib/python2.7/dist-packages/) -eq 0 ]]; then echo
> 'django-evolution is present with the correct version'; fi (this echo'd the
> string)
> 7. sudo rb-site upgrade /var/www/review.company.com (this produced the
> django db ENGINE exception, but I realized this was only due to changes in
> the configuration)
> 8. !!
> This throws:
> Traceback (most recent call last):
>   File "/usr/local/bin/rb-site", line 9, in <module>
>     load_entry_point('ReviewBoard==1.7.14', 'console_scripts', 'rb-site')()
>   File
> "/usr/local/lib/python2.7/dist-packages/ReviewBoard-1.7.14-py2.7.egg/reviewboard/cmdline/rbsite.py",
> line 2027, in main
>     command.run()
>   File
> "/usr/local/lib/python2.7/dist-packages/ReviewBoard-1.7.14-py2.7.egg/reviewboard/cmdline/rbsite.py",
> line 1837, in run
>     static_media_upgrade_needed = site.get_static_media_upgrade_needed()
>   File
> "/usr/local/lib/python2.7/dist-packages/ReviewBoard-1.7.14-py2.7.egg/reviewboard/cmdline/rbsite.py",
> line 385, in get_static_media_upgrade_needed
>     siteconfig = SiteConfiguration.objects.get_current()
>   File
> "/usr/local/lib/python2.7/dist-packages/Djblets-0.7.28-py2.7.egg/djblets/siteconfig/managers.py",
> line 47, in get_current
>     site = Site.objects.get_current()
>   File
> "/usr/local/lib/python2.7/dist-packages/Django-1.4.10-py2.7.egg/django/contrib/sites/models.py",
> line 25, in get_current
>     current_site = self.get(pk=sid)
>   File
> "/usr/local/lib/python2.7/dist-packages/Django-1.4.10-py2.7.egg/django/db/models/manager.py",
> line 131, in get
>     return self.get_query_set().get(*args, **kwargs)
>   File
> "/usr/local/lib/python2.7/dist-packages/Django-1.4.10-py2.7.egg/django/db/models/query.py",
> line 361, in get
>     num = len(clone)
>   File
> "/usr/local/lib/python2.7/dist-packages/Django-1.4.10-py2.7.egg/django/db/models/query.py",
> line 85, in __len__
>     self._result_cache = list(self.iterator())
>   File
> "/usr/local/lib/python2.7/dist-packages/Django-1.4.10-py2.7.egg/django/db/models/query.py",
> line 291, in iterator
>     for row in compiler.results_iter():
>   File
> "/usr/local/lib/python2.7/dist-packages/Django-1.4.10-py2.7.egg/django/db/models/sql/compiler.py",
> line 763, in results_iter
>     for rows in self.execute_sql(MULTI):
>   File
> "/usr/local/lib/python2.7/dist-packages/Django-1.4.10-py2.7.egg/django/db/models/sql/compiler.py",
> line 818, in execute_sql
>     cursor.execute(sql, params)
>   File
> "/usr/local/lib/python2.7/dist-packages/Django-1.4.10-py2.7.egg/django/db/backends/util.py",
> line 40, in execute
>     return self.cursor.execute(sql, params)
>   File
> "/usr/local/lib/python2.7/dist-packages/Django-1.4.10-py2.7.egg/django/db/backends/mysql/base.py",
> line 114, in execute
>     return self.cursor.execute(query, args)
>   File
> "/usr/local/lib/python2.7/dist-packages/MySQL_python-1.2.5-py2.7-linux-x86_64.egg/MySQLdb/cursors.py",
> line 205, in execute
>     self.errorhandler(self, exc, value)
>   File
> "/usr/local/lib/python2.7/dist-packages/MySQL_python-1.2.5-py2.7-linux-x86_64.egg/MySQLdb/connections.py",
> line 36, in defaulterrorhandler
>     raise errorclass, errorvalue
> django.db.utils.DatabaseError: (1146, "Table 'review.django_site' doesn't
> exist")
>
> which makes sense, because I never restored the schema or data.
>
> So do I need to restore the table schemas and drop all row data to
> proceed? If so, is the application able to restore all the old site's
> data/configurations from the application web root?
>
> Settings_local.py
> # Site-specific configuration settings for Review Board
> # Definitions of these settings can be found at
> # http://docs.djangoproject.com/en/dev/ref/settings/
>
> # Database configuration
> DATABASES = {
> 'default': {
> 'ENGINE': 'django.db.backends.mysql',
>  'NAME': 'review',
> 'USER': 'review',
> 'PASSWORD': '<OMITTED>',
>  'HOST': 'localhost',
> 'PORT': '',
> },
> }
>
> # Unique secret key. Don't share this with anybody.
> SECRET_KEY = '<OMITTED>
>
> # Cache backend settings.
> CACHES = {
> 'default': {
>  'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
> 'LOCATION': 'localhost:11211',
>  },
> }
>
> # Extra site information.
> SITE_ID = 1
> SITE_ROOT = '/review/'
> FORCE_SCRIPT_NAME = ''
> DEBUG = True
>
> On Friday, March 14, 2014 1:13:10 PM UTC-7, Christian Hammond wrote:
>
>> Hi Kevin,
>>
>> The first red flag is that you had to do anything special with the
>> database. Working around those issues is going to likely just result in new
>> issues down the line, so for the moment, let's consider the workarounds as
>> not a real solution, and dig into what went wrong there.
>>
>> Can you reproduce the original steps and show me exactly what errors you
>> hit?
>>
>> Something important to watch out for is that your database dump is
>> consistent with regards to the table type (MyISAM vs. InnoDB). If they're
>> not, you will have problems importing the dump. This is the usual cause of
>> the problems.
>>
>> You also need to be sure your database is completely wiped before
>> importing, so that there aren't any conflicts there.
>>
>> I don't remember which version of django-evolution we depended on back in
>> 1.7.14, but make sure you have django-evolution 0.6.9 installed before
>> upgrading the database. (Also, why not run a more modern 1.7.x? Lots of bug
>> fixes since 1.7.14.)
>>
>> As far as the last error goes, mod_python is completely unsupported now,
>> by both us and Django (and, really, the project itself, last I heard). You
>> should be using mod_wsgi for any installations now.
>>
>> Christian
>>
>>
>> --
>> Christian Hammond - chi...@chipx86.com
>>
>> Review Board - http://www.reviewboard.org
>> Beanbag, Inc. - http://www.beanbaginc.com
>>
>>
>> On Fri, Mar 14, 2014 at 10:50 AM, Kevin Phillips <kevin.grenvi...@
>> gmail.com> wrote:
>>
>>> All;
>>>
>>> I'm having some issues performing a site migration of RB 1.5.2 to 1.7.14
>>> from an EOL server to a VM. Here are the steps I preformed:
>>>
>>> 1. Took SQL dump of reviewboard database and restored on new system
>>> 2. Took copy of application web root and copied to new system
>>> 3. Configured memcached on new system.
>>> 3. Installed Reviewboard==1.7.14 Django==1.4.10 python-memcached
>>> MySQL-python + deps via easy_install (Python 2.7.3)
>>> 4. Preformed a rb-site upgrade of application web root.
>>> 5. Upgrade failed with a 1050 (or similar) error because it couldn't
>>> access some table. So I temporarily overrode django's default database
>>> handler to use mysql + client configs in my.cnf (only a single site will
>>> reside on this VM) via django's conf/global_settings.py, I then ran
>>> './reviewboard/manage.py syncdb'.
>>> 6. syncdb also failed, so I dropped all my tables and re-ran the syncdb.
>>> 7. The second syncdb after dropping my tables worked, then I re-ran the
>>> rb-site upgrade
>>> 8. The second rb-site upgrade was successful but prompted me to modify
>>> my apache vhost config and validate the site settings.
>>> 9. I actioned the changes and restarted the web server.
>>>
>>> After this I get the error 500 page but I get a mod_python stack trace
>>> (yes I know mod_python is simply in there for legacy purposes, but the old
>>> site ran it and I cannot figure out how to cut-over to mod_wsgi).
>>>
>>> STACKTRACE:
>>> [Fri Mar 14 09:48:18 2014] [error] [client 10.12.21.48] mod_python
>>> (pid=2342, interpreter='reviewboard_review_vmem_com',
>>> phase='PythonHandler', handler='django.core.handlers.modpython'):
>>> Application error, referer: http://reviewboard.sub.domain/review/
>>> [Fri Mar 14 09:48:18 2014] [error] [client 10.12.21.48] ServerName:
>>> 'reviewboard.sub.domain', referer: http://reviewboard.sub.domain/review/
>>> [Fri Mar 14 09:48:18 2014] [error] [client 10.12.21.48] DocumentRoot:
>>> '/var/www/review.vmem.com/htdocs', referer:
>>> http://reviewboard.sub.domain/review/
>>> [Fri Mar 14 09:48:18 2014] [error] [client 10.12.21.48] URI: '/review/',
>>> referer: http://reviewboard.sub.domain/review/
>>> [Fri Mar 14 09:48:18 2014] [error] [client 10.12.21.48] Location:
>>> '/review/', referer: http://reviewboard.sub.domain/review/
>>> [Fri Mar 14 09:48:18 2014] [error] [client 10.12.21.48] Directory: None,
>>> referer: http://reviewboard.sub.domain/review/
>>> [Fri Mar 14 09:48:18 2014] [error] [client 10.12.21.48] Filename:
>>> '/var/www/review.vmem.com/htdocs/review', referer:
>>> http://reviewboard.sub.domain/review/
>>> [Fri Mar 14 09:48:18 2014] [error] [client 10.12.21.48] PathInfo: '/',
>>> referer: http://reviewboard.sub.domain/review/
>>> [Fri Mar 14 09:48:18 2014] [error] [client 10.12.21.48] Traceback (most
>>> recent call last):, referer: http://reviewboard.sub.domain/review/
>>> [Fri Mar 14 09:48:18 2014] [error] [client 10.12.21.48]   File
>>> "/usr/lib/python2.7/dist-packages/mod_python/importer.py", line 1537,
>>> in HandlerDispatch\n    default=default_handler, arg=req,
>>> silent=hlist.silent), referer: http://reviewboard.sub.domain/review/
>>> [Fri Mar 14 09:48:18 2014] [error] [client 10.12.21.48]   File
>>> "/usr/lib/python2.7/dist-packages/mod_python/importer.py", line 1202,
>>> in _process_target\n    module = import_module(module_name, path=path),
>>> referer: http://reviewboard.sub.domain/review/
>>> [Fri Mar 14 09:48:18 2014] [error] [client 10.12.21.48]   File
>>> "/usr/lib/python2.7/dist-packages/mod_python/importer.py", line 304, in
>>> import_module\n    return __import__(module_name, {}, {}, ['*']), referer:
>>> http://reviewboard.sub.domain/review/
>>> [Fri Mar 14 09:48:18 2014] [error] [client 10.12.21.48] ImportError: No
>>> module named django.core.handlers.modpython, referer:
>>> http://reviewboard.sub.domain/review/
>>>
>>> VHOST CONFIG
>>> <VirtualHost *:80>
>>> ServerName reviewboard.sub.domain
>>> DocumentRoot "/var/www/reviewboard/htdocs"
>>>
>>> # Error handlers
>>> ErrorDocument 500 /errordocs/500.html
>>>
>>> # Serve django pages
>>>  <Location "/review/">
>>> PythonPath "['/var/www/reviewboard/conf'] + sys.path"
>>>  SetEnv DJANGO_SETTINGS_MODULE reviewboard.settings
>>> SetEnv PYTHON_EGG_CACHE "/var/www/reviewboard/tmp/egg_cache"
>>>  SetHandler mod_python
>>> PythonHandler django.core.handlers.modpython
>>> PythonAutoReload Off
>>>  PythonDebug Off
>>> # Used to run multiple mod_python sites in the same apache
>>> PythonInterpreter reviewboard_reviewboard
>>>  </Location>
>>>
>>> # Serve static without running it through mod_python
>>> # Required for upgrade from Reviewboard 1.5.2 to 1.7.14
>>>  <Location "/review/static">
>>> SetHandler None
>>> </Location>
>>>
>>> Alias /review/static "/var/www/reviewboard/htdocs/static"
>>>
>>> # Serve static media without running it through mod_python
>>>  # (overrides the above)
>>> <Location "/review/media">
>>> SetHandler None
>>>  </Location>
>>> <Location "/review/errordocs">
>>> SetHandler None
>>>  </Location>
>>>
>>> <Directory "/var/www/reviewboard/htdocs">
>>> AllowOverride All
>>>  </Directory>
>>>
>>> # Alias static media requests to filesystem
>>> Alias /review/media "/var/www/reviewboard/htdocs/media"
>>>  Alias /review/errordocs "/var/www/reviewboard/htdocs/errordocs"
>>> </VirtualHost>
>>>
>>> Any suggestions would be much appreciated. If you live in the bay area,
>>> I'll buy you a six pack.
>>>
>>> Thanks,
>>>
>>> Kevin
>>>
>>> --
>>> Get the Review Board Power Pack at http://www.reviewboard.org/powerpack/
>>> ---
>>> Sign up for Review Board hosting at RBCommons: https://rbcommons.com/
>>> ---
>>> Happy user? Let us know at http://www.reviewboard.org/users/
>>> ---
>>> You received this message because you are subscribed to the Google
>>> Groups "reviewboard" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to reviewboard...@googlegroups.com.
>>>
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>  --
> Get the Review Board Power Pack at http://www.reviewboard.org/powerpack/
> ---
> Sign up for Review Board hosting at RBCommons: https://rbcommons.com/
> ---
> Happy user? Let us know at http://www.reviewboard.org/users/
> ---
> You received this message because you are subscribed to the Google Groups
> "reviewboard" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to reviewboard+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Get the Review Board Power Pack at http://www.reviewboard.org/powerpack/
---
Sign up for Review Board hosting at RBCommons: https://rbcommons.com/
---
Happy user? Let us know at http://www.reviewboard.org/users/
--- 
You received this message because you are subscribed to the Google Groups 
"reviewboard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to reviewboard+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to