New on LowEndTalk? Please Register and read our Community Rules.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
Having some trouble moving a WordPress site...
Fixed
Alright,
So I wanted to move a WordPress site from a friend from one host to another and somehow it doesn't work as it should, so here is what I have been doing:
- I have exported the wp database.
- I have rsynced the whole www directory including the wp files on the old server to the new server.
- I have created a new database at the new host and imported the old database I exported before.
- I changed the db username/name/password in wp-config.php to the one of the newly created database.
- I go to http://temporarydomain.com and the frontpage of the wp site shows just fine. However navigating to other pages is impossible as it suddenly redirects me to blog.olddomain.com/blablabla
- So I figured maybe I just need to change the menu from within the dashboard to redirect to the new server if they were redirecting to the old one. But I also cant access http://newdomain/wp-admin . Whenever I go to http://temporarydomain.com/wp-admin I am instantly redirected to http://blog.olddmain.com/wp-admin
Any ideas?
Comments
.htaccess ?
Go to your database, find the wp_options table and make sure the Home and Base URL are correct - they are usually on page two if you are using phpmyadmin
There ya go:
htaccess looks fine. Go with the other recommendation about the URLs set in the db
That was all the magic it seems! Works fine now Thanks a ton mate!
This will be your solution. I would bet on that.
It was And here I was, wondering what the fu** I have forgotten :P
Err.. me too. Yeah, that's the issue. Totally. I bet 100%. I know this for a fact, from my extensive knowledge on WordPress. You can thank me later!
It was always THAT thing that I forgot when moving a wordpress site... ;-)
Seems I am no better :-)
In the future if you ever need to move a wordpress site again, ALWAYS install and use this plugin to export the database - https://wordpress.org/plugins/wp-migrate-db/
You'll save a ton of time which you could do something constructive with.
Looks nice, but just talking about the process of importing&exporting a database in phpmyadmin it really doesn't take that much time. So not that much of a time saver in this case :P I guess in different circumstances it may be though..
If you switch domains and servers, this plugin handles the serialized data along with the URL and file paths within articles, pages & custom posts. It is a lifesaver in some situations, but certainly a time saver in most.
You are in good company then! ;-)
You could also define the correct urls in the wp_config.php file.
define('WP_HOME','http://example.com');
define('WP_SITEURL','http://example.com');
If you're still having this issue, PM me, I'll get this sorted in 5 minutes, for free.
There you go, saved those 5 mins of yours, for FREE
It's all fixed already. Thanks for the offer though
You're welcome
Another handy tool if you don't want to install any extra Wordpress plugin is this PHP script:
https://github.com/interconnectit/Search-Replace-DB
I always use this tool when migrating Wordpress website, changing domain or moving to SSL, very convenient.
Checkout this step by step tutorial http://www.shoutmeloud.com/how-to-move-wordpress-site-to-new-host-zero-downtime.html
@Faizi what was your setting in interconnectit for moving to SSL???
is it input domain.com and https://domain.com in second column??
After 3 hours I finally finished migrating a single **** WP site which usually should have taken no more than 10 minutes. Several issues with the hosts tools keept popping up one after another including a nice Internal Server Error resulting in a downtime of 1,5h (according to uptimerobot) of ALL my domains I have with that host. Props for @MrGeneral for trying to help me but dude their system was just so messed up.
TL;DR: Wanted to transfer to another host to save some bucks and got busted.
Remember guys:
In first column(search for..) fill in the original domain; http://domain.com
In the second column(replace with..) fill in the new domain; https://domain.com
Do a dry run first and check the result, just to make sure. I also search for http reference, for example your old post might embed media from http sources.
Also, don't forget to check your theme. Some theme have external resources from http link.