Monday, October 3, 2011

Wordpress, Git and Switching between Environments

As a developer we always want to make sure that we can freely move between local development environment and the production environment. And when its time to move the files between the environments, it should be a very painless and streamlined process.

While working on Wordpress, Initially, I had to struggle to maintain two distinct environments. When ever I used to move the files over, I used to encounter broken links,
missing images and host of other issues. Till the time I mastered the art.

I am attempting to write the best practices I learnt and if you find any I would appreciate if you can comment on it.

Version Control
  • I used GIT Version control to save my regular checkins. It works like a charm
  • I also checked in the .sql file regularly to Github, backup of my local database.

First Release : Once site was Production
Now, its time to Updated Pages, Switching from Production to Dev Environment
  • Created a new local database and Imported the latest SQL file. (Make sure you checkin the latest snapshot from Production)
  • I synced up the changes from GitHub
  • Update the Database and Permalinks (as described above)
I have found this as simplest way to move between servers seamlessly.

Readers, if you finding anything interesting, do let me know too

Happy Developing!!

No comments:

Post a Comment