openshift scaling up - "Unable to restore mysql-5.5 because it appears there is no snapshot for that type"

StackOverflow https://stackoverflow.com/questions/22222076

  •  10-06-2023
  •  | 
  •  

Question

I have a openshift app with MySQL 5.5, PHP 5.4 and phpMyAdmin 4.0 I would like to convert this to be scalable.

So according to instructions by Shekhar Gulati on - https://www.openshift.com/forums/openshift/recreate-an-existing-app-so-it-is-scaleable#comment-30153 I took a snapshot of the old app.
Created a new scalable app with

$ rhc app create -s apiprod php-5.4 mysql-5.5 phpmyadmin-4

Since the old app had phpMyAdmin - and we cannot add phpmyadmin to a scalable app. So created the new app with just

$ rhc app create -s apiprod php-5.4 mysql-5.5 

Untarred the old snapshot, deleted the phpMyAdmin subdirectory from the old snapshot, tarred it up again, and tried restoring to the new scalable app - got the following error -

dev@ubuntusrv2:~$ rhc snapshot restore -a apiprod -f oldapp.tar.gz
Restoring from snapshot oldapp.tar.gz...
Removing old git repo: ~/git/apiprod.git/
Removing old data dir: ~/app-root/data/*
Restoring ~/git/apiprod.git and ~/app-root/data
Unable to restore mysql-5.5 because it appears there is no snapshot for that type
Activation status: success

RESULT:
Success

Now, this problem seems to be similar to the one experienced by Molokov on https://www.openshift.com/forums/openshift/recreate-an-existing-app-so-it-is-scaleable#comment-33240

Following the steps outlined by Molokov, I managed to restore my old app to the new scalable app without an error.

But mysqli::mysqli() seems to be having a problem connecting to the database -
command line access works all right -

[apiprod-domain.rhcloud.com behat]\> echo $OPENSHIFT_MYSQL_DB_HOST
53182ea2500446463d00002e-domain.rhcloud.com
[apiprod-domain.rhcloud.com behat]\> mysql -h 53182ea2500446463d00002e-domain.rhcloud.com -u test -p
(can log in all right)

ssh-ing back to oldapp shows an IP address instead of a hostname like on the new scalable app

[apiv1-domain.rhcloud.com 53101d1e5004465baa000282]\> echo $OPENSHIFT_MYSQL_DB_HOST
127.3.76.130

I am impressed by the ease with which things can be setup with Openshift Online and would like to use it for production.

This should be a fairly common use case - I would happy to know how I should proceed

Was it helpful?

Solution

Creating a snapshot of a single gear application, and restoring to a scaled application is not supported, because of the way that the snapshots are created, and the fact that in a scaled application the db's etc go on their own gears. If you restore a snapshot of a non-scaled application to a non-scaled application, it does not currently know how to get the database onto the database gear. I believe the correct solution for this scenario would actually be to create a workflow on openshift that would facilitate a push button solution to migrating from a non-scaled to a scaled solution. Please make sure you vote on that feature here (https://www.openshift.com/content/conversion-of-non-scalable-app-to-scalable-one)

Also, here is a Knowledge Base article I just posted about it:https://www.openshift.com/kb/kb-e1092-user-is-not-able-to-restore-snapshot-of-non-scaled-application-to-scaled-application-or

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top