How to move an existing database to a new server

Hi all,
I am trying to move an existing RT database (3.8.11) to a new server running
4.0.4.
I have succesfully done a dump and scp and imported the database on the new
server.
When I log in to RT via the browser I can see the database but when I try to
take a ticket I get the following error- Could not change owner: Couldn’t
add member to group

Which I am assuming means that the database is actually not connected or
something else needs to happen in the back end for it to work.

I am using Ubuntu server 12.04.5 LTS on a vm machine.
I do have a snapshot of the new server prior to importing the old database
if other steps are required first prior to importing.

I would be most grateful for any input.
Having searched around on the internet I did try rt-setup-database --schema
and upgrade with no result.

Thank you
Vas

View this message in context: http://requesttracker.8502.n7.nabble.com/How-to-move-an-existing-database-to-a-new-server-tp58875.html

Vas,

Not being familiar with Ubuntu so I don’t know where your rt4 install
directory is but on CentOS\RHEL it would be /opt/rt4 so I would run
something like this: “/opt/rt4/sbin/rt-setup-database --action upgrade”

I had a database from rt 3.8.6 build and similarly did a dump \ restore
to rt 4.2.8 build. When running above command it asked me what version
am I upgrading from and it ran the necessary updates. After running the
upgrade command did you see something like the following:
In order to create or update your RT database, this script needs to
connect to your Pg instance on localhost (port ‘’) as root
Please specify that user’s database password below. If the user has no
database
password, just press return.

Password:
Working with:
Type: Pg
Host: localhost
Port:
Name: rt4
User: rt_user
DBA: root

Try setting your LogLevel to debug. I’m sure it will provide some
helpful info. If you pass it along I’m confident somebody from the list
can provide further assistance besides a RT newbie like myself : )

William Clarke
ITS System Administrator
Bard College at Simon’s Rock
84 Alford Road
Great Barrington, MA 01230
(413) 528-7428 (voice)
(413) 528-7405 (fax)
wclarke@simons-rock.eduOn 10/21/2014 5:01 AM, Vas wrote:

Hi all,
I am trying to move an existing RT database (3.8.11) to a new server running
4.0.4.
I have succesfully done a dump and scp and imported the database on the new
server.
When I log in to RT via the browser I can see the database but when I try to
take a ticket I get the following error- Could not change owner: Couldn’t
add member to group

Which I am assuming means that the database is actually not connected or
something else needs to happen in the back end for it to work.

I am using Ubuntu server 12.04.5 LTS on a vm machine.
I do have a snapshot of the new server prior to importing the old database
if other steps are required first prior to importing.

I would be most grateful for any input.
Having searched around on the internet I did try rt-setup-database --schema
and upgrade with no result.

Thank you
Vas


View this message in context:http://requesttracker.8502.n7.nabble.com/How-to-move-an-existing-database-to-a-new-server-tp58875.html
Sent from the Request Tracker - User mailing list archive at Nabble.com.

William,
thank you for your input.
I tried what you suggested and it gave me the following error:
http://requesttracker.8502.n7.nabble.com/file/n58916/rtupgrade.png
I would be grateful for some advice on what the problem may be.
I tried looking at the debug log but I get no file or directory when I tail
-n 10 /var/log/debug
Advice on how to view log files would be appreciated also.

Thank you
Vas

View this message in context: http://requesttracker.8502.n7.nabble.com/How-to-move-an-existing-database-to-a-new-server-tp58875p58916.html

thank you for your input.
I tried what you suggested and it gave me the following error:
http://requesttracker.8502.n7.nabble.com/file/n58916/rtupgrade.png
I would be grateful for some advice on what the problem may be.

I assume you’ve created an initialized 4.0 database, restored your
3.8 database into it and then run the upgrade steps, which attempts
to create the Classes table. This table already existed in your
initialized 4.0 database.

A few points.

4.0.4 is from November 2011. If you’re going to upgrade, I suggest RT
4.2.9 or at least a later RT 4.0 release.

Assuming this is a dev server, I would drop your database
/opt/rt4/sbin/rt-setup-database --action drop

