Jump to content

Migrator


adrian

Recommended Posts

@MilenKo

Ok, just committed new versions of Migrator and also MigratorWordpress so be sure to update both. Comment dates now working and also fixed an issue with comment status from last commit.

I'll look into the comments/tags and homepage issue tomorrow - gotta run :)

  • Like 2
Link to comment
Share on other sites

@adrian it might worth to mention here, that my exported fiile could be messed up due to the several themes installed during the last 5-6 years of the site existence so if something does not work at 100% I would try to use another XML export to make sure it is working fine. Once you are ready with the latest version, I will proceed to test it with my export and another from demo WP.

Link to comment
Share on other sites

Ok. I installed the migrator and tested the latest version of MigratorWordpress. Pushed the XML file that I sent you earlier and with 2 timeouts everything got imported. Here are the results:

1. Home page title has been changed to one of the imported (just the name changes, but the properties are OK so it is easy to fix by renaming the page back to Home).

2. Comments date is still imported improperly (PENDING: Comment #22 Posted 10 minutes ago by Maria appears in the comment edit field).

3. Tags page is created in the import parent page as a separate child, however there are no Tags child pages imported from the wordpress tags.

I will try later to import the pages with comments and approve them by applying the proper templates etc. so that I can check if on the frontend the date would change or would be the one shown  in the admin (10 minutes ago). Once I am done with the test, will report back.

Link to comment
Share on other sites

Hi @MilenKo - sorry for the silence of late - too much going on here. I just pushed some changes I made earlier in the week that should fix the comment datetime issues.

When I get some more this week I'll take another look at the tags issue.

Thanks for your patience!

Link to comment
Share on other sites

Heh, no worries at all @adrian It is perfectly clear that your efforts are put of a good will and you have definitely helped a lot already so no need to apologize for anything. I just saw that MigratorWordpress has been updated 7 days ago and thought I missed your update. Will test the import once I get back toy place tonight and let you know how it works. So far, the only "issue" I had with the importer are the comment dates as I am certain I did not tag the recipes properly and want to edit each one to achieve my new strategy. But hey, no rush at all, OK?

 

 

Link to comment
Share on other sites

@adrian I have just ran the test again this morning using your latest update from GitHub and was super happy to find out that the posts import went OK and the comments time stamp is perfectly matching the original.

The rest (tags, fields etc.) are not imported, but as I mentioned earlier I do not mind fixing them myself as I need to do a lot of crap cleanup beyond the scope of this topic and not related to the module import.

So for now I am totally good to start my work and move the posts to their new home so THANK YOU! 

If you ever need me to test an import or else, I have my local copy set so I can always run it again and again.

For anyone dealing with a migration like mine, feel free to work on your PW Profile (appearance, functionality) then import the WP content to a newly created page of your choice. Once this is done all you have to do is to make sure that the fields in the imported pages are matching the ones in the template you are going to assign the posts to. In my case initially I have imported 600 cooking recipes but the original profile did not contain the comments module yet. So after the import and assigning the imported posts to the recipe template, I lost my comments. To make it work, all I had to do was to assign the comments field to my recipes template and only after that to start changing the imported pages one. Voila, I am now off the WP for good and the work continues.

Link to comment
Share on other sites

@adrianI am coming back with a little issue/question for the importer. After finishing the process I noticed that there is a field called date where the importer adds the post publishing date. So do you know if I delete the field the proper timestamp of the post will be kept?

Link to comment
Share on other sites

On 3/26/2017 at 2:11 PM, MilenKo said:

@adrianI am coming back with a little issue/question for the importer. After finishing the process I noticed that there is a field called date where the importer adds the post publishing date. So do you know if I delete the field the proper timestamp of the post will be kept?

When Migrator and MigratorWordpress were written, there was no system "published" field in Processwire. There is now, so I just pushed updates to both modules to support writing to that system field. Unfortunately untested at the moment (no time today), but hopefully will work as expected.

With that in place, you should be able to delete that "date" field if you wish and use the "published" field to get the same information.

Cheers,
Adrian

  • Like 2
Link to comment
Share on other sites

@adrian I am almost done with the website main html so will start this week/weekend to turn it into the theme I need. Once I star, I will delete from one post the Posted field and see if the date is preserved and what is more important - if it is the correct one. So we will know soon how would that work ;)

Link to comment
Share on other sites

  • 1 month later...

I'm just trying the module. Thanks for the awesome tool. I tried to import the files.zip with edit imported content option after, but after some time I get a error "Missing required ZIP or JSON Source" and nothing has changed.

After trying again without the option to edit, the pages are all flat imported under home instead of creating the structure. 

Edit: Every page in the json has: parent_name: "/"

Link to comment
Share on other sites

Ah yes. No problem, I found the issue. My older Multisite module, which was hooking and altering page paths is the problem. Thats why I removed it from Multisite.

Link to comment
Share on other sites

  • 2 months later...

Hey Guys, I have setup a new Processwire site which was originally a Wordpress site. I was able to successfully migrate the blog using the WordPress Migrator module. 

However, I am running into an issue. I am having trouble migrating only the WordPress pages. 

I can export from WordPress and import into Processwire under the correct section. 

The issue I am having is when I import the WordPress XML. It populates the new pages under the correct section but doesn't use the correct template i indicated which is landing-pages. Instead, it creates a new template called Blog Basic Page. 

Any light on this guys?

Link to comment
Share on other sites

Hi @quickjeff - did you set the template details on the config page of the MigratorWordpress module?

