adrian

Module
Migrator

289 posts in this topic

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

1 person likes this

Share this post


Link to post
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....

Share this post


Link to post
Share on other sites

Am not importing a JSON its a wordpress.xml am trying to import to Processwire using Nico's MigratorWordpress. wow that was a fast response

Share this post


Link to post
Share on other sites

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();
            }

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Ignore what i wrote it imported also without the comment, am still going to look at it again in the morning take care

Share this post


Link to post
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.

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Thanks now i am more encourage knowing it works on your end. I will do as specified and debug it and monitor the variables. I wanted to be sure I wasn't an exception thanks alot andrian.

1 person likes this

Share this post


Link to post
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

Share this post


Link to post
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.

Share this post


Link to post
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. 

Share this post


Link to post
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. 

Share this post


Link to post
Share on other sites

All the Post imported into ProcessWire from WordPress thanks alot am really glad thanks for the support.

post-2850-0-38131100-1420126463_thumb.pn

1 person likes this

Share this post


Link to post
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?

Share this post


Link to post
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. 

1 person likes this

Share this post


Link to post
Share on other sites

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.


Share this post


Link to post
Share on other sites

Has anyone tried importing an XML the size of 30mb when i try to nothing happens it just renders the same page. will try increasing my post_max_size and see what happens.

Share this post


Link to post
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

1 person likes this

Share this post


Link to post
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

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By bernhard
      Hi,
      just stumbled over a little module that i built for my last project. it helped me to test performance of my rockdatatables module to generate 3000 random json datasets and i want to share it with you. maybe it saves some time for someone.
      https://gitlab.com/baumrock/RockDummyData/
      easy example:
      $rdd = $modules->get('RockDummyData'); for($i=0; $i<15; $i++) { // this has to be inside the for-loop to always get a new dummy $dummy = $rdd->getDummy(); echo date("d.m.Y H:i:s", $dummy->timestamp) . "<br>"; } more advanced:
      $json = new stdClass(); $json->data = array(); $rdd = $modules->get('RockDummyData'); for($i=0; $i<3000; $i++) { // this has to be inside the for-loop to always get a new dummy $dummy = $rdd->getDummy(); $obj = new stdClass(); $obj->name = $dummy->forename . ' ' . $dummy->surname; $obj->position = $dummy->job; $obj->office = $dummy->city; $obj->color = $dummy->color; $obj->start_date = new stdClass(); $obj->start_date->display = date('d.m.Y',$dummy->timestamp); $obj->start_date->sort = $dummy->timestamp; $obj->salary = rand(0,10000); $json->data[] = $obj; } echo json_encode($json); you have to store your random datasets on your own into the /data folder. there are several services for creating all kinds of random data on the web - if you know one service that allows sharing those datasets let me know and i can include common needed data into the module
    • By AndySh
      Hello!
      I need your assistance please. I purchased the module FormBuilder. Unfortunately, the module discontinued delivering customer submissions to e-mail box specified in the module settings. Direct mailing to the e-mail box works OK. The module settings stays the same and are correct, like "Send e-mail to administrator(s) is checked. The last version of FormBuilder 3.0 has been installed. Please advise how to resolve the issue becase I cannot get orders from customers anymore (((
    • By kixe
      As described in this post (https://processwire.com/talk/topic/8551-custom-urls-for-pages/?p=82742) the option 'Name Format Children' under the tab 'Family' in template settings doesn't work properly and also not as expected. I had a look inside the code and made some changes which are working properly, which offers much more options, more consistency and less code too.

      The result is the following. You have 3 Options for generating name and title, which could be combined in endless variations.
      Name is always derived from title, same like creating pages manually.
      type date: if function detects # character anywhere in the string, conversion will be: deletion of # and string will be used as format parameter for PHP date() function type field: if string is a fieldname of the parent page the value of this field will be used type string: if string doesn't fit to the 2 preceeding it will be taken as it is All parts (separated by comma) will be composed in the order of setting. You can use unlimited numbers of parts

      I made a pull request on github: https://github.com/ryancramerdesign/ProcessWire/pull/831

      Example screenshots

      Setting ...


      will result in


       
    • By kongondo
      FieldtypeRuntimeMarkup and InputfieldRuntimeMarkup
       
      Modules Directory: http://modules.processwire.com/modules/fieldtype-runtime-markup/
      GitHub: https://github.com/kongondo/FieldtypeRuntimeMarkup
       
      This module allows for custom markup to be dynamically (PHP) generated and output within a page's edit screen (in Admin).
       
      The value for the fieldtype is generated at runtime. No data is saved in the database. The accompanying InputfieldRuntimeMarkup is only used to render/display the markup in the page edit screen.
       
      The field's value is accessible from the ProcessWire API in the frontend like any other field, i.e. it has access to $page and $pages.
       
      The module was commissioned/sponsored by @Valan. Although there's certainly other ways to achieve what this module does, it offers a dynamic and flexible alternative to generating your own markup in a page's edit screen whilst also allowing access to that markup in the frontend. Thanks Valan!
       
      Warning/Consideration
      Although access to ProcessWire's Fields' admin pages is only available to Superusers, this Fieldtype will evaluate and run the custom PHP Code entered and saved in the field's settings (Details tab). Utmost care should therefore be taken in making sure your code does not perform any CRUD operations!! (unless of course that's intentional) The value for this fieldtype is generated at runtime and thus no data is stored in the database. This means that you cannot directly query a RuntimeMarkup field from $pages->find(). Usage and API
       
      Backend
      Enter your custom PHP snippet in the Details tab of your field (it is RECOMMENDED though that you use wireRenderFile() instead. See example below). Your code can be as simple or as complicated as you want as long as in the end you return a value that is not an array or an object or anything other than a string/integer.
       
      FieldtypeRuntimeMarkup has access to $page (the current page being edited/viewed) and $pages. 
       
      A very simple example.
      return 'Hello'; Simple example.
      return $page->title; Simple example with markup.
      return '<h2>' . $page->title . '</h2>'; Another simple example with markup.
      $out = '<h1>hello '; $out .= $page->title; $out .= '</h1>'; return $out; A more advanced example.
      $p = $pages->get('/about-us/')->child('sort=random'); return '<p>' . $p->title . '</p>'; An even more complex example.
      $str =''; if($page->name == 'about-us') { $p = $page->children->last(); $str = "<h2><a href='{$p->url}'>{$p->title}</a></h2>"; } else { $str = "<h2><a href='{$page->url}'>{$page->title}</a></h2>"; } return $str; Rather than type your code directly in the Details tab of the field, it is highly recommended that you placed all your code in an external file and call that file using the core wireRenderFile() method. Taking this approach means you will be able to edit your code in your favourite text editor. It also means you will be able to type more text without having to scroll. Editing the file is also easier than editing the field. To use this approach, simply do:
      return wireRenderFile('name-of-file');// file will be in /site/templates/ If using ProcessWire 3.x, you will need to use namespace as follows:
      return ProcessWire\wireRenderFile('name-of-file'); How to access the value of RuntimeMarkup in the frontend (our field is called 'runtime_markup')
       
      Access the field on the current page (just like any other field)
      echo $page->runtime_markup; Access the field on another page
      echo $pages->get('/about-us/')->runtime_markup; Screenshots
       
      Backend
       

       

       
      Frontend