Jump to content

Migrator


adrian

Recommended Posts

Hey Joss - thanks for the file.

The issue was with some broken images embedded into your blog posts - some linking to an old joomla site :). Migrator now handles broken images properly so no errors.

I also took the opportunity to add a few more fixes and enhancements to embedded images and captions - links to the original sized version now also work (although I am wondering the best way to add a class for lightbox display of these. I don't want to assume the class that users want, so maybe this needs to be a configurable setting - any thoughts?).

Please try the latest versions of both ProcessMigrator and MigratorWordpress (again from my fork) and let me know how you go.

Here's a screenshot of what one of blog posts looks like for me once imported. Be patient - it can take quite some time to download all those images, but it will work :)

post-985-0-51869800-1417570430_thumb.png

  • Like 1
Link to comment
Share on other sites

I think with the lightbox side you could add a field for a class, but some lightboxes need more than that and it could get complicated. Maybe a note in the instructions that this might be something better handled with a bit of javascript on the fly. I might find a mix between the two useful - adding a class at processing at least identifies the image and then one could decide what to do later.

On the other hand, a blog might not always have images linked to bigger version - so not sure what to do then....

Link to comment
Share on other sites

  • 3 weeks later...

Any finally got it to import my contents but i had to comment the following

 
if(empty($fp)){



                $this->error("Missing required ZIP or JSON Source");
                if($this->session->migratorFilesDir && file_exists($this->session->migratorFilesDir)) $this->recursiveDelete($this->session->migratorFilesDir);
                //$this->session->redirect('./'.$this->session->type);
                return $form->render();
            }
Link to comment
Share on other sites

I am not really sure on why that would happen - did the import actually work properly after commenting out that check?

The fact that $fp is empty at that point in the code suggests that the conversion from the xml into a json file ready for parsing by migrator didn't work. But if it all worked as expected for you, then I'll just add it to my list of things to keep an eye on.

Link to comment
Share on other sites

I am not sure why you are getting that missing required zip or json error, but it would be helpful if you could PM me the xml file so I can test. 

I don't really understand what is wrong in the second image you posted.

To attach images here, you need to click the "More Reply Options" button.

Link to comment
Share on other sites

Thanks - I have been doing lots of testing with your file and can't replicate the "missing required zip or json" error. I did however find some bugs regarding image import in certain situations that I have just fixed, so please grab the latest versions of both Migrator and MigratorWordpress.

I will send some screenshots showing the properly imported content in reply to the PM you sent.

In an attempt to figure out why you are getting that error, can you please try logging the value of: $this->session->jsonFilename and also uncomment the exit on line 882. Then make sure that there is some json content in the file at the path that should be stored in: $this->session->jsonFilename

Link to comment
Share on other sites

While trying to get some contents into my site i got the following issue, been familiar with PHP Development I tried looking for codes that tried to do the similar:

$SessionFakeObject->set('keyStore',$DatabaseInstance);

As the above will cause the $DatabaseInstance to be serialized which is not allowed, however I have tried debugging and can't really point what could be the cause (also my Zend Debugger is busted) so if anyone has experienced such error please respond so i look at how to fix it. 

As for the previous error am behind a Firewall so that's explainable

post-2850-0-03174200-1419933727_thumb.pn

Link to comment
Share on other sites

Sepiroth - I moved your post here, because all those relate to Migrator.

The first one regarding Github is surprising - perhaps they were down momentarily. Please let me know if you continue to see that one.

The serialize error is also a mystery to me - I see it occasionally when I use Migrator - it seems to be random and it doesn't seem to affect the import process. I don't do any database serialization in the module at all. I need to investigate further at some point, but I think for the moment it can be safely ignored.

Link to comment
Share on other sites

Sepiroth - I moved your post here, because all those relate to Migrator.

The first one regarding Github is surprising - perhaps they were down momentarily. Please let me know if you continue to see that one.

The serialize error is also a mystery to me - I see it occasionally when I use Migrator - it seems to be random and it doesn't seem to affect the import process. I don't do any database serialization in the module at all. I need to investigate further at some point, but I think for the moment it can be safely ignored.

The first one is all me I work in Switching company (Online Payment and all), so our firewall is pretty strong so that I know is as a result of the firewall, however the second error which is quite confusing because there's no assign of any Database instance in a session in your code. so am wondering how that's happening. Spent the whole night trying to get my Zend Debugger working but failed once its up i will check the Debug steps. 

Link to comment
Share on other sites

Okay so i switched to Xdebug and spent the whole night debugging and during the Xdebug it never broke at ll, it converted the code and returned the json and exited as expected. This has nothing to do with the Module/Processwire if not i should have been thrown an exception during the debugging. so i will research more on this but i took out the thirdparty.json it outputted after monitoring the code. will simply import that and move on with life. 

Link to comment
Share on other sites

Very glad it is working for you as expected. But I am curious what, if any changes you made. Did the Github issue fix itself?

What about the missing zip/json error - was that just a result of the exit code commenting?

Is there anything else I should know about?

Thanks again for your extensive testing - did you ever figure out anything around that serialization error?

Link to comment
Share on other sites

The exit code stops the script so it was the main reason i assumed the PDOException halted it but when i commented it, the script works perfectly. I no longer get the Missing Json or Zip Source message. As for the PDO Serialization issue i guess it's something we have to keep in mind, I have researched and scanned all PW source code I can't see any reason why it should. but I will occasionally look into it gradually. 

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...

Hi, I'm trying to import pages with images from a website to another (PW 2.5.3 both) using migrator module, but I get errors and it doesn't work for me.


The errors appear during import.


I set the home as parent and then I click "upload and create content" button and the result are shown in this images.


 


error1a.jpg


 


error1b.jpg


 


 


If instead I check "Edit Imported content", after I click "Upload and create content" button, everything seems to work but in the end of the page I have this error


 


error2.jpg


 


And after when I click "Create Content" I have this one


 


error3.jpg


 


This the first time I use migrator. Thank you for any help.


Link to comment
Share on other sites

Okay so increasing post_max_size works but if it's lower it fails silently so maybe a feature would be a message that checks the size of file against the ini_get('post_max_size') and display that to the user. should i create a pull-request for that ? Happy Sunday

  • Like 1
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...