[Users] engine-backup --restore

Trey Dockendorf treydock at gmail.com
Wed Feb 12 19:32:55 UTC 2014


I was having the same issue (and posted about it today, with full
steps).  I'd reply to my current post to list but I don't seem to
receive my own posts.

I have since taken these steps (as root)

$ su - postgres -c "dropdb engine"
$ su - postgres -c "psql -c \"create user engine password '<PASSWORD>'\""
$ su - postgres -c "psql -c \"create database engine owner engine
template template0 encoding 'UTF8' lc_collate 'en_US.UTF-8' lc_ctype
'en_US.UTF-8'\""
$ engine-backup --mode=restore --scope=all
--file=engine-20140211-1457.tar.bz2 --log=engine-backup.log
--change-db-credentials --db-host=localhost --db-port=5432
--db-user=engine --db-name=engine --db-password=<PASSWORD>
Restoring...
Rewriting /etc/ovirt-engine/engine.conf.d/10-setup-database.conf
Note: you might need to manually fix:
- iptables/firewalld configuration
- autostart of ovirt-engine service
You can now start the engine service and then restart httpd
Done.

$ engine-setup

I believe I initially created the database incorrectly (ran 'createdb
engine' as postgres user).  I was getting errors during engine-setup
that indicated the database could not be accessed.

After the steps above, everything looks good.

- Trey


On Wed, Feb 12, 2014 at 1:10 PM, Juan Pablo Lorier <jplorier at gmail.com> wrote:
> Well, too soon to say boodbye.
> Thought I used --change-db-credentials in the restore, the engine seems
> to be unable to connect to the database. I assume that it didn't get the
> new password, so, is there a way to tell the engine about the new password?
> Regards,
>
> On 12/02/14 16:03, Yedidyah Bar David wrote:
>> ----- Original Message -----
>>> From: "Juan Pablo Lorier" <jplorier at gmail.com>
>>> To: "Yedidyah Bar David" <didi at redhat.com>
>>> Cc: "Sahina Bose" <sabose at redhat.com>, "users" <users at ovirt.org>
>>> Sent: Wednesday, February 12, 2014 7:55:35 PM
>>> Subject: Re: [Users] Problems accesing the database
>>>
>>> Hi Yedidyah,
>>>
>>> But If I run engine-setup and then engine-backup restore shuldn't it
>>> import the data to the existing db created by engine-setup?
>>> That's shown everywhere so I thought it's a valid way to migrate
>> No.
>>
>> There is a specific case in which this works automatically:
>> All on the same host:
>> 1. engine-setup
>> 2. engine-backup --mode=backup
>> (perhaps do other stuff here)
>> 3. engine-cleanup
>> 4. engine-backup --mode=restore
>>
>> Why does this work? Because 'engine-cleanup', since 3.3, does not drop
>> the database nor user inside postgres. So when restore tries to access
>> this database using this user and password it succeeds.
>>
>> In general, if you do the restore on another machine, and do there
>> 'engine-setup; engine-cleanup' as a quick-postgres-provisioning-tool,
>> you end up almost ready, but not quite - because the password is random,
>> and therefore different between the installations. In principle you could
>> have provided just the password to restore, but we decided that if you
>> need to change the credentials, you should pass all of them (except for
>> defaults).
>>
>> Hope this clarifies,
>
>
>
> _______________________________________________
> Users mailing list
> Users at ovirt.org
> http://lists.ovirt.org/mailman/listinfo/users
>



More information about the Users mailing list