I’m trying to find an efficient way to sync between my localhost development environment and my production server.
I develop my WordPress projects on my local machine (XP running apache, php, mysql). I use apache virtual hosts so I can use ‘local’ domains. For example, mydomain.local is the domain I use when pulling up my site on my localhost. Generally, mydomain.local corresponds to mydomain.com.
At various stages in my projects (sometime at then end of each day) I need to sync my localhost files/database with the production server so that a client can review the work. This generally involves a mysql dump followed by a search and replace that replaces mydomain.local with mydomain.com. I also update the wp-config.php for the production server, upload the files and then restore the DB on the production server.
Does anyone have a way to speed up this process?? I was thinking about making a few changes to wp-config.php so that it pulls config settings based on the domain. If the domain was mydomain.local, then the localhost DB settings are read. If the domain is mydomain.com, then the production DB settings are read.
My biggest problem is the search and replace of the domain in the DB dump. Wouldn’t it make sense that WordPress would substitute the domain as a variable within the content of the articles? The variable would then be replaced with the domain as set in the WP admin panel? This would eliminate the search and replace.
What methods do you use to sync between your local development environment and your production server?
- The topic ‘sync localhost with production server’ is closed to new replies.