Crawford Tait Posted June 13, 2019 Share Posted June 13, 2019 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. Link to comment Share on other sites More sharing options...
flydev Posted June 13, 2019 Share Posted June 13, 2019 Hi @Crawford Tait First of all, did you tried the official upgrade method explained here https://processwire.com/docs/start/install/upgrade/ - result ? About using the RestApi module, I think it "complicate" the whole thing, and this module is only available for ProcessWire => 3.0.98. Link to comment Share on other sites More sharing options...
Crawford Tait Posted June 13, 2019 Author Share Posted June 13, 2019 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. Link to comment Share on other sites More sharing options...
wbmnfktr Posted June 13, 2019 Share Posted June 13, 2019 Had a similar task a few weeks ago and this is the way I went... exported the whole site with Site Exporter created two local copies of it - one as a reference, one as the new version made all necessary field and template changes - only added fields and moved content where necessary edited the template's output to the new design started switching to new fields on the frontend where added added PagePathHistory module (core) and Jumplinks module reworked content to fit the new needs and fields reorganized the pages crawled the new page with ScreamingFrog to find dead links, 404s and similar things looked for fields, templates, whatever that were not necessary anymore created a working copy of it 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. Link to comment Share on other sites More sharing options...
Crawford Tait Posted June 13, 2019 Author Share Posted June 13, 2019 Hmm, thanks but too late for this approach unfortunately - new site is up and running with template development well underway! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now