Forums

backup oldsite, restore to newsite, now all links redirect to oldsite (5 posts)

  1. jbreher
    Member
    Posted 4 months ago #

    For quite some time, I have been using WordPress Database Backup by Austin Matzko to back up my WP DBs.

    I recently decided to migrate a site from olddomain.tld to newdomain.tld. After installing WP on newdomain.tld, I used phpMyAdmin to restore the old site's database to newdomain.tld.

    Now the landing page of newdomain.tld looks right. I can see most recent posts that were made back at olddomain.tld.

    However, anything I click on newdomain.tld redirects back to olddomain.tld. For example, if I click the 'Log In' link in the Meta section on newdomain.tld, the URL I am sent to is olddomain.tld/wp-login.

    Is there some way to have the links point to the material on newdomain.tld?

  2. SwansonPhotos
    Member
    Posted 4 months ago #

    This is common with hardcoded URL's in posts pages etc...Very carefully use the Search and Replace Plugin or use manual SQL string replace queries ... make sure you have a backup of your db made just prior to either and again it is quite important to use extreme care when replacing strings in the db...also, turn off caching prior...or cached pages will not be updated until cron time or set cache flush times....

  3. jbreher
    Member
    Posted 4 months ago #

    Thanks Swanson -

    Unfortunately, I cannot install the Search and Replace Plugin in the newdomain.tld install of wordpress. I cannot log in to do so, as clicking the Log In button on newdomain.tld actually opens OLDdomain.tld/wp-login.

    I guess I was hoping that the domain info within WP itself was abstracted away. Reading howtos suggests that others have used exactly this process to migrate a WP install to another domain. However, I can't see that anyone mentions having this problem in doing so.

  4. SwansonPhotos
    Member
    Posted 4 months ago #

    Clear browser cache, flush dns, make sure site is active in DNS system at correct IP Address, if so, navigate to //newdomain.com/wp-login.php

    Also review the proper usage in wp-config.php

  5. jbreher
    Member
    Posted 4 months ago #

    Found the issue.

    The exported database has a lot of references to the old URL in it. I needed to hand-edit the .sql file, and replace all instances of olddomain.tld with newdomain.tld. I then re-imported the edited .sql. There is a further wrinkle that some of these text strings are prepended with string length, which must be suitably modified.

    The key to the issue was this post: http://sltaylor.co.uk/blog/moving-wordpress-new-domain-server/

Reply

You must log in to post.

About this Topic