Moving WordPress site from development to production

Medical Technology, Healthcare & Government IT

.
Categories
Category Groups

Moving WordPress site from development to production [or from one domain to another]

Apart from moving the site files and DB to new server the following steps also has to be done for the site to be active:

  1. Update the database name, username and password in wp-config.php
    /** The name of the database for WordPress */
    define (‘DB_NAME’, ‘wordpress’);
    /** MySQL database username */
    define (‘DB_USER’, ‘root’);
    /** MySQL database password */
    define (‘DB_PASSWORD’, ”);
    /** MySQL hostname */
    define (‘DB_HOST’, ‘localhost’);
  2. Add the following line to wp-config.php
    define(‘FS_METHOD’, ‘direct’);
  3. Check the .htaccess file and make the code like
    # BEGIN
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ – [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    # END
  4. Check the robots.txt file and if the search engine is disallowed like the below code
    User-agent: *
    Disallow: /Use the following code
    # Google Image
    User-agent: Googlebot-Image
    Disallow:
    Allow: /*# Google AdSense
    User-agent: Mediapartners-Google*
    Disallow:# digg mirror
    User-agent: duggmirror
    Disallow: /# global
    User-agent: *
    Disallow: /cgi-bin/
    Disallow: /wp-admin/
    Disallow: /wp-includes/
    Disallow: /wp-content/plugins/
    Disallow: /wp-content/cache/
    Disallow: /wp-content/themes/
    Disallow: /trackback/
    Disallow: /feed/
    Disallow: /comments/
    Disallow: /category/*/*
    Disallow: */trackback/
    Disallow: */feed/
    Disallow: */comments/
    Disallow: /*?
    Allow: /wp-content/uploads/
  5. Execute the following commands against the database
    Note: Siteurl format (‘http://www.example.com’)

    1. Change Siteurl & Homeurl
      UPDATE wp_options SET option_value = REPLACE (option_value, ‘Current Site Url’, ‘New Site Url’)
    2. Change GUID
      UPDATE wp_posts SET guid = REPLACE (guid, ‘Current Site Url ‘, ‘New Site Url’);
    3. Change URL in Content
      UPDATE wp_posts SET post_content = REPLACE (post_content, ‘Current Site Url ‘, ‘New Site Url’);
    4. Change Image Path Only
      UPDATE wp_posts SET post_content = REPLACE (post_content, ‘src=”Current site Url’, ‘src=”New Site Url’);
    5. If we have added any custom menu links using our siteurl Change it
      UPDATE wp_postmeta SET meta_value = REPLACE (meta_value, ‘Current Site Url’, ‘New Site Url’)

    Or a better and another way to do this URL change would be to run a find and replace
    (‘Current Site Url’ with ‘New Site Url’) on the SQL Script before creating the database.

  6. Change ownership on all files and folders to our web server username/group
  7. Change permissions on all files and folders to 775

zoloft without prescription, buy zithromax online

Original Link