• WordPress Community,

    I’m a relatively new WordPress user, and I haven’t coded much of anything in quite some time. However, I’ve been doing my best to pour over all the documentation that’s out there regarding WordPress in an effort to understand some best practices for getting a new site up and going. I am currently working on one site, but I hope to launch many more over the coming months–thus, my search for best practices.

    I started dabbling with my new site, but I soon realized that I’d need a testing environment. Therefore, after a ton of online reading, I was able to successfully establish https://dev.mysite.com, which is now basically just a mirror of https://www.mysite.com. I used the “Moving WordPress” tutorial in the Codex–and several other great resources, for that matter–to successfully make the necessary database updates, file moves, configurations, etc. My URLs seemed to work, and I was happy.

    Currently, I’m in the process of establishing a local installation of WordPress using XAMPP by using the “Test Driving WordPress” tutorial in the Codex, not to mention a few other tutorials for good measure. There’s enough information out there where I feel relatively confident in my ability to get that piece up and running. However, the more I learn and think about things, the more questions I have. Enter the issues described below:

    Moving files seems to be relatively straightforward, as there are many comparison tools out there–and for the more ambitious, content versioning systems. However, with WordPress storing so much information in the database, I can’t seem to wrap my head around how one can successfully migrate/merge database information through multiple environments.

    For example, say I do some design work locally–maybe even install a plugin or two (i.e. some database changes are made). I then deploy the changes to my https://dev.mysite.com website to share the proposed changes with a client (making all the ugly database URL updates and such that are required–ugh.) Say I get the “go ahead” for production. Now what? The production database will have posts, comments, and other data present that I’ll need, but it won’t have the proper structure, plugins, design changes, etc. that I just made. How do I reconcile this issue? Do I only merge certain tables from the development environment? If so, where do I look to learn how to do this? Again, my mySQL and PHP skills aren’t anything to write home about at the moment, but I’m getting better….

    Last, how do I make a move to production without having any down time? I’m not talking about moving an entire site between servers; I’m talking about just moving incremental file and database changes. My development site and production site are on the same server, as I mentioned earlier, with the development site existing as a subdomain. I suppose I intend to use the development site somewhat like a dev/staging combo, and my local installation as a pure development environment.

    All I ever heard from people before this project was how easy WordPress was to get up and working. While that might be true if you have no desire for any process or customization behind your work, I’m finding WordPress to be far from straightforward at the moment.

    Any help, pointers, references, etc. would be much appreciated. I poured over anything I could get my hands on all yesterday afternoon and evening, and I still feel like I’m coming up short….

    Thanks in advance for your replies! As of right now, I feel like I’m just going to have to write down all my successful changes in my development environment and then re-do them all by hand in production at 3:00 AM or something….

    Mike

Viewing 3 replies - 16 through 18 (of 18 total)
  • For anyone keeping this thread for future reference, I did want to comment on my earlier statement:

    (3) Test environments are best made by cloning your Production WordPress. Always using $_SERVER[‘SERVER_NAME’] in wp-config.php as part of the definition of WordPress Address and Blog Address (rather than specifying them in the Admin panel, which stores them in the database), is one step to make cloning easier and less error-prone. Reference – https://codex.www.ads-software.com/Editing_wp-config.php

    I recently had trouble “flipping” from one folder to another using the wp-config.php specification of WordPress Address and Blog Address. Advice: if you ever experience this issue, comment out the two lines and change the equivalent database entries.

    With a “folder flip” still fresh in my mind, I should mention another item that is a lot more complex than I remembered when I first wrote my original posts here:

    And the third step is to use the Search and Replace or similar plugin to change any hardcoded URLs in the WordPress database.

    The problem here is that some hardcoded URLs need to refer to your WordPress folder and some do not, thanks to Permalinks. So far, it appears that any URLs with /wp-content/ in them need to include the folder name. Those that don’t have /wp-content/ in them must have the WordPress folder name removed.

    Which means your search and replace would be in two steps:

    1. yourdomain.com/wpfolder/ to yourdomain.com
    2. yourdomain.com/wp-content/ to yourdomain.com/wpfolder/wp-content/

    Just read this while looking for a similar solution and advice. Holy crap my head is spinning!

Viewing 3 replies - 16 through 18 (of 18 total)
  • The topic ‘Migrating changes through environments’ is closed to new replies.