It looks like even though it should use the template you defined, it will use "Basic Blog Page" as the label for the template - see here: https://github.com/adrianbj/MigratorWordpress/blob/fa8c54485f230db39c7fb5f5a42c6f1b5a3d27a9/MigratorWordpress.module#L279

Maybe it's not possible to use existing templates with the MigratorWordpress module - I need to check more thoroughly to confirm. If that's the case, it should be an easy fix though.

 

Link to comment
Share on other sites

48 minutes ago, adrian said:

Hi @quickjeff - did you set the template details on the config page of the MigratorWordpress module?

It looks like even though it should use the template you defined, it will use "Basic Blog Page" as the label for the template - see here: https://github.com/adrianbj/MigratorWordpress/blob/fa8c54485f230db39c7fb5f5a42c6f1b5a3d27a9/MigratorWordpress.module#L279

Maybe it's not possible to use existing templates with the MigratorWordpress module - I need to check more thoroughly to confirm. If that's the case, it should be an easy fix though.

 

Right, I caught this also when browsing where it was being created, I may need to strip this and simply use my existing template. 

Link to comment
Share on other sites

25 minutes ago, quickjeff said:

Right, I caught this also when browsing where it was being created, I may need to strip this and simply use my existing template. 

It should be easy to modify it so that if a template (defined by the user in the module settings) already exists to use it.

If you send a PR directly to the main repo (Nicos), I can merge it for you.

Link to comment
Share on other sites

22 minutes ago, adrian said:

It should be easy to modify it so that if a template (defined by the user in the module settings) already exists to use it.

If you send a PR directly to the main repo (Nicos), I can merge it for you.

Was hoping for a quick solution but might have to rewrite some of this module to use a defined template. Might take a stab at it tonight. 

Link to comment
Share on other sites

  • 3 months later...
On 5/16/2017 at 3:05 AM, Soma said:

I'm just trying the module. Thanks for the awesome tool. I tried to import the files.zip with edit imported content option after, but after some time I get a error "Missing required ZIP or JSON Source" and nothing has changed.

After trying again without the option to edit, the pages are all flat imported under home instead of creating the structure. 

Edit: Every page in the json has: parent_name: "/"

I know this post is ancient, but I went to use Migrator today and experienced the same problem.

I have committed a fix that seems to be working fine. If you or anyone else is still interested in this module, please let me know how the new version goes.

I am still not certain about the future of this module, especially now that the PW core has template, field, and page export/import, but to be honest I think Migrator currently handles more field types and of course has the added benefit of dealing with field, templates, and pages as one entity and takes care of them all for you.

I am curious if others have used the core import/export features and how successful they've been and whether you'd still prefer and all-in-one solution like Migrator and whether you'd consider paying for it. I think I would want to do a considerable rewrite if I went this route, but I am really not sure what the demand is. 

  • Like 1
Link to comment
Share on other sites

49 minutes ago, adrian said:

I am still not certain about the future of this module, especially now that the PW core has template, field, and page export/import

I think that's two totally different things... Migrator is for applying changes to sites in a programmatical way. So you can do... migrations :) Page Import/Export may be helpful when you transfer sites or parts of sites. But I don't think it will be helpful when you have a live site and want to add some new features while you cannot take the site offline and there might be changes in data/content while you are working on the updates.

But I haven't used both of them so far. But I'm watching them for a long time... For me until now it was sufficient to work directly on the live server (having proper backups of course).

I did some tests writing my own modules and applying update scripts... that was also quite easy. But there where situations where I wished I had a helper that takes care of some things like checking if the field that i want to create already exists, deleting all pages before deleting a template etc.; not sure how or if migrator handles that or what you plan exactly by your rewrite but I'm quite sure I would pay for a module that makes this process easier. And I'm quite sure that there is some demand on this staging/production migration topic...

But I also think that tracydebugger has the bigger audience - so this would be more interesting as a business case ;)

  • Like 2
Link to comment
Share on other sites

  • 7 months later...

We're trying to migrate content/fields/templates between environments using the Migrator module, and we ran into this error today:

Recoverable Fatal Error: Object of class stdClass could not be converted to string (line 235 of /var/www/html/wire/core/PageArray.php)

Any thoughts on how to troubleshoot this... I've tried a full dump of pages (large file) and just recently modified pages (small file) and run into the error both ways.

Link to comment
Share on other sites

Hi @Karinne Cyphers - it's hard to debug that error because I don't know where it is originating from. If you could install TracyDebugger you should get a full stack trace of the error so you can point me to the line in the Migrator module that is the origin of this. I expect it is a fieldtype I haven't tested with, but won't know for sure until you can track this down for me.

Link to comment
Share on other sites

5 hours ago, adrian said:

Hi @Karinne Cyphers - it's hard to debug that error because I don't know where it is originating from. If you could install TracyDebugger you should get a full stack trace of the error so you can point me to the line in the Migrator module that is the origin of this. I expect it is a fieldtype I haven't tested with, but won't know for sure until you can track this down for me.

We did some more testing and found that the problem seems to stem from the fact that we use Matrix Repeaters from Ryan's ProFields extensively.  If we remove pages that have those fields we can migrate ok. 

What would a good workaround to this be?  We are trying to use this to migrate template and content changes between 3 different environments.  Without Matrix repeater support we can't really migrate the bulk of our content.

  • Like 1
Link to comment
Share on other sites

HI @Karinne Cyphers - glad you narrowed it down to the Repeater Matrix field. The Migrator module was built before that fieldtype existed and I haven't had time to add support for it. It already works for standard repeater fields though, so it might not be a huge amount of work to implement Repeater Matrix, but unfortunately I don't really have the time at the moment. If you have the time / skills, perhaps you could take a look and provide a PR?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...