I've inherited the admin/config-management of an under-managed review board 
system and find that a simple conversion is not straight-forward if there 
is a fair amount of reviews in the system already -- ours is about 4.5GB. 
 We're running rb-1.5.1, but planning to upgrade after the db conversion.

I was able to remove the entries 'whose "model" is 
"contenttypes.contenttype"' using a simple sed command that others may find 
useful (standard disclaimer regarding no warranty or liability assumed):

  sed s/{"pk": [0-9][0-9]*, "model": "contenttypes\.contenttype", "fields": 
{"model": "[a-z][a-z]*", "name": "[a-z ][a-z ]*", "app_label": 
"[a-z_][a-z_]*"}},//g

I'm getting a curious error with the rb-site manage <path> loaddata command 
and I've isolated it to a particular sqlite record that's about 300K in 
length (uuencoded diff, of course).  The error stack is 

Problem installing fixture '/backup/rbdump-0906-master.json': Traceback 
(most recent call last):
  File 
"/usr/lib/python2.5/site-packages/django/core/management/commands/loaddata.py", 
line 165, in handle
    for obj in objects:
  File "/usr/lib/python2.5/site-packages/django/core/serializers/json.py", 
line 38, in Deserializer
    for obj in PythonDeserializer(simplejson.load(stream), **options):
  File 
"/usr/lib/python2.5/site-packages/django/utils/simplejson/__init__.py", 
line 298, in load
    parse_constant=parse_constant, **kw)
  File 
"/usr/lib/python2.5/site-packages/django/utils/simplejson/__init__.py", 
line 338, in loads
    return _default_decoder.decode(s)
  File 
"/usr/lib/python2.5/site-packages/django/utils/simplejson/decoder.py", line 
326, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File 
"/usr/lib/python2.5/site-packages/django/utils/simplejson/decoder.py", line 
342, in raw_decode
    obj, end = self.scan_once(s, idx)
  File 
"/usr/lib/python2.5/site-packages/django/utils/simplejson/scanner.py", line 
38, in _scan_once
    return parse_array((string, idx + 1), _scan_once)
  File 
"/usr/lib/python2.5/site-packages/django/utils/simplejson/decoder.py", line 
226, in JSONArray
    value, end = scan_once(s, end)
  File 
"/usr/lib/python2.5/site-packages/django/utils/simplejson/scanner.py", line 
36, in _scan_once
    return parse_object((string, idx + 1), encoding, strict, _scan_once, 
object_hook)
  File 
"/usr/lib/python2.5/site-packages/django/utils/simplejson/decoder.py", line 
176, in JSONObject
    value, end = scan_once(s, end)
  File 
"/usr/lib/python2.5/site-packages/django/utils/simplejson/scanner.py", line 
36, in _scan_once
    return parse_object((string, idx + 1), encoding, strict, _scan_once, 
object_hook)
  File 
"/usr/lib/python2.5/site-packages/django/utils/simplejson/decoder.py", line 
176, in JSONObject
    value, end = scan_once(s, end)
  File 
"/usr/lib/python2.5/site-packages/django/utils/simplejson/scanner.py", line 
34, in _scan_once
    return parse_string(string, idx + 1, encoding, strict)
  File 
"/usr/lib/python2.5/site-packages/django/utils/simplejson/decoder.py", line 
105, in py_scanstring
    errmsg("Invalid \\escape: %r" % (esc,), s, end))
ValueError: Invalid \escape: 'U': line 1 column -2147483586 (char 
-2147483586)

Has anybody else tried to migrate/convert a large sqlite configuration?

On Thursday, November 17, 2011 12:14:36 AM UTC-8, Ian wrote:
>
> Oh, and if the path to the site is different on the new server, you'll 
> need to do a find&replace in the dump file.
>
> On Wed, Nov 16, 2011 at 11:18 PM, Mail Team <emai...@gmail.com<javascript:>
> > wrote:
>
>> I *just* finished doing this on my server, not super intuitive but once 
>> you get the process it works pretty well.  You need to still have your old 
>> server running for this to work.
>>
>> 1. On the old server, dump your site data.
>> sudo rb-site manage /path/to/site dumpdata > /path/to/backup/rbdump.json
>>
>> 2. Open the dump file in a text editor and find all the entries 
>> whose "model" is "contenttypes.contenttype" or "scmtools.tool", and delete 
>> those entries.
>>
>> 3. On the new server, create a new site following the directions on the 
>> ReviewBoard site.  Note that you don't have to use the same database type 
>> as your old server (my old server used MySQL, my new server uses 
>> PostgreSQL).
>>
>> 4. On the new server, load the old site data.
>> sudo rb-site manage /path/to/site loaddata /path/to/backup/rbdump.json
>>
>> 5. (Optional) For good measure, reboot your new server.
>>
>> On Wed, Nov 16, 2011 at 7:28 PM, RAY <ervin.z...@gmail.com 
>> <javascript:>>wrote:
>>
>>> I had a reviewboard using in a server in past, but now the server has
>>> been replaced by new computer. I have install a new reviewboard
>>> environment on this new computer, and then I need move all original
>>> data from old environment to new one. How to  move it?
>>> Could I backup database from old reviewboard and recover it on new?
>>>
>>

-- 
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