Question

Site not looking right after migration

Posted January 21, 2020 394 views
WordPress

Hi, I was wondering if you can point me in the right direction. I just bought a digital ocean droplet and connected it to ServerPilot.

  1. I installed a fresh WordPress via ServerPilot.
    -For the Domain in ServerPilot area, I entered my DO server IP so that I can see the site before going live.

  2. I installed All-in-one WP migration on the new WP.

  3. I went on my main site broadlinkmedia.com and exported the site with All-in-one WP migration

  4. I went on my DO server: http://my.ip.address/wp-admin
    and imported my site from my.website.com

But when I visit http://my.ip.address
my site lost its format and some pages have no text.

I thought maybe I would need to use the “Better search-replace” plugin to change all the my.website.com to the IP (as shown in picture). I did that but it didn’t change anything.
https://www.screencast.com/t/iPA6jCRWgr7

Can you advise me what I should check to fix this? I want to learn how to do this myself but I have no idea where to begin.

Thanks for your help

edited by MattIPv4

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
2 answers

Hello, @mike212916

If you would like to have the site accessible from the server IP then you need to update the references in the database from the domain name to the IP address that is correct. There are few ways to do that and one of them using the Better search-replace. I personally prefer to use the following script: https://interconnectit.com/products/search-and-replace-for-wordpress-databases/ as it’s proven to work just fine.

Also an alternative way is to use a plugin called “Duplicator” it will update all of the paths and references from the dev domain to the main domain. This is why we usually recommend using a plugin called: Duplicator. The plugin will generate a backup for your website’s files and database. Then when you import the files to the new domain, all of the references for the old domain name will be updated properly with the correct ones.

However from my point of view this is not actually needed, because you can simply migrate the website to your droplet and access/view the site from there. If the domain name is still not pointed to your Digital Ocean droplet you can still preview the site by altering your local hosts file on your machine (PC). In this way you can check the site and see if it was migrated okay.

I assume that there are still references for the domain name that needs to be updated or there might be a hard-coded references in the files. However you can simply open the browser’s console and see if there are some files/resources reported as missing (404) and etc

Let me know how it goes.

Regards,
Alex

  • However from my point of view this is not actually needed, because you can simply migrate the website to your droplet and access/view the site from there. If the domain name is still not pointed to your Digital Ocean droplet you can still preview the site by altering your local hosts file on your machine (PC).

    That would be great, but is this possible to do using ServerPilot? Because that is what im using to manage a lot of the backend code.

    I followed the instructions here https://www.screencast.com/t/SuGsg5rY
    on ServerPilot by adding my Droplets IP address so I can view the site there. Right now its just a blank wordpress site, great, but when I try to sign in doing http://my.ip.address/wp-admin it automatically redirects me to mydomain.com/wp-admin which I dont want it to do.

    Im at the point where Im still trying to figure out how to see this “offline” first before making the DNS switch at the domain level. but im having trouble figuring out how to do this using ServerPilot.

    • Hello, @mike212916

      As long as you know the IP address you can always alter your local hosts file to preview your site loading from this particular server before pushing the DNS changes.

      Regards,
      Alex

Hello,

All-in-One WP Migration creator here.

The plugin will do the replacement for you during import. You do not need to use any additional database search and replace.

My guess here is that you are accessing your website from 2 URLs.
http://domain.com
http://ip address

If that is the case, one of the urls will work while the other will be broken.

  • Hello, @yanislav

    Can you please share more information about the plugin and how it’s used so the rest of the community can check this as well?

    I assume this is the plugin in question - https://wordpress.org/plugins/all-in-one-wp-migration/

    Regards,
    Alex

    • Sure.
      You are right about the plugin in question - https://wordpress.org/plugins/all-in-one-wp-migration/

      The main idea behind the plugin is to make the transfer of a website simple.
      The plugin requires WordPress so installing a WordPress on both source site and destination site is a must.
      The plugin follows a straightforward WordPress install:

      1. Login to wp-admin
      2. Go to Plugins -> Add new
      3. Search for All-in-One WP Migration
      4. Install and Activate the plugin

      There will be a menu added to WordPress “All-in-One WP Migration”. The menu has 3 submenus:

      • Export
      • Import
      • Backups

      Using Export, users can export a website to a file.
      Using Import, users can import a website from a file.
      The plugin will replace the site URL on import so searching and replacing for the domain name is not needed. The backup contains plugins, themes, media, the database, and any custom folders/files under wp-content.

      There is a paid extension that adds support for scheduling and storing backups on DigitalOcean Spaces - https://servmask.com/products/digitalocean-spaces-extension

Submit an Answer