Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade DB if initialisation file provided #65

Merged
merged 2 commits into from
May 25, 2015

Conversation

manics
Copy link
Member

@manics manics commented May 21, 2015

This allows the server to be initialised with an old DB dump, e.g.

omego install --initdb --dbname omero --sym OMERO.server -v --omerosql=/ref/2014-12-16-permissions-legacy/permissions_db https://downloads.openmicroscopy.org/omero/5.1.1/artifacts/OMERO.server-5.1.1-ice35-b43.zip

Note only sql files are supported for initialisation, pg_dump files aren't.

@joshmoore
Copy link
Member

$ docker run -d --name omego-pg postgres
$ docker run -ti --rm --link omego-pg:pg openmicroscopy/omero-build-c6-multienv bash
# adduser ome
# su ome
$ export PATH=/opt/rh/postgresql92/root/usr/bin:$PATH
$ export LD_LIBRARY_PATH=/opt/rh/postgresql92/root/usr/lib64/:$LD_LIBRARY_PATH
$ ## This got me more or less started. See below**
$ omego install --initdb --dbname omero --dbhost $PG_PORT_5432_TCP_ADDR --dbuser postgres --sym OMERO.server
$ ## Actual test:
$ omego install --initdb --dbname omero --dbhost 172.17.0.4 --dbuser postgres --sym OMERO.server7 --omerosql=/tmp/omero.sql
...
2015-05-25 17:46:55,625 [omego.extern] INFO  Executing [custom environment]: psql -d omero -h 172.17.0.4 -U postgres -w -A -t -f /tmp/omero.sql
...

👍

Other RFEs from testing --initdb initially above (**):

  1. "no Ice installed" is detected too late (post-download)
  2. a re-run (after fixing Ice not being installed) fails with "ERROR: Symlink already exists: OMERO.server", i.e. perhaps some rollback if nothing has actually happened?
  3. --initdb still produces "stderr: psql: FATAL: database "omero" does not exist", i.e.
  4. --initdb fails with "stderr: invalid command \conninfo" using the current omero-build-c6-multienv with the current postgres image. Can we move all to 9.4?
  5. FATAL: OMERO directory does not exist: /OMERO Perhaps default to running in same directory? or ask for an option if it doesn't exist?
  6. rerun after the FATAL: OMERO directory... tries to re-create the DB ("2015-05-25 17:35:16,994 [ omego.db] WARNI stderr: psql:omero-20150525-173516-044134.sql:25: ERROR: relation "acquisitionmode" already exists") and prints out a lot of errors. Perhaps we could use psql -v ON_ERROR_STOP=1 to make this clearer?
  7. dbhost etc. don't seem to be set on the server. i.e. OMERO.server6/bin/omero config get returns nothing.

@manics
Copy link
Member Author

manics commented May 25, 2015

omego install was a bit of a kludge when it was first added. Are you happy for these to go in a separate PR? https://trello.com/c/UQ1qYuKD/263-omego-install

@joshmoore
Copy link
Member

Definitely. Thanks, @manics

joshmoore added a commit that referenced this pull request May 25, 2015
Upgrade DB if initialisation file provided
@joshmoore joshmoore merged commit 088139c into ome:master May 25, 2015
@manics manics deleted the initdb_upgrade branch May 25, 2015 21:27
@sbesson sbesson added this to the 0.2.5 milestone Aug 21, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants