The MU forums have moved to WordPress.org

Production + Dev redirect issue (7 posts)

  1. velvetpixel
    Member
    Posted 14 years ago #

    I am setting up a second install to function as a dev environment to stage content and theme changes before they get pushed to the live site. My issue is all links and admin login are going to the live site not the dev.

    I rsynced my web root and copied my db to the second server.

    I am running the dev on a different hostname.

    blogs.example.com <--live
    dev.blogs.someotherexample.com <--dev

    In the database on dev i updated:
    wp_blogs to the dev's hostname
    wp_site to the dev's hostname

    wp-config.php edited:
    define('DOMAIN_CURRENT_SITE' to reflect new hostname.

    I tried using a blank .htaccess file to at least get me into admin if it was a mod-rewrite thing.

    I am stuck.

    Where else is the domain defined that I need to manually change it to the dev domain?

  2. andrea_r
    Moderator
    Posted 14 years ago #

    The blog ID specific tables in the db. That's what you forgot. :)

  3. velvetpixel
    Member
    Posted 14 years ago #

    Thanks Andrea!

    Which tables would have that?
    I thought that wp_blogs is the table that tied the domain to a blog ID and those have been changed.

    Here is my table listing:
    wp_10_comments
    wp_10_links
    wp_10_options
    wp_10_postmeta
    wp_10_posts
    wp_10_term_relationships
    wp_10_term_taxonomy
    wp_10_terms
    wp_11_cattemplate_relationships
    wp_11_comments
    wp_11_links
    wp_11_options
    wp_11_postmeta
    wp_11_posts
    wp_11_redirection_groups
    wp_11_redirection_items
    wp_11_redirection_logs
    wp_11_redirection_modules
    wp_11_sticky
    wp_11_stray_quotes
    wp_11_term_relationships
    wp_11_term_taxonomy
    wp_11_terms
    wp_12_comments
    wp_12_links
    wp_12_options
    wp_12_postmeta
    wp_12_posts
    wp_12_term_relationships
    wp_12_term_taxonomy
    wp_12_terms
    wp_13_comments
    wp_13_links
    wp_13_options
    wp_13_postmeta
    wp_13_posts
    wp_13_term_relationships
    wp_13_term_taxonomy
    wp_13_terms
    wp_14_comments
    wp_14_links
    wp_14_options
    wp_14_postmeta
    wp_14_posts
    wp_14_term_relationships
    wp_14_term_taxonomy
    wp_14_terms
    wp_15_comments
    wp_15_links
    wp_15_options
    wp_15_postmeta
    wp_15_posts
    wp_15_term_relationships
    wp_15_term_taxonomy
    wp_15_terms
    wp_18_comments
    wp_18_links
    wp_18_options
    wp_18_postmeta
    wp_18_posts
    wp_18_term_relationships
    wp_18_term_taxonomy
    wp_18_terms
    wp_19_comments
    wp_19_links
    wp_19_options
    wp_19_postmeta
    wp_19_posts
    wp_19_term_relationships
    wp_19_term_taxonomy
    wp_19_terms
    wp_1_comments
    wp_1_links
    wp_1_options
    wp_1_postmeta
    wp_1_posts
    wp_1_term_relationships
    wp_1_term_taxonomy
    wp_1_terms
    wp_1_yarpp_keyword_cache
    wp_1_yarpp_related_cache
    wp_20_comments
    wp_20_links
    wp_20_options
    wp_20_postmeta
    wp_20_posts
    wp_20_term_relationships
    wp_20_term_taxonomy
    wp_20_terms
    wp_22_comments
    wp_22_links
    wp_22_options
    wp_22_postmeta
    wp_22_posts
    wp_22_term_relationships
    wp_22_term_taxonomy
    wp_22_terms
    wp_23_comments
    wp_23_links
    wp_23_options
    wp_23_postmeta
    wp_23_posts
    wp_23_term_relationships
    wp_23_term_taxonomy
    wp_23_terms
    wp_24_comments
    wp_24_links
    wp_24_options
    wp_24_postmeta
    wp_24_posts
    wp_24_term_relationships
    wp_24_term_taxonomy
    wp_24_terms
    wp_5_comments
    wp_5_links
    wp_5_options
    wp_5_postmeta
    wp_5_posts
    wp_5_term_relationships
    wp_5_term_taxonomy
    wp_5_terms
    wp_6_comments
    wp_6_links
    wp_6_options
    wp_6_postmeta
    wp_6_posts
    wp_6_term_relationships
    wp_6_term_taxonomy
    wp_6_terms
    wp_7_comments
    wp_7_links
    wp_7_options
    wp_7_postmeta
    wp_7_posts
    wp_7_term_relationships
    wp_7_term_taxonomy
    wp_7_terms
    wp_8_comments
    wp_8_links
    wp_8_options
    wp_8_postmeta
    wp_8_posts
    wp_8_term_relationships
    wp_8_term_taxonomy
    wp_8_terms
    wp_9_comments
    wp_9_links
    wp_9_options
    wp_9_postmeta
    wp_9_posts
    wp_9_term_relationships
    wp_9_term_taxonomy
    wp_9_terms
    wp_blog_versions
    wp_blogs
    wp_domain_mapping
    wp_openid_identities
    wp_registration_log
    wp_signups
    wp_site
    wp_sitecategories
    wp_sitemeta
    wp_usermeta
    wp_users

  4. andrea_r
    Moderator
    Posted 14 years ago #

    all the wp_1 tables are for the main blog. Search your entire db for the old domain.

  5. velvetpixel
    Member
    Posted 14 years ago #

    Thank you!

    So how do I differentiate between the instance of the url in a blog post vs in a table that defines functionality for WP?

    IE if blogs.example.com exists in content I don't want to change that to dev.blogs.someotherexample.com.

  6. velvetpixel
    Member
    Posted 14 years ago #

    Ok I got it working.

    In mysql find the rows in wp_1_options table that contain the live domain:
    mysql> select * from wp_1_options where option_value like 'http://blogs.example.com%';

    it will show you the row numbers where you will need to update the domain data.

    Then issue updates to change the content to the dev domain:
    UPDATE wp_1_options SET option_value = 'http://dev.blogs.someotherexample.com' WHERE option_id = 1;

    Change option_id = 1 to the correct one you want to change.

    This with what I did above have gotten my dev up and running!

  7. lunabyte
    Member
    Posted 14 years ago #

    If you're developing locally, and have a live site as well, you can use your hosts file to switch between sites.

    Then your local install can match your live install, and all you have to do is comment/uncomment a line in your hosts file.

    Much easier than doing string replaces in a database dump, and then importing.

About this Topic

  • Started 14 years ago by velvetpixel
  • Latest reply from lunabyte