Bug 1726467 - [RFE] [5.0] Update the migration instructions
Summary: [RFE] [5.0] Update the migration instructions
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Documentation
Version: 5.11.0
Hardware: Unspecified
OS: Unspecified
medium
urgent
Target Milestone: GA
: 5.11.0
Assignee: Suyog Sainkar
QA Contact: Jaroslav Henner
Red Hat CloudForms Documentation
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-07-03 00:01 UTC by Suyog Sainkar
Modified: 2020-01-07 20:15 UTC (History)
11 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-01-07 20:15:22 UTC
Category: ---
Cloudforms Team: ---
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Suyog Sainkar 2019-07-03 00:01:32 UTC
This bug is a tracker for work on updating the migration instructions ahead of the Red Hat CloudForms 5.0 beta.

Comment 7 Nick Carboni 2019-08-01 20:57:12 UTC
These are the steps I got to work:

On 5.10 database appliance:

- `systemctl stop evmserverd`
- `pg_dumpall -c --if-exists -f vmdb-5.10.pg`

On newly deployed 5.11 appliance:

- Configure a new internal database (appliance console option 7).
- Fetch v2_key from one of the 5.10 appliance.
- Select the same region number and database password as the old installation
- wait for the application to come up

- `systemctl stop evmserverd`
- Copy the GUID file from the 5.10 appliance
- Copy the database dump from the 5.10 appliance
- `psql -f vmdb-5.10.pg postgres`
- `vmdb`
- `bin/rake db:migrate`
- `bin/rake evm:automate:reset`
- `systemctl start evmserverd`

I based this on the last time we needed to "lift-and-shift" the environment for an upgrade which was 5.4 to 5.5 (https://access.redhat.com/articles/2076193)
I imagine this will need some more detail to deal with external databases and additional appliances, but this is what worked for me in a single appliance environment and is probably a good place to start.

We should also do some testing to see just how slow things will be for a large database. We can probably compress the dump file before writing it to disk or even stream the data over to the new database with something like this:

`pg_dumpall -c --if-exists | psql -d postgres -h <5.11-database-hostname> -U root`

But I haven't gotten a chance to test that yet.

Comment 8 Nick Carboni 2019-08-01 21:09:32 UTC
All of the stuff about resizing the disk space and dealing with repos can be removed since we're deploying new appliances.

Since we're also re-creating the databases both HA and region-to-region replication will need to be re-initialized so we can also remove all the HA and region migration ordering stuff. Additionally the guidance should be to remove all the subscriptions from the global region before migrating the global database since the subscriptions will have to be dropped and recreated anyway (it doesn't make sense to move all that data to just delete it and re-replicate it).

Also, I think we will only support upgrades from the most recent prior version (so 4.7).

I think that will be a good start and we can iterate from there.

Comment 9 Jaroslav Henner 2019-08-06 16:11:03 UTC
I tried the steps above, but got

[root@dhcp-8-197-160 vmdb]# psql -f ~/59.nostop.dumpall 
psql: FATAL:  database "root" does not exist


which stops after

[root@dhcp-8-197-160 vmdb]# createdb root

Comment 10 Jaroslav Henner 2019-08-06 16:43:47 UTC
Also, as I said in https://bugzilla.redhat.com/show_bug.cgi?id=1734309#c7

* It seems the documentation should tell to stop evmserverd before making any dump.

Comment 11 Nick Carboni 2019-08-07 13:36:35 UTC
(In reply to Jaroslav Henner from comment #9)
> I tried the steps above, but got
> 
> [root@dhcp-8-197-160 vmdb]# psql -f ~/59.nostop.dumpall 
> psql: FATAL:  database "root" does not exist
> 
> 
> which stops after
> 
> [root@dhcp-8-197-160 vmdb]# createdb root

You did not execute the steps correctly the command I listed is `psql -f vmdb-5.10.pg postgres`, you're missing the "postgres" at the end which would solve the error you hit.

(In reply to Jaroslav Henner from comment #10)
> Also, as I said in https://bugzilla.redhat.com/show_bug.cgi?id=1734309#c7
> 
> * It seems the documentation should tell to stop evmserverd before making
> any dump.

This is already the first step in both sections in comment 7

Comment 13 Jaroslav Henner 2019-08-30 17:53:59 UTC
Setting urgent because to ensure good testing of upgrades I need to have good information about how it is supposed to work.

Comment 14 Jaroslav Henner 2019-08-30 18:07:42 UTC
Note that the db dump that is created on CFME 5.10 using appliance console can be restored with different command:

pg_restore -v --dbname=vmdb_production the_dump_file

This should probably be either written in the doc or the db dump command should be updated in cfme 5.10 appliance console.

Comment 15 Jaroslav Henner 2019-08-30 18:17:07 UTC
seems we forgot to mention the step to copy the /var/www/miq/vmdb/config/database.yml between the machines as it holds encryption password

Comment 16 Jaroslav Henner 2019-09-04 13:39:11 UTC
note this doc https://access.redhat.com/documentation/en-us/red_hat_cloudforms/5.0-beta/html-single/high_availability_guide/index#updating-ha is not up-to-date as it talks about yum update, but we cannot do yum update to update to 5.11

Comment 18 Jaroslav Henner 2019-09-05 17:45:58 UTC
I thikn the document should contain reciepes how to do upgrades of
 * Single instance deployment
 * Deployment with external database
 * HA deployment
 * Centralized control deployment (global and remote replication)

Comment 20 Jaroslav Henner 2019-09-05 18:48:03 UTC
I tried update of the deployment with two appliances with one DB where one is configured to use the db of the other one, both running evmserved (the Deployment with external database). I discovered there is a problem that I don't have any Zone.

I reported a bug about it:
https://bugzilla.redhat.com/show_bug.cgi?id=1749694


Note You need to log in before you can comment on or make changes to this bug.