and then follow the database restoration procedures we document here
for a new server

http://bestpractical.com/docs/rt/latest/backups.html#Restoring-from-backups

which create an empty database before restoring your backup into it.

But again, ask yourself why you’re upgrading to a 3 year old release
of the software, one with published security flaws.

-kevin

Thank you for the input Kevin.
Is there an installation guide for RT 4.2.9 with a LTS Ubuntu?
So far I have only found a 4.2 with Ubuntu 13.10 which is not supported
anymore.

And with a LTS Ubuntu on 4.0.4 which is similiar to what I used

RT Wiki page also does not contains any recent installation guides.

Vas

View this message in context: http://requesttracker.8502.n7.nabble.com/How-to-move-an-existing-database-to-a-new-server-tp58875p58930.html

A little update.
I have manage to install rt 4.2.9 on a dev server on ubuntu 14.4.1 :slight_smile:
I have followed as you recommended this:
http://bestpractical.com/docs/rt/latest/backups.html#Restoring-from-backups
and have made the rt-dump.sql.gz and moved it to the new dev server.
Since this is a fresh install with no data do I still need to
/opt/rt4/sbin/rt-setup-database --action drop
/opt/rt4/sbin/rt-setup-database --action create ?
Or do I go
gunzip -c rt-dump.sql.gz | psql rt4
and then
/opt/rt4/sbin/rt-setup-database --action upgrade?

Thank you
Vas

View this message in context: http://requesttracker.8502.n7.nabble.com/How-to-move-an-existing-database-to-a-new-server-tp58875p58966.html

Hi all,
I would be most grateful if I could get an answer to my problem.
thank you

kind regards
Vas

View this message in context: http://requesttracker.8502.n7.nabble.com/How-to-move-an-existing-database-to-a-new-server-tp58875p58984.html

A little update.
I have manage to install rt 4.2.9 on a dev server on ubuntu 14.4.1 :slight_smile:
I have followed as you recommended this:
http://bestpractical.com/docs/rt/latest/backups.html#Restoring-from-backups
and have made the rt-dump.sql.gz and moved it to the new dev server.
Since this is a fresh install with no data do I still need to
/opt/rt4/sbin/rt-setup-database --action drop
/opt/rt4/sbin/rt-setup-database --action create ?
Or do I go
gunzip -c rt-dump.sql.gz | psql rt4
and then
/opt/rt4/sbin/rt-setup-database --action upgrade?

If it’s a fresh install, how did you install it?
Did you already run ‘make initdb’ from the tarball?
If so, then you will have tables you shouldn’t have already and yes,
will want to drop and create before running upgrade.
If you’ve not run make initdb then you’ll want to run

 /opt/rt4/sbin/rt-setup-database --action create,acl

Which is documented under the catastrophic part of those docs.

I would be most grateful if I could get an answer to my problem.

I’ll note that the mailing lists don’t have an SLA, in fact they have
no guarantee of a response (especially not on a Sunday, or when the
engineers who monitor the list are on vacation). If you need an SLA,
that’s what Best Practical’s commercial services are for.

-kevin

Hi Kevin,
once again thank you for your reply.

So If understood correctly:

1)/opt/rt4/sbin/rt-setup-database --action drop database (drop the existing
rt4 database which I created when first install rt4.2.9)
Followed this guide

so I have done initdb and don’t need to do again?
2)/opt/rt4/sbin/rt-setup-database --action create database,acl (create a new
database with acl)
3)gunzip -c rt-mydump.sql.gz | mysql -uroot -p rt4
4)/opt/rt4/sbin/rt-setup-database --action upgrade

On step 4 I get Error: Couldn’t read dir ‘./etc/upgrade’ with upgrade data

Having a read around, this error comes up if you are not running from the
extracted source directory.
But my understanding was that /opt/rt4/sbin is the correct location because
step 1&2 work with no problems.

Thank you
Vas

View this message in context: http://requesttracker.8502.n7.nabble.com/How-to-move-an-existing-database-to-a-new-server-tp58875p58999.html