WordPress.org

Forums

Improving a live site without loosing new database entries? (6 posts)

  1. schneeb
    Member
    Posted 3 years ago #

    I have a live site that needs to be heavily modified (themes, plugins, etc.) with as little downtime as possible. I thought I could set up a testing server and then just overwrite the live site when finished, but this would provide a huge problem: I would loose any new database entries that have been made since I started testing on the local server. (Such as new users)

    I would prefer to avoid taking the site down for 'maintenance' or having to replicate the improvements I made in the testing space. My question is this - how do I test improvements and then update the live site without loosing any new database entries?

  2. racer x
    Member
    Posted 3 years ago #

    The best way IMO would be to follow your initial thought and set up a test environment. Even better would be to install wordpress on a local server. Then you could always test things first in the future as well as always having a backup of your theme files.

    I would also update the live site in phases. Test a plugin, then upload. Test a theme change then upload, etc. If you do it all at once you will have difficulty determining any conflicts.

    Unless you create new posts or pages in the test install location, your updates might not really affect your database at all. (New plugins may add tables to the database, but some plugins allow transferring of information to other sites. ie: from test to your live site.)

    As far as the theme files go (like basic editing to the html and the CSS files) that does not affect your database.

  3. schneeb
    Member
    Posted 3 years ago #

    Thanks for the quick response!

    When you talk about uploading in phases, would I test a plugin then install it onto my live site OR would I test a plugin then replace existing live site files? While the latter would be easier, it could run the risk of deleting a new user who had just signed up while I was testing...

    I'm planning to launch new areas of the site in the future - large plugin based features that I know will require database modification. This is the main reason who I am so thrown as to how this should be handled! :)

  4. racer x
    Member
    Posted 3 years ago #

    When you talk about uploading in phases, would I test a plugin then install it onto my live site

    That is how I would personally do it. (I develop only WP sites full time)

    it could run the risk of deleting a new user who had just signed up

    There would be nothing to "replace" on the live site if this is a new plugin. When you install a new plugin the plugin will perhaps "add" options, meta fields, or even create a new database table, but it won't overwrite your existing values for things like users or post content, etc. unless the plugin specifically tells you in the install directions.

    For example:
    If I install Contact From 7 on my TEST location, then alter my CSS to make the form look good with my theme, I can then upload that plugin to my LIVE site and also edit my LIVE CSS files with the new changes. This particular new plugin will not change any existing entries in my database so anything that happened while I was working on this (new users added, etc.) is not altered.

    large plugin based features that I know will require database modification.

    Properly programmed plugins are made to "adapt" to your site. Again, this could be adding tables or just adding custom fields.

    If you are getting into member plugins or forums, then these will, most likely, add tables and also add user roles or capabilities in which case should walk you through setting them up properly. For example, the plugin won't "remove" users or change a user's ID, but it might have you select a new role for subscribers during setup.

    You can even swap your entire test database with new LIVE database if you really want to see the exact effect. (That is somewhat advanced.)

    The main thing is to read all the plugin install directions carefully. Most will walk you right through it with basic options in the admin area. The plugin will(should) warn you about any changes that could affect database entries, etc.

    This goes without saying but do select a plugin that is well-maintained, current with WP versions and has a good review from other WP users, etc.

  5. schneeb
    Member
    Posted 3 years ago #

    large plugin based features that I know will require database modification.

    I suppose I should have reworded that. I didn't think they would change existing structure. I originally thought it would be easiest to re-upload the entire db structure from the test site to the live site. It looks like this is not the case.

    How would you personally handle using plugins that will need to be populated before launching? (Such as plugins that will display organized lists) Would I populate it on the test site, run a query to copy those new entries, and then insert them into the live db? (I suppose there would be a potential for error, but I could always try this method on the test site.)

  6. racer x
    Member
    Posted 3 years ago #

    How would you personally handle using plugins that will need to be populated before launching?

    Depending on the plugin, I personally think I would just get the plugin working on the test site, test a couple entries and then install it live. After that, I would populate what needed to be populated for the plugin. I know that may not be ideal, though depending on the plugin, you may be able to hide any front end related content until the plugin was ready. For example, if it was a forum, you could simply remove any links to the forum pages until it was ready.

    (Such as plugins that will display organized lists)

    If you are referring to something like the "tables reloaded" plugin, I believe those tables can simply be exported as CSV's and imported into another wordpress install. Other plugins may have the same ability.

    Would I populate it on the test site, run a query to copy those new entries, and then insert them into the live db?

    If you are comfortable with doing these types of things with MySQL queries then I suppose that would work fine if it refers to a "new" database table's entries. Just be certain that the queries are not going to affect anything live in the existing tables(such as row ID's). For example, you may create a new user in the test site which could conflict with your user ID's on the live site.

Topic Closed

This topic has been closed to new replies.

About this Topic