Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Having some trouble moving a WordPress site...
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.

Having some trouble moving a WordPress site...

YmpkerYmpker Member
edited May 2016 in Help

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:

  1. I have exported the wp database.
  2. I have rsynced the whole www directory including the wp files on the old server to the new server.
  3. I have created a new database at the new host and imported the old database I exported before.
  4. I changed the db username/name/password in wp-config.php to the one of the newly created database.
  5. 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
  6. 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 ?

    Thanked by 1vimalware
  • zafouharzafouhar Veteran

    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

    Thanked by 1doughmanes
  • YmpkerYmpker Member

    @doughmanes said:
    .htaccess ?

    There ya go:

    BEGIN WordPress


    RewriteEngine On
    RewriteBase /
    RewriteRule ^index.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]

    END WordPress

  • htaccess looks fine. Go with the other recommendation about the URLs set in the db

    Thanked by 1Ympker
  • YmpkerYmpker Member
    edited May 2016

    @zafouhar said:
    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

    That was all the magic it seems! Works fine now :) Thanks a ton mate!

    Thanked by 2doughmanes zafouhar
  • AmitzAmitz Member

    @zafouhar said:
    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

    This will be your solution. I would bet on that.

    Thanked by 2Ympker zafouhar
  • YmpkerYmpker Member

    @Amitz said:

    @zafouhar said:
    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

    This will be your solution. I would bet on that.

    It was :) And here I was, wondering what the fu** I have forgotten :P

    Thanked by 1zafouhar
  • dailydaily Member
    edited May 2016

    @Amitz said:

    @zafouhar said:
    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

    This will be your solution. I would bet on that.

    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!

    Thanked by 2Ympker zafouhar
  • AmitzAmitz Member

    It was always THAT thing that I forgot when moving a wordpress site... ;-)

    Thanked by 2Ympker zafouhar
  • YmpkerYmpker Member

    @Amitz said:
    It was always THAT thing that I forgot when moving a wordpress site... ;-)

    Seems I am no better :-)

    Thanked by 1Amitz
  • K4Y5K4Y5 Member
    edited May 2016

    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.

  • YmpkerYmpker Member

    @K4Y5 said:
    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..

  • K4Y5K4Y5 Member

    @Ympker said:

    @K4Y5 said:
    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.

    Thanked by 2Junkless Amitz
  • AmitzAmitz Member

    @Ympker said:

    @Amitz said:
    It was always THAT thing that I forgot when moving a wordpress site... ;-)

    Seems I am no better :-)

    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');

  • MikePTMikePT Moderator, Patron Provider, Veteran

    If you're still having this issue, PM me, I'll get this sorted in 5 minutes, for free. :)

    Thanked by 1Ympker
  • JunklessJunkless Member
    edited May 2016

    @MrGeneral said:
    If you're still having this issue, PM me, I'll get this sorted in 5 minutes, for free. :)

    @Ympker said:

    @zafouhar said:
    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

    That was all the magic it seems! Works fine now :) Thanks a ton mate!

    There you go, saved those 5 mins of yours, for FREE :)

    Thanked by 1MikePT
  • YmpkerYmpker Member

    @MrGeneral said:
    If you're still having this issue, PM me, I'll get this sorted in 5 minutes, for free. :)

    It's all fixed already. Thanks for the offer though :)

    Thanked by 1MikePT
  • MikePTMikePT Moderator, Patron Provider, Veteran

    You're welcome :)

    Thanked by 1Ympker
  • FaiziFaizi Member

    @K4Y5 said:

    @Ympker said:

    @K4Y5 said:
    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.

    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.

  • JamesKJamesK Member
    edited May 2016

    @Ympker said:
    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:

    1. I have exported the wp database.
    2. I have rsynced the whole www directory including the wp files on the old server to the new server.
    3. I have created a new database at the new host and imported the old database I exported before.
    4. I changed the db username/name/password in wp-config.php to the one of the newly created database.
    5. 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
    6. 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?

    Checkout this step by step tutorial http://www.shoutmeloud.com/how-to-move-wordpress-site-to-new-host-zero-downtime.html

  • NdhaNdha Member
    edited May 2016

    @Faizi said:
    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.

    @Faizi what was your setting in interconnectit for moving to SSL???

    is it input domain.com and https://domain.com in second column??

  • YmpkerYmpker Member
    edited May 2016

    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:

  • FaiziFaizi Member

    @Ndha said:

    @Faizi what was your setting in interconnectit for moving to SSL???

    is it input domain.com and https://domain.com in second column??

    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.

    Thanked by 1Ndha
Sign In or Register to comment.