Hi Ismail,

The correct procedure for any upgrade is to:

1. Back up the database through your normal database SQL dump tool.
2. Upgrade Review Board packages.
3. Run 'rb-site upgrade' on the site directory.

If you're using the Docker image exclusively, a new image pointed to your
older database will attempt an upgrade automatically on startup.

If the database upgrade didn't show any errors, and you're able to use
Review Board, then the upgrade was likely successful.

The database export problem here may just be a bad query. It's hard to tell
from what limited information is available in the traceback. Are you able
to perform an export if you allow it to export all review request IDs,
rather than selectively choosing IDs?

Christian

On Mon, Jul 11, 2022 at 9:14 AM Ismail Mehrez <mehrez.ism...@gmail.com>
wrote:

> Hi Christian,
>
> Thanks for looking into this. It works now but there is an issue.
> What is the correct way to upgrade the database from reviewboard v2.5 to
> 4.0.7? I have an old instance that I am trying to upgrade in order to be
> able to export part of it.
> "rb-site upgrade" did work (to 3.0 then 4.07) and finished successfully
> and reviewboard is up. However, when I try to export it doesn't work. I
> believe the database schema is not correct:
>
> root@1d5ade473564:/# rb-site manage /site export-db --
> --review-requests=138850
> INFO:root:Using reviewboard.scmtools.svn.pysvn backend for SVN
> Traceback (most recent call last):
>   File "/venv/bin/rb-site", line 8, in <module>
>     sys.exit(main())
>   File "/venv/lib/python3.8/site-packages/reviewboard/cmdline/rbsite.py",
> line 2732, in main
>     command.run(site, options)
>   File "/venv/lib/python3.8/site-packages/reviewboard/cmdline/rbsite.py",
> line 2502, in run
>     site.run_manage_command(manage_command, manage_args)
>   File "/venv/lib/python3.8/site-packages/reviewboard/cmdline/rbsite.py",
> line 1036, in run_manage_command
>     manage_util.execute()
>   File
> "/venv/lib/python3.8/site-packages/django/core/management/__init__.py",
> line 356, in execute
>     self.fetch_command(subcommand).run_from_argv(self.argv)
>   File "/venv/lib/python3.8/site-packages/django/core/management/base.py",
> line 283, in run_from_argv
>     self.execute(*args, **cmd_options)
>   File "/venv/lib/python3.8/site-packages/django/core/management/base.py",
> line 330, in execute
>     output = self.handle(*args, **options)
>   File
> "build/bdist.macosx-12.0-arm64/wheel/rbpowerpack/importexport/management/commands/export-db.py",
> line 177, in handle
>   File
> "build/bdist.macosx-12.0-arm64/wheel/rbpowerpack/importexport/exporter.py",
> line 170, in export_database
>   File
> "build/bdist.macosx-12.0-arm64/wheel/rbpowerpack/importexport/exporter.py",
> line 651, in _calculate_users
>   File
> "build/bdist.macosx-12.0-arm64/wheel/rbpowerpack/importexport/exporter.py",
> line 764, in _get_users_for_review_request_ids
>   File "/venv/lib/python3.8/site-packages/django/db/models/manager.py",
> line 85, in manager_method
>     return getattr(self.get_queryset(), name)(*args, **kwargs)
>   File "/venv/lib/python3.8/site-packages/django/db/models/query.py", line
> 787, in filter
>     return self._filter_or_exclude(False, *args, **kwargs)
>   File "/venv/lib/python3.8/site-packages/django/db/models/query.py", line
> 805, in _filter_or_exclude
>     clone.query.add_q(Q(*args, **kwargs))
>   File "/venv/lib/python3.8/site-packages/django/db/models/sql/query.py",
> line 1250, in add_q
>     clause, _ = self._add_q(q_object, self.used_aliases)
>   File "/venv/lib/python3.8/site-packages/django/db/models/sql/query.py",
> line 1268, in _add_q
>     child_clause, needed_inner = self._add_q(
>   File "/venv/lib/python3.8/site-packages/django/db/models/sql/query.py",
> line 1273, in _add_q
>     child_clause, needed_inner = self.build_filter(
>   File "/venv/lib/python3.8/site-packages/django/db/models/sql/query.py",
> line 1210, in build_filter
>     condition = self.build_lookup(lookups, col, value)
>   File "/venv/lib/python3.8/site-packages/django/db/models/sql/query.py",
> line 1105, in build_lookup
>     lhs = self.try_transform(lhs, name, lookups)
>   File "/venv/lib/python3.8/site-packages/django/db/models/sql/query.py",
> line 1117, in try_transform
>     raise FieldError(
> django.core.exceptions.FieldError: Unsupported lookup '' for AutoField or
> join on the field not permitted.
>
> On Sunday, June 12, 2022 at 1:49:36 AM UTC+2 Christian Hammond wrote:
>
>> Looked into this and there's a bug in the current builds preventing those
>> commands from working in that environment. We have new versions of Review
>> Board, RBTools, and Power Pack scheduled for this coming week. Once those
>> are out, you should be good to go. Announcements for new releases will be
>> made here and through the Official Announcements mailing list (
>> https://www.reviewboard.org/mailing-lists/).
>>
>> Christian
>>
>> On Sat, Jun 11, 2022 at 3:34 AM Ismail Mehrez <mehrez...@gmail.com>
>> wrote:
>>
>>> Thanks christian for the reply
>>>
>>> The current version already had PowerPack 4.0 installed and thanks to
>>> your infor, I updated that to 5.0.
>>> However, the export-db subcommand is not available for the 'rb-site
>>> mange' command.
>>>
>>> root@b9ae4ece0449:/# pip list | grep PowerPack
>>> ReviewBoardPowerPack    5.0
>>>
>>> root@b9ae4ece0449:/# rb-site manage /site/ export-db
>>> INFO:root:Using reviewboard.scmtools.svn.pysvn backend for SVN
>>> Unknown command: 'export-db'
>>> Type 'rb-site manage /site help' for usage.
>>>
>>> How can I access it?
>>>
>>> Ismail
>>> On Friday, June 10, 2022 at 11:09:52 PM UTC+2 Christian Hammond wrote:
>>>
>>>> Hi Ismail,
>>>>
>>>> We’re putting out new Docker images likely next week, and they’ll
>>>> include the new Power Pack.
>>>>
>>>> In the meantime, you can upgrade within your container through:
>>>>
>>>>     pip install -U ReviewBoardPowerPack
>>>>     killall -HUP gunicorn
>>>>
>>>> You can also build your own images that derive from ours and specify
>>>> the versions of the dependencies you need without waiting for new releases.
>>>>
>>>> Christian
>>>>
>>>>
>>>> On Fri, Jun 10, 2022 at 08:35 Ismail Mehrez <mehrez...@gmail.com>
>>>> wrote:
>>>>
>>>>> Hello,
>>>>>
>>>>> I an trying to export a number of review requests using the server
>>>>> export feature in PowerPack Server Import and Export | Documentation
>>>>> | Review Board
>>>>> <https://www.reviewboard.org/docs/powerpack/dev/powerpack/manual/import-export/>
>>>>> .
>>>>> I am using the docker-compose installation provided in the official
>>>>> docs Installing with Docker | Documentation | Review Board
>>>>> <https://www.reviewboard.org/docs/manual/4.0/admin/installation/docker/> 
>>>>> with
>>>>> reviewboard image 4.0.6-1. The review board starts Ok and I can use it 
>>>>> with
>>>>> no problems, however the export-db subcommand is not available in the
>>>>> container and the powerPack extension is enabled. (This is a clean
>>>>> installation not importing any old data).
>>>>>
>>>>> I have also added the trial license for Powerpack.
>>>>>
>>>>> Can someone help to solve this?
>>>>>
>>>>> Thanks.
>>>>>
>>>>> I can see this in the ReviewBoard init logs:
>>>>> reviewboard_1  | + rb-site manage /site enable-extension
>>>>> rbpowerpack.extension.PowerPackExtension
>>>>> reviewboard_1  | INFO:root:Using reviewboard.scmtools.svn.pysvn
>>>>> backend for SVN
>>>>> reviewboard_1  | ERROR:djblets.extensions.manager:The Review Board
>>>>> Power Pack extension uses the deprecated "htdocs" directory for static
>>>>> files. This is no longer supported. It must be updated to use a "static"
>>>>> directory instead.
>>>>>
>>>>>
>>>>> root@ddb5232b45c9:/# pip list | grep Review
>>>>> ReviewBoard             4.0.6
>>>>> ReviewBoardPowerPack    4.0
>>>>>
>>>>>
>>>>> root@ddb5232b45c9:/# rb-site manage /site/ export-db
>>>>> INFO:root:Using reviewboard.scmtools.svn.pysvn backend for SVN
>>>>> Unknown command: 'export-db'
>>>>> Type 'rb-site manage /site help' for usage.
>>>>>
>>>>>
>>>>> root@ddb5232b45c9:/# rb-site manage /site/ list-extensions
>>>>> INFO:root:Using reviewboard.scmtools.svn.pysvn backend for SVN
>>>>> * Name: reviewbot-extension
>>>>>   Status: disabled
>>>>>   ID: reviewbotext.extension.ReviewBotExtension
>>>>>
>>>>> * Name: rbintegrations
>>>>>   Status: enabled
>>>>>   ID: rbintegrations.extension.RBIntegrationsExtension
>>>>>
>>>>> * Name: ReviewBoardPowerPack
>>>>>   Status: enabled
>>>>>   ID: rbpowerpack.extension.PowerPackExtension
>>>>>
>>>>> --
>>>>> 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 "Review Board Community" group.
>>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>>> an email to reviewboard...@googlegroups.com.
>>>>> To view this discussion on the web visit
>>>>> https://groups.google.com/d/msgid/reviewboard/277d1f0a-3ed5-4918-9527-b833fc27a898n%40googlegroups.com
>>>>> <https://groups.google.com/d/msgid/reviewboard/277d1f0a-3ed5-4918-9527-b833fc27a898n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>> .
>>>>>
>>>> --
>>>> --
>>>> Christian Hammond
>>>> President/CEO of Beanbag
>>>> Makers of Review Board
>>>>
>>> --
>>> 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 "Review Board Community" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to reviewboard...@googlegroups.com.
>>>
>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/reviewboard/67430a68-17c5-4f91-91ca-a61b2cfc467an%40googlegroups.com
>>> <https://groups.google.com/d/msgid/reviewboard/67430a68-17c5-4f91-91ca-a61b2cfc467an%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>>
>>
>> --
>> 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
> "Review Board Community" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to reviewboard+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/reviewboard/a5475afd-6da9-4438-b515-a0951f127d4dn%40googlegroups.com
> <https://groups.google.com/d/msgid/reviewboard/a5475afd-6da9-4438-b515-a0951f127d4dn%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>


-- 
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 
"Review Board Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to reviewboard+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/reviewboard/CAE7VndnRnBsdNV0Jp%3DQKBUSv7wXZf9E5ue6a9q8pDb3VV19fvQ%40mail.gmail.com.

Reply via email to