Hi Dave, Converting the data between databases is very tricky. The loaddb/dumpdb scripts were an attempt at this, but we'll be throwing them away, because they were the wrong approach. Off-hand, I don't know why this particular attempt is failing the way it is, but I suspect it's an ordering problem.
We have a replacement feature coming in Power Pack that handles this much better. It's still in development, but if you are up to being a guinea pig, I can talk to you off this thread and send builds your way to test. Christian On Mon, Jun 5, 2017 at 2:24 PM, <[email protected]> wrote: > I attempted the same, moving from SQLite to MySQL. It didn't go well.... > First I was asked to install a django package, then it tried but failed on > a LOT of FK constraints: > > sudo rb-site manage `pwd` dumpdb > ~/database.json > > (change settings_local.py) > > sudo rb-site manage `pwd` loaddb ~/database.json > CommandError: Before using this command, you need to install the > 'django-reset' package > [dave.anderson@tools rb.com]$ sudo pip install django-reset > Collecting django-reset > Downloading django-reset-0.2.0.tar.gz > Building wheels for collected packages: django-reset > Running setup.py bdist_wheel for django-reset ... done > Stored in directory: /root/.cache/pip/wheels/54/4a/77/ > 75197bb244b4952289d387aeb94244b45777dc9d3ec5bf1e8c > Successfully built django-reset > Installing collected packages: django-reset > Successfully installed django-reset-0.2.0 > [dave.anderson@tools rb.com]$ sudo rb-site manage `pwd` loaddb ~ > /database.json > > This will wipe out your existing database prior to loading. It is highly > recommended that you have a full SQL database dump in case things go wrong. > > You should only use this if you're migrating from one type of database to > another, with the same version of Review Board on each. > > Are you sure you want to continue?" > > Type 'yes' to continue, or 'no' to cancel: yes > sh: ./reviewboard/manage.py: No such file or directory > Importing new style dump format (v1) > Error: (1452, 'Cannot add or update a child row: a foreign key constraint > fails (`reviewboard`.`django_admin_log`, CONSTRAINT > `content_type_id_refs_id_93d2d1f8` FOREIGN KEY (`content_type_id`) > REFERENCES `django_content_type` (`id`))') > Line 0: '{"pk": 55, "model": "admin.logentry", "fields": {"action_flag": > 2, "action_time": "2017-05-25T18:46:10.674Z", "object_repr": "SysTools", > "object_id": "1", "change_message": "Changed mailing_list, email_list_only, > users and extra_data.", "user": 1, "content_type": 24}} > ' > > And so on, for about 2500 lines. This is MySQL 5.5.53. I had created a > "reviewboard" schema before attempting the loaddb. Any thoughts > > > On Thursday, April 24, 2014 at 1:44:35 AM UTC-7, Joe wrote: >> >> Hi Christian, >> >> It worked when I gave without the "--no-initial-data". >> >> So following are the steps I followed: >> >> I have assumed the /path/to/reviewboard in my case as /var/www/reviewboard >> >> 1. Stop reviewboard >> 2. # rb-site manage /var/www/reviewboard dumpdb > database.json >> 3. In reviewboard folder go into /conf and change the settings_local.py >> to point from sqlite3 to mysql >> >> In settings_local.py change >> >> DATABASES = { >> 'default': { >> 'ENGINE': 'django.db.backends.sqlite3', >> 'NAME': '/var/www/reviewboard/data/reviewboard.db', >> }, >> } >> >> to >> >> DATABASES = { >> 'default': { >> 'ENGINE': 'django.db.backends.mysql', >> 'NAME': 'reviewboard_mysql', >> 'USER': 'root', >> 'PASSWORD': '', >> 'HOST': 'localhost', >> 'PORT': '' >> }, >> } >> >> 4. # rb-site manage /var/www/reviewboard syncdb -- >> 5. # rb-site manage /var/www/reviewboard loaddb >> /path/to/dumpfile/database.json >> >> Done. >> >> >> >> Best regards, >> Joe. >> >> On Thursday, April 24, 2014 10:20:25 AM UTC+2, Joe wrote: >>> >>> Hi Christian, >>> >>> Thanks for the details. >>> >>> When I run the below command I get the error --no-initial-data is not an >>> avaialble option. Am I missing something here: >>> >>> >>> # rb-site manage /var/www/reviewboard syncdb -- --no-initial-data >>> Usage: /usr/local/lib/python2.6/dist-packages/ReviewBoard-1.7.22-py >>> 2.6.egg/reviewboard/cmdline/rbsite.pyc syncdb [options] >>> >>> Create the database tables for all apps in INSTALLED_APPS whose tables >>> haven't already been created. >>> >>> /usr/local/lib/python2.6/dist-packages/ReviewBoard-1.7.22-py >>> 2.6.egg/reviewboard/cmdline/rbsite.pyc: error: no such option: >>> --no-initial-data >>> >>> Best regards, >>> Joe. >>> >>> >>> On Tuesday, April 15, 2014 9:34:26 PM UTC+2, Christian Hammond wrote: >>>> >>>> loaddb and loaddata both require that you have an existing database >>>> schema in place. >>>> >>>> You'll need to first use the version of Review Board you were using for >>>> the sqlite database. I'm assuming in this case that it's the same one and >>>> that you aren't also trying trying to upgrade the software. If you are, >>>> you'll first need to update the sqlite database. >>>> >>>> Then, once you've configured your site to use MySQL (by modifying the >>>> settings_local.py file), you can create the initial schema by doing: >>>> >>>> $ rb-site manage /path/to/site syncdb -- --no-initial-data >>>> >>>> (Note the extra "--" in there.) >>>> >>>> If you already had data in the database, you'll need to wipe it before >>>> doing that. >>>> >>>> You should then be able to do the import. >>>> >>>> Christian >>>> >>>> -- >>>> Christian Hammond - [email protected] >>>> Review Board - http://www.reviewboard.org >>>> Beanbag, Inc. - http://www.beanbaginc.com >>>> >>>> >>>> On Tue, Apr 15, 2014 at 5:08 AM, Joe <[email protected]> wrote: >>>> >>>>> Hello, >>>>> >>>>> Anyone who can say what could be the issue that I have mentioned below. >>>>> >>>>> Best regards, >>>>> Joe. >>>>> >>>>> On Monday, April 14, 2014 3:45:48 PM UTC+2, Joe wrote: >>>>>> >>>>>> David: >>>>>> >>>>>> When I tried this, I get the following errors: >>>>>> >>>>>> 1. rb-site manage /path/to/site dumpdb > database.json >>>>>> >>>>>> Success. Database.json was created >>>>>> >>>>>> 2. rb-site manage /path/to/site loaddb database.json >>>>>> >>>>>> Interestingly it said that database.json doesn't exist, while it >>>>>> exists. >>>>>> >>>>>> It started running when I gave the full path >>>>>> >>>>>> rb-site manage /path/to/site loaddb /home/rbusr/backup/database.json >>>>>> >>>>>> 3. But this loaddb command did not complete. It got failed with the >>>>>> following error: >>>>>> >>>>>> ine 2019: '{"pk": "2cb7881974e3b16dc27d181a7afad869", "model": >>>>>> "sessions.session", "fields": {"expire_date": "2015-03-19T05:43:49.644Z", >>>>>> "session_data": "gAJ9cQFVCnRlc3Rjb29raWVxAlUGd2 >>>>>> 9ya2VkcQNzLjViMGE0ODQwNDRhMjdjY2UyNDhjODgxYWIx\nZjlkZDky\n"}} >>>>>> 'Error: (1146, "Table 'reviewboard_mysqldb.django_session' doesn't >>>>>> exist") >>>>>> Line 2020: '{"pk": "57e2c5013b1a55003e2df355c69bc722", "model": >>>>>> "sessions.session", "fields": {"expire_date": "2015-03-19T06:25:37.154Z", >>>>>> "session_data": "gAJ9cQEoVRJfYXV0aF91c2VyX2JhY2 >>>>>> tlbmRxAlUpZGphbmdvLmNvbnRyaWIuYXV0aC5iYWNrZW5k\ncy5Nb2RlbEJ >>>>>> hY2tlbmRxA1UNX2F1dGhfdXNlcl9pZHEES4t1LmNhYTJlZmFmMzM0YWY5NDY1ZjAx\ >>>>>> nNjM3ZjA3NTA1M2Rl\n"}} >>>>>> 'Error: (1146, "Table 'reviewboard_mysqldb.django_session' doesn't >>>>>> exist") >>>>>> Line 2021: '{"pk": "f5039c679f6f5d0fcd4e1ce45375d2c9", "model": >>>>>> "sessions.session", "fields": {"expire_date": "2015-04-01T05:35:47.003Z", >>>>>> "session_data": "gAJ9cQEoVRJfYXV0aF91c2VyX2JhY2 >>>>>> tlbmRxAlUpZGphbmdvLmNvbnRyaWIuYXV0aC5iYWNrZW5k\ncy5Nb2RlbEJ >>>>>> hY2tlbmRxA1UNX2F1dGhfdXNlcl9pZHEES2R1LjA3ODVlNzk1YzNkYmExMmJmY2Fm\ >>>>>> nMTNmMmMzODI0MmFh\n"}} >>>>>> 'Error: (1146, "Table 'reviewboard_mysqldb.django_session' doesn't >>>>>> exist") >>>>>> Line 2022: '{"pk": "b9da809d942c8ab930c14843aabd5d9b", "model": >>>>>> "sessions.session", "fields": {"expire_date": "2015-03-20T22:06:59.624Z", >>>>>> "session_data": "gAJ9cQEoVQ1fYXV0aF91c2VyX2lkcQ >>>>>> JLKFUSX2F1dGhfdXNlcl9iYWNrZW5kcQNVKWRqYW5nby5j\nb250cmliLmF >>>>>> 1dGguYmFja2VuZHMuTW9kZWxCYWNrZW5kcQR1LjIzNzk5MzQwY2ZhODUwMWNmMzU5\ >>>>>> nMWY4MWUyNmY5YjIx\n"}} >>>>>> 'Error: (1146, "Table 'reviewboard_mysqldb.django_session' doesn't >>>>>> exist") >>>>>> Line 2023: '{"pk": "ba719abc8094a9bc8cc3b677cbc3db1d", "model": >>>>>> "sessions.session", "fields": {"expire_date": "2015-03-20T00:34:54.056Z", >>>>>> "session_data": "gAJ9cQEoVRJfYXV0aF91c2VyX2JhY2 >>>>>> tlbmRxAlUpZGphbmdvLmNvbnRyaWIuYXV0aC5iYWNrZW5k\ncy5Nb2RlbEJ >>>>>> hY2tlbmRxA1UNX2F1dGhfdXNlcl9pZHEES311LjZmZWI3MGM5NzUyNTIxOGM2OTk1\ >>>>>> nNjg1NGQyOTE5NDc1\n"}} >>>>>> 'Error: (1146, "Table 'reviewboard_mysqldb.django_session' doesn't >>>>>> exist") >>>>>> Line 2024: '{"pk": "b7ef1ec805fba7b77c567fe403ffcc80", "model": >>>>>> "sessions.session", "fields": {"expire_date": "2015-03-20T00:36:22.807Z", >>>>>> "session_data": "gAJ9cQFVCnRlc3Rjb29raWVxAlUGd2 >>>>>> 9ya2VkcQNzLjViMGE0ODQwNDRhMjdjY2UyNDhjODgxYWIx\nZjlkZDky\n"}} >>>>>> 'Error: (1146, "Table 'reviewboard_mysqldb.django_session' doesn't >>>>>> exist") >>>>>> Line 2025: '{"pk": "4eefe47bedaa52c81faaf65f3fec65e7", "model": >>>>>> "sessions.session", "fields": {"expire_date": "2015-03-20T00:37:22.556Z", >>>>>> "session_data": "gAJ9cQFVCnRlc3Rjb29raWVxAlUGd2 >>>>>> 9ya2VkcQNzLjViMGE0ODQwNDRhMjdjY2UyNDhjODgxYWIx\nZjlkZDky\n"}} >>>>>> Line 2166: '{"pk": "0fb6592d2c2784aafd9fa256f522dd52", "model": >>>>>> "sessions.session", "fields": {"expire_date": "2015-04-14T10:18:01.105Z", >>>>>> "session_data": "MTgzOTdhYTQzYzIzMWUyNTJhOTcwYz >>>>>> k3ODQwNTE0MDFjN2JhNzYxYjqAAn1xAShVEl9hdXRoX3Vz\nZXJfYmFja2V >>>>>> uZHECVTFyZXZpZXdib2FyZC5hY2NvdW50cy5iYWNrZW5kcy5TdGFuZGFyZEF1dGhC\ >>>>>> nYWNrZW5kcQNVDV9hdXRoX3VzZXJfaWRxBEsQdS4=\n"}} >>>>>> >>>>>> 'Problem installing '/home/rbusr/reviewboard/database.json': (1146, >>>>>> "Table 'reviewboard_mysqldb.django_site' doesn't exist") >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> Any thoughts on how to fix this.. >>>>>> >>>>>> Best regards, >>>>>> Joe. >>>>>> >>>>>> >>>>>> >>>>>> On Saturday, April 12, 2014 8:29:54 AM UTC+2, David Trowbridge wrote: >>>>>>> >>>>>>> Joe, >>>>>>> >>>>>>> There are two management commands you can use for this. They aren't >>>>>>> well-documented, but there's an example of how to use them at >>>>>>> http://www.reviewboard.org/docs/releasenotes/reviewboard/1.6.4/ >>>>>>> >>>>>>> I don't think there's a strong reason to choose either over the >>>>>>> other. It usually comes down more to what expertise people have. >>>>>>> >>>>>>> -David >>>>>>> >>>>>>> >>>>>>> On Fri, Apr 11, 2014 at 7:45 AM, Joe <[email protected]> wrote: >>>>>>> >>>>>>>> Hello, >>>>>>>> >>>>>>>> I believe I'm still running my review board in sqlite3 (how to >>>>>>>> confirm it) >>>>>>>> >>>>>>>> Are there any scripts from review board to convert this database to >>>>>>>> MySQL or PostgreSQL. >>>>>>>> >>>>>>>> Also which one (MySQL or PostgreSQL) is better option. >>>>>>>> >>>>>>>> Best regards, >>>>>>>> Joe. >>>>>>>> >>>>>>>> -- >>>>>>>> Get the Review Board Power Pack at http://www.reviewboard.org/pow >>>>>>>> erpack/ >>>>>>>> --- >>>>>>>> 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 [email protected]. >>>>>>>> For more options, visit https://groups.google.com/d/optout. >>>>>>>> >>>>>>> >>>>>>> -- >>>>> Get the Review Board Power Pack at http://www.reviewboard.org/pow >>>>> erpack/ >>>>> --- >>>>> 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 [email protected]. >>>>> For more options, visit https://groups.google.com/d/optout. >>>>> >>>> >>>> -- > Supercharge your Review Board with Power Pack: > https://www.reviewboard.org/powerpack/ > Want us to host Review Board for you? Check out RBCommons: > https://rbcommons.com/ > Happy user? Let us know! https://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 [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- Christian Hammond President/CEO of Beanbag <https://www.beanbaginc.com/> Makers of Review Board <https://www.reviewboard.org/> -- Supercharge your Review Board with Power Pack: https://www.reviewboard.org/powerpack/ Want us to host Review Board for you? Check out RBCommons: https://rbcommons.com/ Happy user? Let us know! https://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 [email protected]. For more options, visit https://groups.google.com/d/optout.
