John W.

Importing Older PW Database To New PW Version?

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?

 

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
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

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By mjut
      Hello!
      I am trying to get some extra css-file into my admin templates. I managed to modify my admin.php to this:
      <?php namespace ProcessWire; require($config->paths->adminTemplates . 'controller.php'); echo "<link rel='stylesheet' type='text/css' href='" . $config->urls->templates . "css/admin.css'>"; By doing so, the css <link> is added to the very end of each parsed admin-html. (right AFTER the closing </body> tag.)
      That causes some trouble. e.g. the page tree is not displaying any more. Although, other pages are working - like the edit form of a page.
      My question: is there a correct way of adding my extra css to the admin area?
      Thanks for you help!
      Stephan
       
    • By karian
      I don't know why multiple instances (repeater_repeat_columns1, repeater_repeat_columns2, ...) of my repeater field are displayed inside Template field (see image).
      Is there a way to clean/reset it ?
       

    • By psy
      I'm combining two PW sites into one, Site A into Site B.
      At each step, I did it bit by bit as the 'all at once' approach failed.
       
      First, I exported all the fields from Site A and imported into Site B. Any field types not supported by import/export, eg FieldtypeOptions I manually recreated. All good.
      Next I exported all the templates from Site A and imported them into Site B and copied across their associated template files. All good.
      Finally I exported the pages I needed from Site A into Site B - again, bit by bit to ensure it all went smoothly.
      From the admin side, it all looked and worked perfectly.
      Front end was a totally different story. All existing pages in Site B worked as expected. NONE of the pages imported from Site A displayed. They all ended in a redirect loop with no errors in the PW logs or Tracy Debugger.
      After some trial-and-error, I finally got it working with:
      - create a new template in Site B admin with no associated template file and just a title field
      - import the fields from the imported Site A template into the newly created template (both on Site B)
      - copy the Site A php template file into a new file that matched the new PW Site B template name and save in Site B site/templates
      I can deal with the above workaround. Just curious to know if I did something wrong or if the template import/export feature is problematic?
       
      ### Solution:
      While the export/import was a slow process, turned out the front end redirecting issue was unrelated. For reasons unknown, all templates marked as HTTPS only were the ones redirecting, ie all templates from Site A. Finally solved it by changing the $config->https to true in site/config.php
      Now the pages display correctly as https whether the template forces the issue or not.