-
-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
Can't import my backup #8365
Comments
Katharina jumped on slack and we troubleshooted the issue. Here are our findings. Below are the highlight of our conversation: pascalandy On blog 1, there is only one user at the moment. But there were 4 previously. So for now I decide to copy-paste everything manually on blog 2 and test how it will react if I do the same operation on blog 3 kate
Which has no author_id. Also has no status. Not sure why this happened. I have to investigate and see if i can reproduce this case - to ship a fix. There are a few Please update them with:
pascalandy kate |
@pascalandy 👋 Thanks for the update! What we have to ensure is that if a user get's deleted, we either update the related posts or we allow this when importing. |
Make perfect sense! Thank you for everything :) |
This error won't happen with Ghost This is still an |
Sounds great! |
None that I can think of, we may want to add some smoke tests in Ghost-Admin to ensure that the posts list and editor will load without error if the referenced user is missing. |
Thanks. I did a couple some smaller tests already, nothing crashed for me. Everything behaved okay. |
refs TryGhost#5422 - this is the new integration of the importer - i have used a class inheritance mechanismn to achieve an easier readability and maintenace - most of the logic bits were copied from the old importer or modified/easified - here a list: - schema validation (happens on model layer) was ignored - allow to import unknown user id's (see TryGhost#8365) - most of the duplication handling happens on model layer (we can use the power of unique fields and errors from the database) - this PR has not concentrated on clear error messages or logs (this comes tomorrow) - i've added debug messages - the import is splitted into three steps: - beforeImport --> prepares the data to import, sorts out relations (roles, tags), detects fields (for LTS) - doImport --> does the actual import - afterImport --> updates the data after successful import e.g. update all user reference fields e.g. published_by (compares the imported data with the current state of the database) --> the background why we are doing it after the import is that we don't have to write complicated logic to detect outdated user references before we know which user get's which id --> plus: we don't care about the order of inserting the data --> keep in mind: we never ever import id's, that's why user references are usually outdated --> e.g. you import a post with `published_by:2`, but user 2 get's a new ObjectId 'X', we have to update the reference
refs #5422 - we can support null titles after this PR if we want - user model: fix getAuthorRole - user model: support adding roles by name - we support this for roles as well, this makes it easier when importing related user roles (because usually roles already exists in the database and the related id's are wrong e.g. roles_users) - base model: support for null created_at or updated_at values - post or tag slugs are always safe strings - enable an import of a null slug, no need to crash or to cover this on import layer - add new DataImporter logic - uses a class inheritance mechanism to achieve an easier readability and maintenance - schema validation (happens on model layer) was ignored - allow to import unknown user id's (see #8365) - most of the duplication handling happens on model layer (we can use the power of unique fields and errors from the database) - the import is splitted into three steps: - beforeImport --> prepares the data to import, sorts out relations (roles, tags), detects fields (for LTS) - doImport --> does the actual import - afterImport --> updates the data after successful import e.g. update all user reference fields e.g. published_by (compares the imported data with the current state of the database) - import images: markdown can be null - show error message when json handler can't parse file - do not request gravatar if email is null - return problems/warnings after successful import - optimise warnings in importer - do not return warnings for role duplications, no helpful information - error handler: return context information of error - we show the affected json entries as one line in the UI - show warning for: detected duplicated tag - schema validation: fix valueMustBeBoolean translation - remove context property from json parse error
I am going to close this issue, because we've overhauled the importer in Ghost 1.0. If you experience this problem, please migrate to 1.0 👍 😬 |
Issue Summary
Can’t import my backup.
Steps to Reproduce
Attempting to import data linked to unknown user id 2”
Screenshot: https://cl.ly/0r0n3u2u3u0S
I did this in the past and my backups were imported successfully.
Technical details:
OSX 10.11.6
The text was updated successfully, but these errors were encountered: