Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9311921
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 19, 20262026-06-19T01:29:57+00:00 2026-06-19T01:29:57+00:00

Setting a wordpress project to its staging environment, I have ran into an issue

  • 0

Setting a wordpress project to its staging environment, I have ran into an issue regarding paths that were set for the development environment, and don’t fit the ones in staging.

So I need to update the paths in the database, from C:\xampp\htdocs\site.com to /var/www/site.com

At first, I tried replacing, the same way I replaced the urls:

update `wp_slider` set `url` = replace(`url`, 'http://local.', 'http://');

Then the paths:

update `wp_slider` set `path` = replace(`path`, 'C:\xampp\htdocs\site.com', '/var/www/site.com');

Which actually didn’t work. Then I tried a SELECT to see what rows can I retrieve:

SELECT * FROM `wp_slider` WHERE `path` LIKE "%C:\xampp\htdocs\site.com%"

Which will return an empty result. What am I missing?

Forgot to mention, that I tried escaping the \ by doing \\ and I still get no result

A full path of what I’m trying to replace would be like: C:\xampp\htdocs\site.com/wp-content/plugins/slider/skins/slider\circle\circle.css

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-19T01:29:59+00:00Added an answer on June 19, 2026 at 1:29 am

    That’s roughly the way to go:

    mysql> SELECT REPLACE('C:\\xampp\\htdocs\\site.com\\foo\\bar.txt', 'C:\\xampp\\htdocs\\site.com', '/var/www/site.com');
    +----------------------------------------------------------------------------------------------------------+
    | REPLACE('C:\\xampp\\htdocs\\site.com\\foo\\bar.txt', 'C:\\xampp\\htdocs\\site.com', '/var/www/site.com') |
    +----------------------------------------------------------------------------------------------------------+
    | /var/www/site.com\foo\bar.txt                                                                            |
    +----------------------------------------------------------------------------------------------------------+
    1 row in set (0.00 sec)
    
    mysql>
    

    If you get zero matches that’s because your DB records do not contain what you think they do. Make sure you don’t have blanks or control characters. If your MySQL client does not make it easy to spot such things, you can always use HEX():

    SELECT path, HEX(path)
    FROM wp_slider
    WHERE path NOT LIKE "C:\\xampp\\htdocs\\site.com%"
    

    Additionally, I’m not fully sure you can use \ as path separator in Unix systems. I suggest you replace it as well:

    UPDATE wp_slider
    SET path = replace(path, '\\', '/')
    WHERE path IS NOT NULL
    

    Update:

    What I’m trying to explain is that your procedure is basically correct (except that escaping \ is not always optional):

    mysql> CREATE TABLE wp_slider(
        -> path VARCHAR(2083)
        -> );
    Query OK, 0 rows affected (0.06 sec)
    
    mysql> INSERT INTO wp_slider (path) VALUES ('C:\\xampp\\htdocs\\site.com/wp-content/plugins/slider/skins/slider\\circle\\circle.cs
    s');
    Query OK, 1 row affected (0.04 sec)
    
    mysql> UPDATE wp_slider SET path=REPLACE(path, 'C:\\xampp\\htdocs\\site.com', '/var/www/site.com');
    Query OK, 1 row affected (0.03 sec)
    Rows matched: 1  Changed: 1  Warnings: 0
    
    mysql> SELECT * FROM wp_slider;
    +----------------------------------------------------------------------------+
    | path                                                                       |
    +----------------------------------------------------------------------------+
    | /var/www/site.com/wp-content/plugins/slider/skins/slider\circle\circle.css |
    +----------------------------------------------------------------------------+
    1 row in set (0.00 sec)
    

    If you don’t get matches it’s because your database contains different data than you think, such as (but not restricted to) whitespace or control characters:

    mysql> TRUNCATE TABLE wp_slider;
    Query OK, 0 rows affected (0.03 sec)
    
    mysql> INSERT INTO wp_slider (path) VALUES ('C:\xampp\htdocs\site.com/wp-content/plugins/slider/skins/slider\circle\circle.css');
    Query OK, 1 row affected (0.02 sec)
    
    mysql> UPDATE wp_slider SET path=REPLACE(path, 'C:\\xampp\\htdocs\\site.com', '/var/www/site.com');
    Query OK, 0 rows affected (0.00 sec)
    Rows matched: 1  Changed: 0  Warnings: 0
    
    mysql> SELECT * FROM wp_slider;
    +------------------------------------------------------------------------------+
    | path                                                                         |
    +------------------------------------------------------------------------------+
    | C:xampphtdocssite.com/wp-content/plugins/slider/skins/slidercirclecircle.css |
    +------------------------------------------------------------------------------+
    1 row in set (0.00 sec)
    

    In this last example, we forgot to escape \ when inserting and as a result we don’t get a match when replacing because the input data is not what we thought it was.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hi I just got into wordpress theme development and I have seen many developers
My wordpress is not setting the front page correctly, I have several pages, all
Setting up a project structure; I am thinking is it better to have somewhat
I have a WordPress template that contains the following element: <html xmlns=http://www.w3.org/1999/xhtml <?php language_attributes('xhtml');
When I set my WordPress site's address (URL) setting to = http://www.example.com , then
I have a client who is embedding videos into his WordPress blog. The problem
I have my own wordpress template with option setting. My option setting having option
I'm setting up Nginx as a proxy to apache2 serving a Wordpress installation. Issue
I'm setting up a postwwwacct script to set up a WordPress installation with some
First, I am using Wordpress for this project but I don't think this issue

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.