Staging to production push not updating the Hustle Feature Image URL.

Every time I push my site from staging to production, the images that I use in Hustle do not update to the production domain URL so I get errors in page speed tests that I am serving the same image from 2 URLs. I do an ssh wp search-replace on the URL, but it does not find it within the hustle data… I’m able to fix it by going into the pop-ups and manually replacing the image, but that’s kinda a pain. Please check and help with this.

  • Lee
    • Freelance WP Developer

    Another anomaly (not sure if its related), but I notice that Hustle is adding the Last Name field into my email opt-ins without me choosing to add it, and after I have removed it from the form upon first creation. I’m not sure if this is random or on push/pull from staging/production, but thought I should mention it. I will pay more attention to the sequence of events next time I notice it.

    Thanks.
    Lee

  • Dimitris Kalliris
    • Support Team Lead

    Hello there Lee

    About the staging->live issue, I’ve already pinged our developers about it, in order to further investigate.

    The First/Last name issue is already reported to us and it’s going to be fixed in the upcoming v.4.2.1. If you’d like a hotfix until the original release, do let me know here in your next reply. :slight_smile:

    Thank you,
    Dimitris

  • Maciej Palmowski
    • Recruit

    Hi Lee

    About moving the site between environments – yes, there is a problem because when you are moving your site e.g. from staging to production we run wp search-replace only on certain tables. We do this because if we would run this operation on all tables in some cases it could take a lot of time. Although we started a discussion about this and maybe we will change something in this matter.

    Good news is you already mentioned that using wp search replace on your own isn’t a problem for you. Next time run:

    
    wp search-replace '//old.domain' '//new.domain' --all-tables-with-prefix
    

    it should replace the domain in all tables having the same prefix.

  • Lee
    • Freelance WP Developer

    Good morning Maciej.

    Thank you very much, I will give that a try next time and see how I make out.

    I am curious as to why when I run the standard wp search-replace on a dry run, it does not even identify the database entries exist – I have had to use phpmyadmin to identify them.

    Thanks for your help and quick response!

    Lee

  • Maciej Palmowski
    • Recruit

    Hi

    wp-cli by default only includes registered tables – you can check them out running wp db tables. It will be the core tables.

    On the other hand wp search-replace has few interesting flags or options:
    –all-tables – the search replace will run on all the tables that WP sees with his current admin and password. This might be unsafe if you have multiple WordPresses in one table with different prefixes
    –all-tables-with-prefix – it will only that with the same prefix – I think it’s the best solution in most cases.
    [table] parameter – you can specify which exact tables you want to search and replace.

    You can find all the flags and params here – https://developer.wordpress.org/cli/commands/search-replace/ .