• Resolved antorera

    (@antorera)


    Hello,

    Before I upgrade the WordPress version on a site, I want to test it out on a local version. I have recreated the site on a local server using MAMP. After doing all the appropriate steps, I’ve tried to log in to the wp-admin interface, but can’t login. I’ve tried using the existing users on the live site and I’ve also created new users in the database. Still no success.

    Here are the basic steps followed:

    1) Exported backup of WP database from PHPmyadmin
    2) Using MAMP, imported backup to the local database
    3) Copied over wordpress files including theme to the local server
    4) Changed the wpconfig.php file to reflect local root user/pw.
    5) Updated the database paths in the wp-options table to reflect local paths.
    6) Went to “localhost:80/[sitename]/wp-admin” and entered user info from live site. Get error.
    7) Created a new user in the database (wp-users) and tried again. Still get an error.
    8) Manually updated the wordpress install to 4.5.3 by dragging over the relevant files (without overwriting theme data). Still can’t log in.

    I’ve deleted everything and restarted the process twice. I’m not sure why I can log in on the live site and not on the local site. It doesn’t make sense to me because I’ve also migrated a different site to a local version and I am able to log in using the same steps.

    Any ideas?

Viewing 6 replies - 1 through 6 (of 6 total)
  • You don’t say what error you are getting in steps 6 and 7. Knowing what error message you are seeing will help us to narrow down your problem.

    Thread Starter antorera

    (@antorera)

    @mburridge – thanks for your response. That is part of the problem. The error message is not showing.

    You can see what I mean here.

    I even looked in the source code and there is no error message generated.

    I checked on the live site and I see that there is no error message generated there either if I enter a wrong user or password. However, the difference there is that I can log in with the correct info. But not on the local site.

    Try adding these two lines to the wp-config.php file of your local install:

    define( 'WP_SITEURL', 'your_url_here' );
    define( 'WP_HOME', 'your_url_here' );

    Substitute ‘your_url_here’ for the URL you would put in on the General Settings page for WordPress Address and Site Address if you could log in.

    @antorera

    You don’t mention which operating system you are on, Mac or Win. The reason I ask is that one cannot assume Mac for a MAMP any longer as MAMP has been available for Win for a while and has a bit of a different default setting.

    That said, I am going to assume you are on a Mac and have used the default MAMP settings for the document root and server ports.

    If so, then you access your local site with https://localhost:8888/folder-name and the login page at https://localhost:8888/wp-admin or /wp-login.php.

    As you mentioned you already updated the siteurl and home fields in the wp_options table, just verify that the above-noted URL is there or do as mburridge suggested.

    In addition, once you are able to login to the Dashboard, then install and run this plugin to update the rest of the URLs/links:

    https://www.ads-software.com/plugins/better-search-replace/

    Once that is done, then go to Settings > Permalinks and just click Save Changes; doing so rebuilds the local .htaccess file.

    Cheers!
    Lyle

    Thread Starter antorera

    (@antorera)

    I discovered the reason this was happening. When I exported the database (SQL file), I had the option “Add CREATE DATABASE / USE statement” selected.

    As a result, it was trying to create a new database instead of using the information from the existing one. The usernames that were in the existing did not get transferred over.

    So make sure that option is deselected.

    Thanks Mburridge, I had the same problem but this solution worked!!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Cannot login to local WordPress backup install’ is closed to new replies.