Moving Reviewboard Server

758 views
Skip to first unread message

Peter Snelling

unread,
Jul 2, 2013, 12:56:07 PM7/2/13
to revie...@googlegroups.com
I been trying out reviewboard for about 6 weeks, and it's working pretty well (only real issue is I haven't been able to get e-mails working properly). Now I've got a new better server to install it on. I'd like to copy the existing review and users from the existing database before I move it -- about 60 users and 135 review requests. I'm using pgsql, apache, and currently version 1.7.7.1.
 
I don't see anything on http://www.reviewboard.org/docs/manual/1.7/admin/ on how to do this, but I see there have been a few questions about it in this group. It looks like some of the problems have been moving to a different database (eg: mysql to pgsql) or a different version of RB, so to keep things easy, I'll keep the same pgsql, apache, OS, and RB instance (by upgrading just before exporting?).  I'm thinking I should probably:
- Send users a outage notice
- Stop apache
- Upgrade to the latest 1.7 version
- Export the database
- Install on a new server
- Import the database
- Send users a notice about the new server. Maybe also put a redirect on the old server, pointing to the new one.
 
I'm not sure in particular about how to do the db export/import. I see some people here used "rb-site manage /var/oldRbPath dumpdb > dumpdb.json" , then copy that file over and do "rb-site manage /var/newRbPath loaddb dumpdb.json". Is that the best way? Or is it better to use psql commands to dump the database?
 

David Trowbridge

unread,
Jul 2, 2013, 2:11:53 PM7/2/13
to revie...@googlegroups.com, revie...@googlegroups.com
That procedure sounds fine.
The dumpdb/loaddb commands are really meant for people who are trying to switch database types (for example, SQLite -> MySQL, where the syntax of an SQL dump isn't compatible). If you're sticking with pg, I'd just use pg's dump/load tools, which avoids a lot of slowness converting to and from json.
-David


--
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...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/reviewboard?hl=en
---
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 reviewboard...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Christian Hammond

unread,
Jul 2, 2013, 2:14:43 PM7/2/13
to revie...@googlegroups.com
Hi Peter,

Your plan sounds about right. Let me give you a few more tidbits of info.

First, you don't want to use dumpdb/loaddb. Those are slow, last-resort
methods for going in-between database types (and are not guaranteed to
be bug-free). Instead, you do want psql's native commands.

You can minimize downtime by setting up the latest 1.7 release on the
new server first. Create a temporary database that's used, then copy
over the SECRET_KEY from the old site's conf/settings_local.py into the
new one. Then, when you're ready, you can stop Apache, dump the
database, import on the new server, run 'rb-site upgrade' (to upgrade
the database schema), and then start Apache back up.

I don't know what your DNS setup is like, but you could just set the old
name to point to the new server.

If you're using VMs for any of this, you could put postgres on its own
VM, and then in the future it'll be easier to move Review Board
instances around without dumping/loading the database.

Hope that helps.

Christian
> --
> 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...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/reviewboard?hl=en
> ---
> 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 reviewboard...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

--
Christian Hammond - chi...@chipx86.com
Review Board - http://www.reviewboard.org
Beanbag, Inc. - http://www.beanbaginc.com
Message has been deleted

Peter Snelling

unread,
Jul 3, 2013, 1:32:31 PM7/3/13
to revie...@googlegroups.com, chi...@chipx86.com
Thanks Christian, that worked. There were a couple of small issues. After importing the database, I initially got a message that they couldn't find the directory:
/var/www/OldServer/htdocs/media/uploaded/images
on the new server. I "fixed" this by creating a soft link from OldServer directory to the NewServer. I think the images directory is probably specified in some admin page, but I can't find it.
The second issue is that some users couldn't log in to the new server. I suspect they'd forgotten their password, but I'm not certain. They tried using the "recover" link on the password screen, but that got them a message:
Something broke! (Error 500)
It appears something broke when you tried to go to here. This is either a bug in Review Board or a server configuration error. Please report this to your administrator.
I got that same error when I tried that myself. Perhaps that's a real bug? In any case, I just used the admin interface and reset their passwords.
Good idea on using DNS to hide the server change from users, but unfortunately, there were DNS issues on the old server, so most users used the numerical IP.
If anyone's interested, here are my exact steps (except for the ones I forgot to record):
# On the old server:
/etc/init.d/apache2 stop
easy_install -U ReviewBoard
# Or did I do "rb-site upgrade /var/www/OldServer"? I can't recall. Are they the same thing?
su postgres
pg_dump reviewboard > /tmp/rb.dump
exit
scp /tmp/rb.dump [NewServer]
more conf/settings_local.py
# On New Server (with an identical ReviewBoard and temporary database installed)
/etc/init.d/apache2 stop
systemctl stop postgresql.service
vim conf/settings_local.py [add SECRET_KEY]
su - postgres
dropdb reviewboard
createdb reviewboard
psql reviewboard < /tmp/rb.dump
exit
/etc/init.d/apache2 restart
systemctl restart postgresql.service
cd /var/www 
ln -s NewServer OldServer 
rb-site upgrade /var/www/NewServer
# Probably another restart, then things worked...
- Peter
Reply all
Reply to author
Forward
0 new messages