0

In /var/www/html I have a site dir. I've duplicated that site's dir and db into a new site dir and db by the name of "test" (without quote marks), and changed wp-config.php accordingly.

I Navigated into this new site dir in console (cd /var/www/html/test), and ran:

wp search-replace 'https://MY_ORIGIAL_DOMAIN' 'https://MY_IP/test'

The site itself goes up and its internal links become based on test, but 2 problems occur:

  1. All css is jumbeled up.
  2. The original site's CSS is also jumbeled up (this is quite wired, I must say).

While I can reverse the result, I admit I don't understand what's going on (because I do everything in the new dir and not in the original dir).

Update

I was wrong, the db wasn't changed to test in wp-config.php... It seems my sed operation failed:

sed -i 's/${domain}/test'/g /var/www/html/test/wp-config.php
  • lots of questions: were the 2 new directories nested or side-by-side. Did you change the wp-config? did you try logging the change or at least reporting with wp-cli? – rudtek Dec 3 '17 at 23:16
  • To make sure I'm totally clear, I've edited the question. I would most appreciate if you'd read it again in this more detailed manner. – Arcticooling Dec 3 '17 at 23:20
  • try this: "wp db size" and confirm the db is correct, then also try getting a report, or run a "dry run" of the search replace to see if it's trying to change both db's. put results in question above. – rudtek Dec 3 '17 at 23:26
0

The problem was due to some conflict between variable values (I don't recall the exact details).

The solution AFAIR, was to just use another Bash session, without any predefined variables (I just newly defined any variable I needed this time):

$ bash

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.