Hi Sharon,

Most likely, your old database contains some tables in MySQL's MyISAM
format. The default for tables these days is InnoDB. You'd probably
encounter this error even if you were just upgrading on the same server.

The solution is really easy. Take your database backup (which should just
be a .sql file) and edit it. Change all occurrences of ENGINE=MyISAM to
ENGINE=InnoDB. (Check for case sensitivity issues in here). Then restore
the backup and try the upgrade again. It should work this time.

You'll probably want to recreate the database on the new server first, just
to ensure you're restoring into an empty database.

Christian

On Fri, Jan 12, 2018 at 2:37 PM, sharon chen <sharon...@gmail.com> wrote:

> I tried to migrate reviewboard from an old server to a VM.
>
> The older server:
> OS: SUSE 11.4
> reviewboard: 1.6.3
>
> The new server:
> centos 7 or ubuntu 16.04
> reviewboard: Review Board 2.5.16
>
>
> What is the best approach to achieve this?
>
>
> I have tested the following approach:
>
> 1. create the db backup on the old server (ok)
> 2. cp the db backup and restore the db on the new server (ok)
> 3. cp the rb site data /var/www/mysite on the new server (ok)
> 4. run "rb-site upgrade /var/www/mysite"
>
> I failed at this step with the following error on both centos and ubuntu
> 16.04:
>
> Applying database evolutions for auth...
> Applying database evolutions for contenttypes...
> Applying database evolutions for accounts...
> Applying database evolutions for attachments...
> Applying database evolutions for changedescs...
> Applying database evolutions for diffviewer...
> Applying database evolutions for reviews...
> Database evolutions for reviews failed!
> The SQL statement was: ALTER TABLE `reviews_reviewrequest_depends_on` ADD
> CONSTRAINT `from_reviewrequest_id_refs_id_623cfa96` FOREIGN KEY
> (`from_reviewrequest_id`) REFERENCES `reviews_reviewrequest` (`id`);
> The database error was: (1005, 'Can\'t create table
> `reviewboard`.`#sql-48c6_5e` (errno: 150 "Foreign key constraint is
> incorrectly formed")')
>
> CommandError: Error applying evolution for reviews: (1005, 'Can\'t create
> table `reviewboard`.`#sql-48c6_5e` (errno: 150 "Foreign key constraint is
> incorrectly formed")')
>
>
> Could you advice what I missed and how to resolve the issue? Will it be
> better when doing "rb-site upgrade" on the old server first, then migrate?
>
>
> Thanks,
> Sharon Chen
>
> --
> 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.
> 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 
"Review Board Community" 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