Frank Vèssia Posted July 26, 2011 Share Posted July 26, 2011 I would like to have a tool can export a template with all fields creating .pack file and reimport it in another pw website. It happends many time to me recreating all the stuff and this option can be very useful. Link to comment Share on other sites More sharing options...
Adam Kiss Posted July 26, 2011 Share Posted July 26, 2011 Hi Sevarf2, I'm not sure this is what you mean, but there is plan (possibly for 2.3 or 2.4) to have some sort of 'install creator', meaning that you'll export whole site you've created so far and it'll create a directory for you, something like 'site-default' is now, with all the content, fields and templates you've defined. Is this what you had in mind, or simply possibilty to export multiple templates with their fields and to import them into another site? Because that was not discussed so far, but I can imagine this being part of the 'install creator', or rather some import/export system. Unfortunately, I don't think there are resources to have it implemented in the core/or as a core plugin, but by all means, you can do this yourself But I think this really could be planned for release 2.3 or 2.4. Link to comment Share on other sites More sharing options...
apeisa Posted July 26, 2011 Share Posted July 26, 2011 Actually this has been discussed earlier. Import tool is coming, but not on roadmap yet: http://processwire.com/talk/index.php/topic,130.0.html Link to comment Share on other sites More sharing options...
Adam Kiss Posted July 26, 2011 Share Posted July 26, 2011 Well, I know, but it isn't planned until after 2.2, or am I wrong? In cas I'm wrong, I apologize in advance. Well, how is it, Antti, do you know? Link to comment Share on other sites More sharing options...
apeisa Posted July 27, 2011 Share Posted July 27, 2011 As I said, not on the roadmap yet. Just wanted to mention that Ryan have thinked about exactly same kind of import/export tool that Sevarf is looking for. Link to comment Share on other sites More sharing options...
ryan Posted July 27, 2011 Share Posted July 27, 2011 Here's how you can make a site profile to be installed somewhere else: 1. Export your database with mysqldump using this command, replacing [user], [pass], [database] and [host] with the ones you are using. You can probably duplicate this with PhpMyAdmin too, but note you'll want complete inserts and you don't want extended inserts. mysqldump --complete-insert=TRUE --add-locks=FALSE --disable-keys=FALSE --extended-insert=FALSE --default-character-set=utf8 --comments=FALSE --compact --no-set-names --skip-disable-keys --skip-add-locks -h[host] -u[user] -p[pass] [database] >install.sql 2. Move the resulting install.sql file to /site/install/install.sql. Of course, if the /site/install/ directory doesn't exist already, then create it. mkdir /site/install/ mv install.sql /site/install/ 3. Move /site/assets/files/ to /site/install/files/ mv /site/assets/files /site/install/files 4. Delete these dirs and files: rm -rf ./site/assets/sessions/ rm -rf ./site/assets/logs/ rm -rf ./site/assets/cache/ rm ./site/assets/installed.php 5. Edit your /site/config.php and remove these lines at the bottom: $config->dbHost = 'localhost'; $config->dbName = '...'; $config->dbUser = '...'; $config->dbPass = '...'; $config->dbPort = '3306'; $config->userAuthSalt = '...'; 6. Zip up your /site/ dir. zip -r -v ./site-default.zip ./site/* Now you've got a site-default.zip file that is ready to be installed somewhere else. All you need to do is download a fresh copy of PW, remove it's /site-default/ directory and replace it with the one you zipped up. Then run the installer. I may be missing something, but I think that's all there is to it. If anyone tries this and runs into any problems please let me know. The plan is to automate all this into a site-exporter module at some point. Edit: I forgot step 5, and just added it above. Edit 8/15/11: Updated mysqldump command above to new/better version 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