WordPress.org

Ready to get started?Download WordPress

Forums

sync localhost with production server (5 posts)

  1. jpepper
    Member
    Posted 8 years ago #

    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?

    Thanks!

  2. v0g0z0
    Member
    Posted 7 years ago #

    Hey, jPepper...

    I noticed no one has responded to your query. One which I too face and would like an answer to. I spend a lot of time on the road and frequently find myself without WiFi or Net access at all. So, I create my posts offline. I need a simple way to upload just those changes once I reconnect.

    And so it goes...

    Randy

  3. vkaryl
    Member
    Posted 7 years ago #

    There were some posts here - fair amount of time back.... maybe six months or so. The thrust of them was I think what you guys are wanting to do.

    Only thing I can tell you at this point is to use the forum search box, and input keywords like "localhost server sync online" and go from there.

    Sorry I don't have specific info.

  4. Chris_K
    Member
    Posted 7 years ago #

    vogozo - your situation is probably easily resolved with a blogging client. For instance (if a windows user) have a look at the recently released Windows Live Writer. Has a full on wysiwyg preview and can save drafts locally.

    jpepper - Not sure I have any useful tips. I've dabbled a bit with the same issue...

    A db export from dev to an import into prod trips you up on the URI values (Options -> General) so then you need to write a script to handle those. But then... Goo help you if you had links to images... the db import won't bring those along, so then you need to do a ssh/scp type sync to get your images up to the server too.

    I got to that point and found afore-mentioned blog client with useful blog post preview and stopped digging. Alas!

  5. v0g0z0
    Member
    Posted 7 years ago #

    Hey Guys,

    In fact, you're right. I'm testing the new version of the 'ecto' (Mac-based) blogging client at the moment and I'm pretty impressed so far. A few idiosyncrasies, but on the whole a pretty good solution. I can run both the 'localhost' and 'domain' versions of my blog on 'ecto' and after I've confirmed that the local version works, I simply engage the 'domain' version and read 'em and weep!

    Thanks for the notes. Cheers!

Topic Closed

This topic has been closed to new replies.

About this Topic