Page 1 of 1

Can I restore from 4.X straight to 5.2.2

PostPosted: Sat Apr 30, 2016 5:35 am
by Magic
I have a server running Ubuntu 12.04 and Omero 4.4.4. It's running fine. I don't want to in any way touch it right now.

I also have an rsynced backup of that server's complete data. And I have a postgres dumpall of the database.

I'd like to do a restore on a different computer of the data to make sure the backup is working properly.

I've gone ahead and setup a completely different computer running Ubuntu 14.04 (actually a KVM instance of Ubuntu 14.04, running under a bare metal 14.04, but presumably that doesn't matter).

Can I go ahead and install the latest version of Omero on this new system? And then restore my data? And just have everything work properly under 5.2.2? Any hints as to how to best do this?

Or do I have to for some reason get everything working again under 4.4.4 on this new server, and then upgrade? That sounds like a lot of extra work that I'd rather avoid.

Any suggestions would be appreciated. In the meantime I'll just give it my best try, and post more questions as I have them.

Thanks.

Re: Can I restore from 4.X straight to 5.2.2

PostPosted: Sat Apr 30, 2016 7:46 am
by atarkowska
Hi,

Can I go ahead and install the latest version of Omero on this new system? And then restore my data? And just have everything work properly under 5.2.2? Any hints as to how to best do this?

Or do I have to for some reason get everything working again under 4.4.4 on this new server, and then upgrade? That sounds like a lot of extra work that I'd rather avoid.


Once you have OMERO 5.2 installed, I think you could start from upgrading database. You would need to go through each db patch as follow:

Code: Select all
$ pg_dump -h localhost -U omero -Fc -f /tmp/omero4.db.dump omero4
Password:
$ createdb -E UTF8 -O omero test_upgrade
$ pg_restore -Fc -d test_upgrade /tmp/omero4.db.dump
$ psql -h localhost -U omero test_upgrade < sql/psql/OMERO5.0__0/OMERO4.4__0.sql
...
                              status                               
---------------------------------------------------------------------
                                                                    +
                                                                    +
                                                                    +
YOU HAVE SUCCESSFULLY UPGRADED YOUR DATABASE TO VERSION OMERO5.0__0+
                                                                    +
                                                                    +

(1 row)

COMMIT
$ psql -h localhost -U omero test_upgrade < sql/psql/OMERO5.1__1/OMERO5.0__0.sql
...
                              status                               
---------------------------------------------------------------------
                                                                    +
                                                                    +
                                                                    +
YOU HAVE SUCCESSFULLY UPGRADED YOUR DATABASE TO VERSION OMERO5.1__1+
                                                                    +
                                                                    +

(1 row)

COMMIT
$ psql -h localhost -U omero test_upgrade < sql/psql/OMERO5.2__0/OMERO5.1__1.sql
                               status                               
---------------------------------------------------------------------
                                                                    +
                                                                    +
                                                                    +
YOU HAVE SUCCESSFULLY UPGRADED YOUR DATABASE TO VERSION OMERO5.2__0+
                                                                    +
                                                                    +

(1 row)

COMMIT

remember to point omero config to your newly restored db
Code: Select all
$ bin/omero config set omero.db.name test_upgrade


Please note that I dumped and restored db using the same PostgreSQL. If for some reason db dump was created using older version of PostgreSQL and you cannot restore on new one you may consider dumping plain sql
Code: Select all
pg_dump -h old.postgres -U omero omero4 -O | gzip > /tmp/omero4.dump.gz
gunzip -c /tmp/omero4.dump.gz | psql -h new.postgres -U omero test_upgrade


Once db is up to date you need to copy over data repository. Find out which directory it is on the old omero deployment:
Code: Select all
bin/omero config get | grep omero.data.dir
omero.data.dir=/OMERO4


Next step will be to copy configuration. Our documentation recommend to copy config file:
Code: Select all
cp OMERO.server-old/etc/grid/config.xml OMERO.server/etc/grid
Although, this may be more complicated. Depends on how your infrastructure look like on new server, database settings, data repo, etc they can be different. I am guessing the simplest would be to apply relevant settings manually on the new deployment. If you are not sure send us the output of your omero4 config
Code: Select all
OMERO.server-old/bin/omero config get
and we will advice exactly how to do it.

Please note that OMERO.web deployment changed http://www.openmicroscopy.org/site/supp ... nginx.html. You would need to apply new settings to get web working as well.


Once all of the above are done start OMERO.server and try cli to connect to:
Code: Select all
$ bin/omero login
Previous session expired for root on localhost:4064
Server: [localhost:4064]
Username: [root]
Password:
Created session 82728645-b7e7-475b-9602-2aabe3ae9700 (root@localhost:4064). Idle timeout: 10 min. Current group: system


I hope that will help

Ola