Jump to content

Importing Older PW Database To New PW Version?


John W.
 Share

Recommended Posts

Question 1

I recently installed PW 3.0.62 for a new site and also have sites running older version of PW 3.x.

Can I export the database on an older version of PW 3.x and import it to PW 3.0.62 without any issues?

 

Question 2

(This is kind of alternative to the above for long term use - and maybe a better solution...)

On  the sites I've previously built I have templates (home, basic-page, contact) and fields that I commonly use, such as business_name, phone_1.  The last site I built is running PW 3.0.42.  I was considering cloning this into a local site and running the upgrade module to bring it up to PW 3.0.62. From there on out when I start I new project I could just run the PW upgrade module, copy the folder to the location for the new project and duplicate the database using the new projects name.

So basically, I'll always keep a "blank slate" site that I can just run the PW upgrade on, then duplicate into a new project. This would cut down on the work and time spent having to re-create these common fields, that I use. From there, I would just add fields, templates, etc, specific for the new website project.

Is this a sound approach to speed up development?

 

Link to comment
Share on other sites

1 hour ago, holmescreek said:

So basically, I'll always keep a "blank slate" site that I can just run the PW upgrade on, then duplicate into a new project. This would cut down on the work and time spent having to re-create these common fields, that I use. From there, I would just add fields, templates, etc, specific for the new website project.

Sure, it does work, however there are some shortcomings, some of them are (nothing serious, but still...):

  • $config->userAuthSalt will always stay the same
  • if working with a "new" server (new environment you have not yet tested PW with) it is best to run the installer first to see if all goes well...
  • you might want to pick a different database storage engine (innodb vs myisam) and a collation and the installer provides that

that is why it is best to export a site profile and install it afterwards instead of simply cloning the site:

Simple clones can be good for moving the site though, of course.

1 hour ago, holmescreek said:

Can I export the database on an older version of PW 3.x and import it to PW 3.0.62 without any issues?

It depends on the database storage engine (innodb vs myisam) and the collation used, I guess. I do not remember recent db related changes.

Edited by szabesz
typo
  • Like 2
Link to comment
Share on other sites

Thanks. I fresh installed 3.0.42 on my local system.  I then exported the database from a previous site running on 3.0.42.  Next, I imported the database, deleted templates/fields that I not re-occuring across projects, installed my modules, setup my custom ckeditor .js and .css files. Finally, I ran the ProcessWireUpgrade to upgrade the local site to 3.0.62. It all looks good.

From here out, I'll run ProcessWireUpgrade, then use the profile export module when setting up a new site.

Thanks for the help!

Btw, when I set up on a remote site, I always use the PW installer. After that I import JUST the db from my local install,  ftp upload the templates folder and lastly use the api to set a new password for the admin account for login. - never had an issue.

 

  • Like 1
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

×
×
  • Create New...