• Hi guys!

    I wanted to be smarter than all the migration plugins or hosting software and wanted to move the site manually from staging domain to the real domain.

    So, I
    – zipped the entire public_html folder and moved it to the destination domain
    – moved the database,
    – changed the URL’s in database at _options table,
    – changed the database details in wp-config file,
    and basically I thought that’s enough, site was working so I was not bothered.

    Today I have noticed that our site dropped in SEO rankings, and just found that there is a thousands URL’s in database pointing towards the staging domain and also in the files on the server, mainly from Yoast SEO. This plugin remined working on staging domain and that was my mistake I guess.

    So, I used plugins like:
    – Elementor/Tools/Replace URL (this replaced many URL’s but not all)
    – Velvet Blues Update URLs (this plugin replaced many links but not still all)
    – Better Search Replace (to replace database URL’s but this plugin was not able to change even one link)

    And now I’m still struggling to get this fixed.
    In the meantime I have turned on Cloudflare and changed non www domain URL’s to www URL’s as this was Cloudflare requirement. So this probably additionally messed everything up.
    Now Cludflare is turned off so I can resolve the URL’s problem first.

    I know I’m an idiot so please don’t tell me what I already know ??
    The reason I decided to do the migration on my own was that SiteGround migration tools was giving me an errors always I tried to use the, and also I wanted to have a better control over migration process.
    Maybe this was a bad idea but I’m the type thato prefer to edit files on the server than change this in WordPress (just an example) ??

    Is there any tool or script which allow me to change database UTRL’s and any tool for complete site URL’s change?
    I have downloaded full site to my HDD and just checked in VSCode how many old links is there, and there is 1583 results ?? I can change them in VS code and upload the site back but the database is the problem.

    That’s the tables I need to replace links in:
    _options (11 matches)
    _posts (41 matches)
    _wp_rucss_resources (28 matches)
    _yoast_indexable (12 matches)
    _yoast_seo_links (485 matches)

    I will be so grateful for any help…
    Thanks so much!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Topher

    (@topher1kenobe)

    If you know how to use the WP-CLI that’s a great solution, look at the search-replace option.

    Otherwise, Better Search and Replace is probably your best bet. If it’s not working it’s probably not configured properly, and I’d ping their support. It’s really that simple.

    Related, are you familiar with serialized data? You need to be VERY careful with search and replace in the database to not mess that up. Better Search and Replace will keep you safe there, as will WP-CLI.

    Thread Starter maryando

    (@maryando)

    Hi,

    Thanks for your valuable answer.
    However I have not idea how to use WP-CLI, I have database backup so I’m not worry to mess things up as I can always restore it.
    With Yoast I actually managed installing “Yoast Test Helper” plugin (very advanced and really good plugin) and there was an option under ‘Yoast SEO’ section called ‘Reset Indexables tables & migrations’ this fixed all Yoast problems.
    Now over 1500 site url’s left.
    I will try the Search and Replace again.
    Thanks

    • This reply was modified 3 years, 1 month ago by maryando.
    Thread Starter maryando

    (@maryando)

    Ok all done!
    Database URL’s changed ‘Yoast Test Helper’ as mentioned above.
    The rest of 13 entries in database changed manually.
    Then all site links changed by VSCode.
    All works as it should now.

    The funny thing is that I still don’t know if this is a normal situation.
    I understand the mess with the Yoast plugin, that before moving the website to the staging environment the plugin need to be disabled. Then enabled only when the site is back to the live domain, but I’m still don’t know if this is correct way of doing this.

    Then why all other links changed.

    So what I did exactly?
    Because I was revamping the website totally I decided to move it to the staging domain and work there then when the web is finished move it back to the original domain.

    Is moving WordPress not that simple as:
    – zip the web folder and move it to the another domain
    – moving database,
    – changed the URL’s in database in _options table,
    – changed the database details in wp-config file,
    Is something else must be done in order to do it correctly?
    Or maybe all was done correctly and WPRocket, Yoast created this mess?

    I found so many URL’s from staging domain in so many files that this is just crazy for me.
    What is your best way of doing this guys?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘WordPress migration and URL’s problem’ is closed to new replies.