Jump to content

Pack import/export


Frank Vèssia
 Share

Recommended Posts

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

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

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...