Jump to content
Crawford Tait

Custom site migration from old version - advice needed!

Recommended Posts

Hi,

I'm looking to migrate content from a site I built some time ago that is in 2.7.2, to a new site on latest version. Template structure is different, but a lot of the content can be reused and I think my only option is to write scripts to pull content from the old site, map fields etc as required and create content in the new site.

With local copies of the sites running, when I try to connect to the old site from the new site using

$oldSite = new ProcessWire\ProcessWire('.../path/...', 'http://local.url/');

I get this error reported from the old site code

Fatal Error: Class 'WireData' not found (line 79 of /...path.../wire/modules/LazyCron.module) 

When I try to connect to the new site from the old site using the same approach, It fails because in that version the ProcessWire constructor took a Config object and I can't find docs for the old version or figure out how to construct a ProcessWire instance passing a Config.

So... is this the right approach and is there a way around these issues? I can see how the version discrepancy could cause problems.

Should I be using something like the RestApi to remove the version problem? I realise it's not intended for accessing PW content, but the examples show it retrieving users so I'm assuming that would be possible... or I could write my own scripts to expose the old content. Or I could attempt an upgrade on the local copy of the old site??

Note the above is mainly concerned with porting template-based content, I also need to deal with a but a lot of images and am considering just bringing in all of the assets and importing to the DB to replicate exactly from the old site (with IDs etc) if that's possible.

Any advice much appreciated!

Thanks,

 

Crawford.

 

Share this post


Link to post
Share on other sites

Thanks -

Sorry if I didn't make clear, it's not just a site upgrade, it's a complete re-build with new & different templates, but I want to migrate some of the old content into the new site.

I COULD upgrade my local copy of the old site IF that was going to make the above method work and people thought it was the way to go...?

Crawford.

Share this post


Link to post
Share on other sites

Had a similar task a few weeks ago and this is the way I went...

  1. exported the whole site with Site Exporter
  2. created two local copies of it - one as a reference, one as the new version
  3. made all necessary field and template changes - only added fields and moved content where necessary
  4. edited the template's output to the new design
  5. started switching to new fields on the frontend where added
  6. added PagePathHistory module (core) and Jumplinks module
  7. reworked content to fit the new needs and fields
  8. reorganized the pages
  9. crawled the new page with ScreamingFrog to find dead links, 404s and similar things
  10. looked for fields, templates, whatever that were not necessary anymore
  11. created a working copy of it
  12. deleted all "unnecessary" fields, tested and debugged the almost finished site

To make some things more clear. When I started with 1. I already had a full HTML dummy of the new site/design, so I exactly knew what the goal is/was/will be. So no surprises later on with the client (for example: we want that, that must move to there). I could just migrate the new styles over into the template files and move content accordingly.

So... I guess... sometimes the easiest way is the most comfortable. Depending on that site, there might be other things to include, such a custom modules or developments but as you built that site, you should know what's involved somewhere else there.

Share this post


Link to post
Share on other sites

Hmm, thanks but too late for this approach unfortunately - new site is up and running with template development well underway!

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...