WordPress.org

Ready to get started?Download WordPress

Forums

[closed] migrating WordPress from remote server to localhost (14 posts)

  1. saket123456
    Member
    Posted 2 years ago #

    Hi,
    I want to configure my current running wordpress site on localhost for some development process. I tried but it is not working on Localhost
    steps I have followed:
    1. I made .zip file of complete files and folders present in public_html
    2. Downloaded it on my local machine
    3. made a new folder by name wordpress in www folder of wamp
    4. unzipped the downloaded file in the new wordpress folder
    5. Took a backup of running wordpress site using Sql Yog, file name word.sql
    6. Opened the word.sql file on editor and changed the url of current running site http://example.com to http://localhost/wordpress by replace all option.
    7. Made a new database in my wamp by name word
    8. imported the updated word.sql file using phpmyadmin on my local machine in new word database and found all tables fine.
    9. Opened the wp-config file and changed the user name to 'root', password as '' and host name as 'localhost'
    The default wp-config file running of server have codes as below:

    define('DB_NAME', 'word');
    define('DB_USER', 'word12');
    define('DB_PASSWORD', 'word123');
    /** MySQL hostname */
    define('WP_SITEURL','http://example.com');
    define('WP_HOME','http://example.com');
    define('RELOCATE',true);
    define('DB_HOST', 'word12.db.86814.example.com');
    
    /** Database Charset to use in creating database tables. */
    define('DB_CHARSET', 'utf8');
    
    /** The Database Collate type. Don't change this if in doubt. */
    define('DB_COLLATE', '');
    define('VHOST', 'no');
    $base = '/';
    define('DOMAIN_CURRENT_SITE', 'example.com' );
    define('PATH_CURRENT_SITE', '/' );
    define('SITE_ID_CURRENT_SITE', 1);
    define('BLOGID_CURRENT_SITE', '1' );
    
    define('WP_MEMORY_LIMIT', '256M');

    I made changes in the file as below:

    define('DB_NAME', 'word');
    define('DB_USER', 'root');
    define('DB_PASSWORD', '');
    /** MySQL hostname */
    define('WP_SITEURL','http://localhost/wordpress');
    define('WP_HOME','http://localhost/wordpress');
    define('RELOCATE',true);
    define('DB_HOST', 'localhost');
    
    /** Database Charset to use in creating database tables. */
    define('DB_CHARSET', 'utf8');
    
    /** The Database Collate type. Don't change this if in doubt. */
    define('DB_COLLATE', '');
    define('VHOST', 'no');
    $base = '/';
    define('DOMAIN_CURRENT_SITE', 'localhost' );
    define('PATH_CURRENT_SITE', '/' );
    define('SITE_ID_CURRENT_SITE', 1);
    define('BLOGID_CURRENT_SITE', '1' );
    
    define('WP_MEMORY_LIMIT', '256M');

    tested with making define('VHOST', 'no'); as define('VHOST', 'yes'); also. However whenever I am running http://localhost/wordpress it is getting redirected to original site http://example.com or on changing the other codes it is giving data base connection fail error.

    In my database table are present with perfix wp_1 and wp_254 and wp_251. (not sure why)
    waiting for help from forum now...

    Regards

  2. Elan Technosys
    Member
    Posted 2 years ago #

    Look for table wp-options in your localhost wordpress database and are replace http://example.com to localhost/wordpress and save the settings then go to localhost/wordpress/wp-admin after getting access on wp-admin go to settings>general settings and change the both URLS to localhost/wordpress.

  3. saket123456
    Member
    Posted 2 years ago #

    thanks for reply.
    in wp-options table, i changed the url http://example.com to localhost/wordpress/ for home and siteurl.
    now also when i am running localhost/wordpress/wp-admin, i am getting redirected to http://example.com
    Please suggest....
    Regards

  4. saket123456
    Member
    Posted 2 years ago #

    Mow with click on localhost/wordpress/wp-admin i am getting "The page isn't redirecting properly" "Firefox has detected that the server is redirecting the request for this address in a way that will never complete."

    my current wp-config file is:

    define('DB_NAME', 'word');
    
    /** MySQL database username */
    define('DB_USER', 'root');
    
    /** MySQL database password */
    define('DB_PASSWORD', '');
    
    define('DB_HOST', 'localhost');
    
    /** Database Charset to use in creating database tables. */
    define('DB_CHARSET', 'utf8');
    
    /** The Database Collate type. Don't change this if in doubt. */
    define('DB_COLLATE', '');
    
    define('VHOST', 'no');
    $base = '/';
    define('DOMAIN_CURRENT_SITE', 'localhost/wordpress' );
    define('PATH_CURRENT_SITE', '/' );
    define('SITE_ID_CURRENT_SITE', 1);
    define('BLOGID_CURRENT_SITE', '1' );
    
    define('WP_MEMORY_LIMIT', '256M');

    Please Suggest...
    regards

  5. Elan Technosys
    Member
    Posted 2 years ago #

  6. saket123456
    Member
    Posted 2 years ago #

    Hi,
    thanks for reply.
    I made the changes as per the suggested link. Also made change in wp_blogs, and link localhost/wordpress is present. still getting the error:

    Error establishing database connection

    If your site does not display, please contact the owner of this network. If you are the owner of this network please check that MySQL is running properly and all tables are error free.

    Could not find site localhost/wordpress. Searched for table wp_blogs in database d4ldev1. Is that right?

    What do I do now? Read the bug report page. Some of the guidelines there may help you figure out what went wrong. If you’re still stuck with this message, then check that your database contains the following tables:

    * wp_users
    * wp_usermeta
    * wp_blogs
    * wp_signups
    * wp_site
    * wp_sitemeta
    * wp_registration_log
    * wp_blog_versions

    Please suggest...

  7. Elan Technosys
    Member
    Posted 2 years ago #

    Check your mysql data base server is running? and also check for database configuration wp-config.php

  8. saket123456
    Member
    Posted 2 years ago #

    Hi Elan,

    thanks for your support.
    MySql data base is running fine as other installed applications are working on same server.
    My wp-config.php file is as below:

    define('DB_NAME', 'word');
    
    /** MySQL database username */
    define('DB_USER', 'root');
    
    /** MySQL database password */
    define('DB_PASSWORD', '');
    
    define('DB_HOST', 'localhost');
    
    /** Database Charset to use in creating database tables. */
    define('DB_CHARSET', 'utf8');
    
    /** The Database Collate type. Don't change this if in doubt. */
    define('DB_COLLATE', '');
    
    define('VHOST', 'no');
    $base = '/';
    define('DOMAIN_CURRENT_SITE', 'localhost/wordpress' );
    define('PATH_CURRENT_SITE', '/' );
    define('SITE_ID_CURRENT_SITE', 1);
    define('BLOGID_CURRENT_SITE', '1' );
    
    define('WP_MEMORY_LIMIT', '256M');

    Please suggest what other changes are required in it.

    Regards..

  9. saket123456
    Member
    Posted 2 years ago #

    on running http://localhost/mydriving4life I am getting error as:

    The page isn't redirecting properly
    Firefox has detected that the server is redirecting the request for this address in a way that will never complete.

    checked in different browsers also. Please suggest....

  10. kanika
    Member
    Posted 1 year ago #

    A related problem:

    When I type http://localhost/myblog I get redirected to the live site on production server.(I have made the changes in the wordpress)

    When I type http://localhost/myblog/wp-admin, it goes correctly to the local site's admin interface.

    Again from the admin interface, I can't navigate to the local site cause it takes me to the production site.

    Strange behaviour.

    The changes I made:

    UPDATE wp_options SET option_value = 'http://localhost/myblog' WHERE option_value = 'http://www.example.com';

    The permalink settings are as follows(does that matter?)
    http://localhost/myblog/?p=123

  11. Succesvolle Sollicitatiebrief
    Member
    Posted 1 year ago #

    Had the same problem, but fixed it.

    1 Check your wp-config.php

    2 In phpAdmin: Check table 'wp_options' and change all values from "www.example.com" to "localhost/example" (the values in records '_transient_feed_...' and 'theme_mods_...' too).

    Did the trick for me!

    If you're migrating to the external server again, don't forget to change it back!

  12. faisal.mfi
    Member
    Posted 1 year ago #

    I have the same problem, I am trying to run my site on localhost with xampp, I Imported my data base as it is in phpmyadmin, and I update wp-config file as above posts.. but the " Waiting for Localhost" message occurs all the time it cannot display my site... please tell me the solution

  13. esmi
    Forum Moderator
    Posted 1 year ago #

    As per the Forum Welcome, please post your own topic. Posting in an existing topic prevents us from being able to track issues by topic. Added to which, your problem - despite any similarity in symptoms - is likely to be completely different.

  14. faisal.mfi
    Member
    Posted 1 year ago #

    ok

Topic Closed

This topic has been closed to new replies.

About this Topic