WP CONFIG edit fails to fix URL issue on WP
-
So, I was setting up a new site for a customer and once we got everything configured the way they wanted it, I began the process of porting the image over from my VPS to their own account setup with the same provider.
On porting it over, some of the IP settings seem to have stuck from the prior image as I keep finding re-directs. When I take down the image on my account, their site gets all wonky.
Here’s what I’ve done:
Edit the WP-CONFIG to point directly to their IP address
Changed their htaccess file to .htaccess)old
Modified the unctions files for the basic theme of twentyfifteen that they’re using to also reference their IP address
Re-upload the basic themes from the wordpress site from scratchNothing seems to get me back to even a basic setup. I suspect it is something somewhere else in the image file that ported over thats referencing the old IP address but the provider is saying it’s WP based.
Help?
-
On porting it over, some of the IP settings seem to have stuck from the prior image as I keep finding re-directs. When I take down the image on my account, their site gets all wonky.
The URLs in the database still point to the development site. They need to be replaced with URLs for the destination domain.
See if there’s anything here that might help: Moving WordPress
…and from that article: Changing Your Domain Name and URLs, with some additional focus on the information under step 9.Thanks Clayton – yeah, I’ve been to that page and while the documentation is solid advice for someone fluent in db administration, the simple fact of the matter is that I am not that familiar with db administration. I was hoping someone could actually provide a more in-depth analysis than querying the subject line of this post and then pointing me to the WP wiki.
While I love the WP platform, often the forums have been less than satisfactory for this exact reason – everyone assumes that anyone who throws something up there for assistance has fluency across the board, when in reality, those of us that post questions likely are doing so simply because we do NOT have proficiency or fluency to that degree.
NO offense to Clayton, but I need some assistance that doesn’t point me to an article that refers to obscure DB import/exports and searching for IP addresses and cleaning that up and all that…there’s got to be a PHP file somewhere that has a redirect in it – just would like someone who has the time to help me take a look at this specific scenario and say:
“Your problem is in file XYZ.PHP” Go into your editor and change this line of code from:
gobeldy gook
to
gobbeldy gook 2
I was hoping someone could actually provide a more in-depth analysis than querying the subject line of this post and then pointing me to the WP wiki.
Yeah… okay. But, no. Your initial assumptions aside for a moment, based on the description of your issue, the information I pointed you to seems pretty on point, includes links to, and suggestions for, tools used in updating the database after migrating a site. In all probability (based solely on your description of the problem at this point) that’s going to be the solution to your issue.
NO offense to Clayton, but I need some assistance that doesn’t point me to an article that refers to obscure DB import/exports and searching for IP addresses and cleaning that up and all that…there’s got to be a PHP file somewhere that has a redirect in it
No offense taken. Your reaction to the information in the instructions I pointed you to tells me all I need to know.
There’s nothing obscure about it. It’s a common requirement, and it’s not a php file issue (unless you’ve gone ahead and edited files that shouldn’t have needed editing). It’s a database issue – old URL’s stored in the database used for development -vs- new URLs required to make the site function on the new domain after you move the site.
just would like someone who has the time to help me take a look at this specific scenario and say:
“Your problem is in file XYZ.PHP” Go into your editor and change this line of code from: gobeldy gook
to gobbeldy gook 2
Okay.
– Your problem is most probably with the URLs stored in your database. They probably still point to the domain you used for development.
– Use one of the plugins or scripts mentioned in the instructions I pointed you to, to change the information in the database to reflect the new site location, while being mindful of the information offered about serialized data.
- Use the Velvet Blues Update URLs or Better Search Replace plugins if you can access your Dashboard.
- Use WP-CLI’s search-replace if your hosting provider (or you) have installed WP-CLI.
- Use the Search and Replace for WordPress Databases Script to safely change all instances. (If you are a developer, use this option. It is a one step process as opposed to the 15-step procedure below)
Once that’s completed, you can undo any unnecessary file edits you may have made, and clear the next hurdle.
I was setting up a new site for a customer
As a developer, you’re going to encounter tasks such as basic export and import of databases and issues with changing domains/site locations fairly often. It’s not so much a case of needing to be a database administrator, as it is just being familiar and comfortable with the tools needed to do the job.
There is another help option or two available if you like. You could try posting a request for professional help here if you want to: https://jobs.wordpress.net/
Using the plugins woudl be great, but I can’t get to the admin panel on either site…
As to being a developer, not the case. Never claimed to be able to develop themes – I am very much just a guy that helps people set up their websites and know enough about DNS, registration, hosting, and WP to do basic installs for people and get them up and running.
In my mind:
1. Developers are people that know code, write code, build themes from scratch, etc.
2. DB admins perform queries in databases, lookups, searching, replacing, building, etc.
Speaking to #1 – I can probably deconstruct and flesh out problems in existing PHP but writing it from scratch – not my ballywick
Speaking to #2 – I know how to Google things like “run a SQL query to search and replace ??
All that said, after reading through the process for the Search and Replace for WordPress Databases Script (and thank you for linking me btw), that does seem pretty pain-free so will give that a whirl tonight. If I still have problems, I will probably just have the host redeploy WP and build it up from scratch again (it only took me about an hour or so to get the basics fleshed out…and all the images I have saved ??
Just an afterthought, because this info is bothering me a bit..
from my VPS to their own account setup with the same provider.
When you moved the WordPress files from your development area to your customers domain, you did also export the database from the development site then imported that data into your customers database on their hosting account as part of the moving process, is that correct?
My VPS provider (Digital Ocean) has a process whereby I:
1. Power off the instance (they call it a droplet)
2. Take a snapshot of the instance while offline
3. Send it to new account holder
4. Spin up the image under the new account older as a new droplet
5. Set up DNS on their account
6. Reconfigure their registrar to point to the new IP address and name servers (ns1.digitalocean.com, ns2.digitalocean.com, ns3.digitalocean.com)My understanding was that taking the snapshot would do the same as an export/import of the database. I did not do anything like that manually…
Ah ha….more digging reveals that the image transfer does not update IP addressing:
https://www.digitalocean.com/company/blog/easily-transfer-snapshots-between-accounts/
“Hamdi ? 10 months ago
Does this functionality transfer IP address?Andrew Starr-Bochicchio Mod Hamdi ? 10 months ago
No, this doesn’t transfer the IP address. The IP is associated with the original droplet, not the snapshot. In fact, you can have multiple snapshots of the same droplet.”So, where are IP addresses housed in the WP setup and DB? It seems like that scripting solution might be my best bet…
The interesting thing is that there looks to be a typo on a couple links where it should be:
https://104.131.71.124but is
And it’s only in two places on a page that apparently has not had any styles applied to it: (the header and the link to the Home page…)
All else seems to actually be pointing to the right IP address, for the sub pages, except one page (Senior Pictures) which is directing back to the DEV server:
https://104.236.234.241/?page_id=40
And when I try to access the wp-admin console, I get the following in my address bar:
https://104.131.171.124/wp-login.php?redirect_to=http%3A%2F%2F104.131.71.124%2Fwp-admin%2F&reauth=1
With the error: “Not Found
The requested URL /wp-login.php was not found on this server.”
This might be fixable by finding the specific references in the db files, but I have no idea which db files I’d need to touch and how to edit them. The provider is saying “we don’t know the schema, but you can do this in MySQL…”
Tangentially, I find it odd that the VPS provider doesn’t know the schema for an instance of an app that they deployed – does that strike anyone else as odd?
Yikes… I was afraid when you used the term “image” in your original post you might be referring to a “droplet”. I have no knowledge of how they facilitate moving their images from one domain to another, but once you get them to help you with the ip change for the image now on the new domain, you may still be faced with the same WordPress database URL issues due to the change in domain names ( or in this case different numeric ips).
https://104.236.234.241/?page_id=40
You’re using numeric ip addresses in your WordPress installation URL’s, so right off the bat, just as if you were using valid domain names in your URLs, if you move the image to a different ip address and don’t do a search and replace on the database to replace the old ips with the new location ip address, it’s instant failure.
The WordPress installation on the relocated image will try to pull content from the old ip address, instead of the new location. That’s why the new site goes spazzy (is that even a legit word?) when you disable your development image.
My opinion on the shortest route to Nirvana?
1) Enlist Digital Ocean support to get you on track with changing the ip address for the new image.
2) Run the search and replace script on the WordPress installation located on the new image, replacing all instances of
104.236.234.41
with the new ip104.131.71.124
3) Crack open a cold one and reap the rewards.
But seriously.. I wish I could help with more precise info, but I know absolute zero about Digital Oceans Droplets and image snapshot manipulation process.
Thanks Clayton – here’s the extent of what Digital Ocean’s “support”
we offer the one-click applications as a convenience for installing certain popular software, but we don’t have any control over what happens after that point. This is why we’re not able to provide specific SQL commands, know how your database schema and content has changed over time, or perform other maintenance tasks for you. In these situations, the WordPress community may be the best resource as they’re most familiar with the software.
If you’re not as familiar with the command-line or SQL, you could also use something like phpMyAdmin to manage your databases in a web browser. This will along you to search and replace (among many other features) graphically, without having to write out the SQL code. If you’re interested, this is an article[1] that goes into some detail about how to install and secure it.
Let me know if you have any other questions or concerns and we’ll be happy to help.
Bascially – their answer “we’re not touching it”…
So, I am going to give your suggestion of that searchandreplace.php file a try. If that doesn’t clean it up, I may have to rebuild it from scratch on the customer side…*sigh*
All this for the $100 they paid is slowly taking me down to less than minimum wage! LOL
Interesting, I followed the directions, created the supersecret folder, FTP’d the PHP file into that folder, and trying to hit it via browser (yes, I chmodded the folder recursively to 777), and I get a 403 error:
forbidden
This sucks…
Time to reinstall WP from scratch I guess ??
- The topic ‘WP CONFIG edit fails to fix URL issue on WP’ is closed to new replies.