Moved from live site to WAMP, incorrect login page.
Posted by: PropDad (172.56.248.---)
Date: February 29, 2024 07:01PM

I have a domain that I got rid of but I wanted to preserve the wordpress files/site. I have (what appears to be) successfully moved the files and database to WAMP and am able to see the initial page. The problem is that when I click on the sign in link, it's pointing to the .com domain name that I had and I cannot figure out how to fix it.

Options: ReplyQuote
Re: Moved from live site to WAMP, incorrect login page.
Posted by: Otomatic (Moderator)
Date: February 29, 2024 07:49PM

The mandatory prerequisite is to have transferred WordPress to a VirtualHost, even locally!

- Modify the wp-config.php file to include the correct database connection information:
DB_NAME
DB_USER
DB_PASSWORD
DB_HOST

- Modify wp_options table to include local url for option_name and siteurl fields

You should have obtained this information from WordPress, not from Wampserver, which can't possibly know the transfer procedures for dozens of CMS and hundreds of WEB applications.

What's more, it won't change all the internal links, but since I'm in a good mood, here's an SQL script that should update everything:
# Change site URL
UPDATE wp_options
SET option_value = REPLACE(option_value, 'oldUrlSite', 'newUrlSite')
WHERE option_name = 'home'
OR option_name = 'siteurl';

# Changing GUID URLs
UPDATE wp_posts
SET guid = REPLACE (guid, 'oldUrlSite', 'newUrlSite');

# Change media URLs in articles and pages
UPDATE wp_posts
SET post_content = REPLACE (post_content, 'oldUrlSite', 'newUrlSite');

# Change meta data URL
UPDATE wp_postmeta
SET meta_value = REPLACE (meta_value, 'oldUrlSite', 'newUrlSite');
In addition to "oldUrlSite / newUrlSite", don't forget to transpose table headers, which aren't necessarily in "wp-" (it's even recommended that they aren't, for security reasons).

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote
Re: Moved from live site to WAMP, incorrect login page.
Posted by: PropDad (172.56.248.---)
Date: February 29, 2024 11:10PM

I had another website that I had just done this with and had no problem. I have already done the first two steps that you suggested. I will look at the third one and see what I can do. Thanks for the suggestions!

Options: ReplyQuote


Sorry, only registered users may post in this forum.