Jump to content

Best practice for new site


thepurpleblob
 Share

Recommended Posts

I'm completely new to Processwire (but not PHP development) and have been playing around with the included sites. 

I'm slightly hazy about the best way to start my own development. Is it normal just to start with an existing site, dump the 'install' directory and so on? To deploy the site just backup and restore the database and copy the (and my) Processwire code and modified site to the live server (well, I'll use Git)? 

I think I might be asking if there's a fancier way to handle database changes/upgrades once my site is launched and then there are subsequent changes. 

I'm wary of creating any 'gotchas' down the line when I want to deploy the site - in particular around the database. 

Sorry for vague questions

Link to comment
Share on other sites

My advice is to get into the Processwire delayed output strategy, my experience is that it gives you the best code organization and flexibility.

Yes there are many posts already in the forum about deploying and keep in sync. Just do a search for it.

Link to comment
Share on other sites

Hi @thepurpleblob and welcome to ProcessWire

Hrmmm, yes your question is a bit hazy and I'm not sure I fully understood it.  There are lots of ways to deploy development sites to live including modules to help you through the process. It's my experience that the best way is to:

  1. back up/download a copy of the db on the development server (I always install the db backup module https://modules.processwire.com/modules/process-database-backups/)
  2. create a new database on the live server and import the db backup from the dev server
  3. zip the development files and upload to the live server
  4. update the /site/config.php file on the live server to reflect the changes in the db configuration and https hosts options

That way, the dev & live server data & files (/site/config.php excepted) are identical including admin logins

You may want to install https://modules.processwire.com/modules/process-wire-upgrade/ on both your dev & live servers to easily ensure they're both always on the same PW version

Hope this helps

  • Like 1
Link to comment
Share on other sites

That's all helpful. I really just wanted to make sure that there wasn't some magic that I had entirely missed. 

I'm quite keen on using mustache for templates so I've got a bit of work to do there. I have 'TemplateEngineFactory' installed. 

I think it's going to be one of those - get stuck in, make a mess, start again things ?

Link to comment
Share on other sites

4 hours ago, elabx said:

Can confirm Migrations works wonderful and the CLI too, I commonly migrate changes to 30+ sites that share the same functionality, using git + migrations CLI. 

Sounds great! Any chance for a short walkthrough of how you are doing it in the tutorials board? ? 

PS: Welcome @thepurpleblob, hope you enjoy ProcessWire ? 

PPS: We have also some projects that help you setup new installations of pw fast and easy (mine being alpha)

 

 

  • 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

  • Recently Browsing   0 members

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