-
Notifications
You must be signed in to change notification settings - Fork 60
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
Migration path to wagtail 2.11 native multi-language support #208
Comments
I just saw that wagtailtrans currently does not support version 2.11 anymore (only wagtail<2.11). |
I finally managed to create a migration path. Because it finally needed some more steps as expected I wrote a blog post about it. I also created the necessary fork of wagtailtrans at https://github.com/carrotandcompany/wagtailtrans If anyone has any suggestions, improvements, bugfixes to the migration path or the migration fork, I am happy to update the migration guide. Hope this is helpful for others as well. |
This is excellent work @ceelian - huge thanks. 🙏 |
@ceelian Didn't you get an error about 'canonical_page' ? That for example MainPage doesn't have attribute 'canonical_page'? |
@mentecuantica I don't think so. At what step did the error occur? |
@ceelian at the step - Make migrations again
|
|
@ceelian I don't have any mention of canonical_page in my code, here is how my requirements.txt looks like
|
@mentecuantica have you removed wagtailtrans from your settings?
|
@ceelian Nope, i haven't, because this goes much later in your blog |
@mentecuantica can you try that? Because if that works, I will try to improve the blog post. |
@ceelian Yes it helped, a bit for me (cause i have a lot of code logic relying on the wagtailtrans) |
@ceelian I've finally gotten around to trying this (I've spotted a couple of missing bits of info in the blog post, let me know if there's a repo somewhere you want me to PR those to), BUT when I actually come to try running the migration I get...
If I
Do you have any idea what I might have done wrong? The migration (with a load of other page types snipped out) looks like this...
EDIT: Actually, that fields output above was from before I added
I'm going to edit the migration to remove that field before we add it back in. Will report back. Adding a RemoveField operation before the add field gave this error...
And skipping the AddField step altogether gives this error...
|
@drcongo thanks for the feedback. From my side collecting the feedback for improving the migration guide blog post is fine here. If the wagtailtrans team doesn't think this issue isn't the proper place, I will try to come up with a solution. To your question/issue. I already recognised while migrating multiple wagtail sites, that the explained migration procedure isn't 100% applicable to all different setups but the idea should work. That's why I tried to write the reasons behind every step so that you can validate it this step also applies to your specific wagtail setup. It is hard to fully understand what the root cause for your migration issues is, as the DB might have changed with every migration variant you already tried to apply. But it looks a bit that something got a bit out of order on the "Modify the migration file"-step from the blogpost. I try to summarise the core intention of this step here: After you added the Page model to your YourPage:
and generated the migrations, then you need to modify the generated migration file to do 3 things
Regarding this error:
It shouldn't exist if your migration had been applied/successfully run on the db. As the Maybe you accidentally run the migration before doing the changes and now the migration will not run again because django has already saved that migration in its Hope that helps or at least guides you in the right direction for solving your issue. |
First of, thank you @ceelian for your hard work in documenting this process. But, I was wondering. Is there any intent from wagtailtrans or wagtail to make this process smoother, by a command script or such. Or is this documentation what we are going to use if we want to migrate from wagtailtrans to wagtails native language support? |
Thanks for the extra detail @ceelian - I've just been through this from the start again, very carefully but I still get the same issue.
Checking the DB, there is no With both bases
If I take the
Like you say, it's hard to write instructions that work for every use case, and this is a pretty complex site that I'm trying to upgrade. I'm mainly leaving this extra detail here in case anyone passing through happens to have the same problem but also knows what that error message actually means! Update: This appears to be the problem I'm running into https://stackoverflow.com/a/61723620 however I've read it twice and still haven't quite understood it. I'll report back if I ever do. |
Just guessing, but it might be that you forgot to remove the
If you don't remove the bases from the existing migrations of your page, then the migration system doesn't allow you to add an additional field called |
Ooooooh, interesting. That part of the blog post comes after the |
@ceelian thanks for the great write up. I managed to move a quite big site to the new wagtail localize universe and I'm really happy to be on track again. Only thing that wasn't quite clear to me from the beginning, is that if you follow the guide in a development environment and then want to do it on a production environment you can't just commit, push and deploy everything. You need to do it step by step as well on the production environment. I grouped the steps in separate commits and then rolled it out. That worked well. |
Is there a migration path for existing wagtail installation which already uses wagtailtrans to wagtails new native multi-language support as it seems more powerful than wagtailtrans (snippet translations).
(As I am not aware to which project it may concern also added this in wagtail/wagtail-localize#297)
The text was updated successfully, but these errors were encountered: