-
-
Notifications
You must be signed in to change notification settings - Fork 229
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
Attempt to start new version of Ghost during ghost update
#153
Comments
ghost update
ghost update
Some thoughts on this. First of all, we have to turn the current ghost blog into maintenance mode to avoid any updates to the database. We already have a maintenance flag in Ghost. One problem with mysql could be that mysqldump is not available, because the executable is not correctly linked, but we could ignore that for the first version and tell the user why auto update wasn't working. Also, there are npm modules out there to dump and insert mysql database via javascript, e.g. https://github.com/webcaetano/mysqldump (deleted the second link) Furthermore we have to override the database name/filename via env parameter if we start knex-migrator or if we start the new blog. If a migration happens and it fails, ghost-cli will know, because knex-migrator will fail. |
That makes sense. I was thinking "trickier" along the lines of creating a new database might not work if the db user doesn't have the proper permissions. But what we could do in mysql is just dump the db and then try migrating-if that doesn't work then restore the old database from either the dump (if mysql) or the actual db file (if sqlite). |
Our bot has automatically marked this issue as stale because there has not been any activity here in some time. The issue will be closed soon if there are no further updates, however we ask that you do not post comments to keep the issue open if you are not actively working on a PR. We keep the issue list minimal so we can keep focus on the most pressing issues. Closed issues can always be reopened if a new contributor is found. Thank you for understanding 🙂 |
The current update process works as follows:
However, if an issue occurred during the installation of the new Ghost version, that issue won't be discovered until the blog is restarted, leaving your blog in an offline state. This is especially critical for automatic/one-click updates, as the user won't be running the update through the traditional means.
So the idea is to start the new version of Ghost on a different port temporarily before stopping & starting Ghost. This should be fairly simple, and there is already a library (portfinder) in Ghost-CLI that can be used to find an open port.
However, this will involve some other thinking - namely how to start the new version of Ghost with the same content, without messing with the current live database. With SQLite this should be pretty easy - just create a copy of the DB file, however if the user is using a MySQL database it might be a little trickier. Definitely needs some thought - as we don't want to just implicitly require that a sqlite database exist.
Kate Note: This is only related to one click updates!
The text was updated successfully, but these errors were encountered: