CBQE-927: get all queries before upgrade

Change-Id: I5cd58f485f2301d90937977ba0620dbfb1ebeb7d
Reviewed-on: http://review.couchbase.org/24823
Reviewed-by: Andrei Baranouski <andrei.baranouski@gmail.com>
Tested-by: Andrei Baranouski <andrei.baranouski@gmail.com>