Robert Zelník Posted February 7, 2012 Share Posted February 7, 2012 When I create a new web site, I use two installations: a local (devel) site, where I test new changes, and a remote site, where I apply these changes when they work well. I would like to avoid duplicate work with creating fields and templates twice. Is there any intelligent way to clone these fields and templates between the local site and the remote site? Link to comment Share on other sites More sharing options...
apeisa Posted February 7, 2012 Share Posted February 7, 2012 No, not yet. Ryan has mentioned a method to export & import templates with fields using JSON. That would be great in many ways. Currently it is easy to export full site profiles, but that doesn't help in your scenario. Or other scenario where you want transfer certain templates from one site to an another (ie. you have build great product catalog on site X and want it to site Y also). One way is to build module that creates all the required fields and templates, but I find it pretty cumbersome for that task. Ryan: have you had time to look into this? I am available to help here, since this is very important stuff for our company. If you can share your initial thoughts on this, and I could try taking this further from there. 1 Link to comment Share on other sites More sharing options...
ryan Posted February 7, 2012 Share Posted February 7, 2012 Import/Export with JSON strings (or web services or both) would be nice to have. It won't be very hard to do. I will try to work this into some future update for 2.3 or before. 1 Link to comment Share on other sites More sharing options...
bpz Posted February 7, 2012 Share Posted February 7, 2012 Lol I came to ask the same question. We need migrations for processwire. Ryan: can you publish the whole phpdoc API of PW's core so that we can build our own migrations? Link to comment Share on other sites More sharing options...
FrancisChung Posted November 7, 2016 Share Posted November 7, 2016 Hi, I was wondering if this was ever implemented or if there's a module out there that has this functionality? Link to comment Share on other sites More sharing options...
arjen Posted November 7, 2016 Share Posted November 7, 2016 The JSON import/export functionality Ryan is talking about is already in the admin. The buttons are located on the bottom side of the Fields and Templates page in the admin: If you want to automate database migrations you could use the Migrations module by lostkobrakai. There are several other posts floating around dealing with this issue. 4 Link to comment Share on other sites More sharing options...
FrancisChung Posted November 11, 2016 Share Posted November 11, 2016 I have tried to use the JSON Import/exporter but I got some strange results? I was testing a new survey functionality, so I recreated a live version of our site on our test site by running a DB Export of the live site and deploying the live code. Then I applied the new survey code and applied JSON Imported that contained definitions of new templates / field for the Survey functionality. When I ran this particular query, it was returning "phantom" pages that were in the test system prior to the system refresh as well as the new test data I had entered post deployment. $home = wire(pages)->get("/Survey, include=all"); The results were a bit baffling. I did check to see if the JSON definitions contained any "data" but I couldn't see any. I could only speculate that the DB Export script somehow doesn't delete any new DB objects in the target system prior to a rebuild/refresh. I am using MySQLWorkBench and just using Export function with default settings. I've been using this for a year now and never had any problems with site refresh/ rebuilds. 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