-
Notifications
You must be signed in to change notification settings - Fork 14
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
Restore mysql fails #66
Comments
Hi! Thanks for reporting this. Here's a workaround for you: assuming that you haven't created any users or set privileges and passwords in your MySQL database manually (you shouldn't), you can add this bit to your Tutor configuration, then after BACKUP_MYSQL_DATABASES:
- openedx (Add other databases except This way, the We should probably make this the default, now that people are moving to Palm and with it, to MySQL 8. Any MySQL user accounts and privileges are managed by Please let us know if this workaround gets you moving again. Thanks! |
That worked like a charm !!!! |
Good to know, but let's not close this just yet — like I said, what I recommended you do was a workaround, not a fix. :) |
hmm, maybe I was too fast confirming. |
@mrtmm What do you think, should we make
So, it probably makes more sense to default to backing up just the The only situation in which this is problematic is if people are running with databases other than |
@mariovitale1979 OAuth settings are in the |
ok, makes sense. Thanks for clarifying. So the plugin's purpose is mainly made for backup/restoring of 1 openedx instance. Not for transferring everything to a different instance. |
You can totally transfer everything to an exactly identically configured instance, as you would if you ran a production Open edX instance in one location and another, non-production one that's running in a different location, so that you can cut over from one instance to the other by, say, a DNS update (or by transferring the IP address behind your DNS name, using a dynamic routing protocol). You can even automate this via scheduled backup and restore; see the README for details. But backing up one database and trying to drop it into a completely different site is something you can't expect to work, without additional modifications, in any Django application. That's not a limitation of Open edX specifically, nor of Tutor, and certainly not of this plugin. |
Or maybe, since we know not having it defined can be problematic in various cases, we can make it a required setting? So anyone who is not using it yet will get a message to set it? So there is no risk of someone silently losing some data from their backups. |
Hmmm at the risk of asking a very silly question, how does one do that, in a way that doesn't break Tutor's expectations? The way I read the cookiecutter, I think we can
But setting a variable with no default that the user must set (that is, a "required" setting) — is that a thing that a plugin is "allowed" (expected) to do? |
Okay, I was thinking of the "unique" option (previously named "add") and when doing something like:
the setting requires itself basically, if you don't have
Well that I am not sure about, it was my interpretation that the "unique" option was suitable for this but now that I read the cookiecutter example again I see that it suggests that a default value should be set. So on second thought, I believe "unique" would still be the right place for this setting because I believe the "settings that don't have a reasonable default for all users" bit applies here; who's also running ecommerce or plugins with a database, we don't know. In addition in that case the setting will be added to |
There is another option that we have here, which is to retain the default for Right, now, we do this: tutor-contrib-backup/tutorbackup/templates/backup/build/backup/backup_services.py Lines 53 to 54 in 1192464
What we could also do is that rather than set If we did that, and
|
That sounds quite reasonable to me :) |
Where do we actually set this BACKUP_MYSQL_DATABASES conf? In config.yml that is located in the root of tutor folder? |
Yes, and in addition you have to add the |
Hello @fghaas , and everyone else, I had the same problem with the 'mysql' schema when trying to restore. I saw the whole conversation here and there are some very interesting solutions. I have one suggestion though which I have implemented in a fork: My changes in the code are here (just one line): And here: Maybe they can be proven useful. ~ ~ ~ Something else I would like to propose is the possibility to create the backup files/folders (before compressing them into the .tar.xz file) inside the /data/backup folder which is mounted and visible outside the container, instead of the /data folder which only exists inside the container. My problem is that our implementation has a disk space problem with our huge data (about 90G for MySQL and MongoDB). |
@dagg Yes please, do send a PR for that! I have a couple of questions/suggestions on your approach, but those are best discussed in a PR thread. Thanks for looking into this! |
Thank you @fghaas the PR has been created! |
@fghaas First of all thank you for the amazing plugin. I wanted to ask, if I only include openedx and other plugin-specific databases (discovery, ecommerce, credentials etc.), does that mean my whole environment will be 100% replicated? Is it an absolute guarantee that the mysql databases which is to be excluded from the backup is not important at all and will be re-created on a fresh install the same? Thanks. |
I am trying to restore one instance onto another, but I hit:
I tried with Any solution to this ? Do we need to manually set the password somewhere to be the same on both instances ? |
Ok, the solution to my issue is not to use |
I have a local openedx installation (Palm edition) and using your plugin I am able to do a backup of Mysql/Mongodb and Caddy.
When I then try to restore it following your instructions, the mysql won't restore.
When investigating further, problems seems related to the mysqldump itself that can't be restored. When trying to restore the mysqldump manually, I get this error.
ERROR 3552 (HY000) at line 25: Access to system schema 'mysql' is rejected.
--> this I could solve by following instructions found here but I wonder if that is really ok ?
But then I get next error:
ERROR 3105 (HY000) at line 218: The value specified for generated column 'default_value' in table 'engine_cost' is not allowed.
So there is an error when trying to recover generated columns but this is now getting out of my league and worrying that the mysqldump needs to be altered to be able to restore it again. I guess that can't be the intention of this plugin who should be plug&play right.
The instructions for using your plugin seems straightforward so no idea what I might be doing wrong.
The text was updated successfully, but these errors were encountered: