Posts Tagged development

WordPress blog development tip

When I started this personal blog, it was a matter of a few clicks in a tool called fantastico and everything was up and running. Whatever development and style modifications I have done over the time were directly on the server. As a matter of fact, I still do.

Clearly, it is not the best idea for incremental development, not without inevitable “production downtime”. Working in a big internet company at least taught me this truth among other things. So, when I started my photoblog using pixelpost, I set everything up in my local MAMP stack and pushed the data to server one time.

joy@localhost ~ $ mysqldump -u user -ppass db > db.sql
joy@localhost ~ $ scp -C db.sql joy@server:
joy@server ~ $ mysql -u user -ppass db < db.sql

Afterwards all code pushes happen by rsync.

joy@localhost photoblog $ rsync -avz . joy@server:public_html/photoblog

This way, even though locally I have a small set of data, I can change code and test all features before doing a production push. Works very well for me. Also I check in my code in a local git repository. Double win.

I am in the middle of setting up another wordpress blog right now, and forgetting a small detail cost me a bunch of time. After getting the blog running locally, I took a mysql dump and synced it with the db in the server. It just won’t load. I mucked around here and there and figured that the blog url is set as “http://localhost:8888/newblog” in the local db. I modified the .sql file and re-synced to production and voila, it worked.

I suspect that I might need to do the db sync a few more times before I have enough volume of data to keep it growing in the server. I will probably set up a sed script to do the search-and-replace in command line.

, ,

No Comments