Scotts Web Dev Banner
Did you notice... every article on this site has an associated video? Consider subscribing to Scotts Web Dev on YouTube! :)

How To Manually Migrate WordPress Site To New Hosting

Manual WordPress Migration

In this video/article we explore how to move your current wordpress site to a new hosting or new server. A lot of hosting places (like Hostinger) will offer a one-click migration but it’s not always suitable. Sometimes you have to do it manually, and here’s how.

Download Your Entire WordPress Site To Your Computer

You need to download all of the files from your current wordpress on to your computer. So you can transfer them to your new hosting. You can do this using FTP (see how to use ftp). I like to use a free program called FileZilla to log into my hosting server via FTP and download files. You’ll want to make sure you download files from the root folder of your WordPress installation. This should include all of the files including the folders wp-content, wp-admin, and wp-includes.

Upload Your Entire WordPress Site To Your New Hosting

Now that you have your site’s files on your computer, you’ll need to log into your new hosting via FTP and upload all the files you just downloaded.

Downloading and uploading can take some time, so be patient.

If you guys would like a video/article on how to use FTP to download/upload, please comment on my Youtube video for How To Manually Migrate Your WordPress Site and I’ll make one.

Create A New Database On Your New Hosting

If you try to visit your site now, you’ll notice that you get an error about the database. This is because your new hosting doesn’t have the data that your old site had. We’ll need to get your database in here on your new hosting, too. The first step to doing that is to create a new database.

Navigate to your new hosting panel dashboard and find the place to add new databases. Write down the new database name, user, and password that you create here. Often times you’ll have to separately create a database, then create a user, then add that user to your new database. If you have to do this, give your new user All Privileges.

Export Your Old/Current Database Using PHPMyAdmin

We need to get your old data, too. That way your files can read your data and display your site like it was on your old hosting. The first step to doing this is to export the database using PHPMyAdmin.

From your old hosting panel, navigate to PHPMyAdmin, select your database that your site was using, and click on the Export tab at the top. The default settings are fine. Once you click “Go” your old database will download to your computer. Make note of where the file is so that you can select it in the next step. If you’re on Windows it’ll probably be in your downloads folder.

Import Your Database Into Your New Hosting Using PHPMyAdmin

Now, we’re going to go to PHPMyAdmin in your new hosting panel. Once there, navigate to the Import tab and select the file you just downloaded in the “Choose File” box. Click “Go” again, and your data will be imported into your new database.

If your database is too big to upload through PHPMyAdmin, you can upload your database to your new hosting using FTP and log into your new hosting server using SSH (see how to use SSH on Windows). From there, you can log into MySQL via SSH and import your data. The steps would look something like this:

mysql -u yourmysqluser -p

Enter your password at the prompt.

use yournewdatabasename;
source /path/to/file.sql;

Hopefully things go smoothly for you and you don’t need to use MySQL over SSH as using PHPMyAdmin is just quicker and easier.

Put Your New Database Details In wp-config.php

You’ll need to edit your new hosting’s wp-config.php file to point to your database. You can do this through FileZilla, or by editing it on your computer and then re-uploading it to your hosting.

Enter the new values for DB_NAME, DB_USER, and DB_PASSWORD. These are the values that you wrote down earlier when you created a new database and user.

Once done editing, re-upload wp-config.php to your new server, overwriting the old version.

Edit wp_options Table To Update siteurl And home Fields

Before you can view your new site, you need to edit two rows in the wp_options table. If you don’t do this step you’ll be redirected to your old site when you visit your old URL.

In your new hosting’s PHPMyAdmin navigate to the wp_options table by clicking the table name. Select the home and siteurl rows by placing a checkmark beside each of them and then selecting edit. Change the value in both of these rows to your new site URL. Then hit Go/Save.

Visit your new site URL in your browser.

If you attempted to visit your site in your browser before you edited these rows, your browser may be cached and forward you to your old url still. If this is the case, just open your new URL in an incognito window. This should break the cache. You can also flush your dns cache on windows by hitting the windows key and r at the same time, enter cmd.exe in the prompt, and then typing ipconfig /flushdns in the command prompt. This will flush the dns on your system.

Visit Your New URL

If all has went well, visiting your new URL in your browser should load your new site. If it does not, please revisit all of the steps above.

You will notice though that you may have some links to your old url in your new site. Let’s fix that.

Install Better Search & Replace Plugin

You don’t have to use this specific plugin, but I find that Better Search & Replace is a really good, simple to use, free plugin that just searches and replaces very well.

You need to replace all instances of your old URL with your new URL.

Search for your old url by typing in youroldurl.com and replace it with your new url by typing in yournewurl.com.

Select the appropriate checkboxes and run it.

Make Sure You Can Upload & View Images After Migrating Your WordPress Site

One of the most common issues is missing images after migration or not being able to upload new images after migration. You can solve this by checking the permissions on your uploads folder. You’ll want to set your wp-uploads folder to at least 0755 permissions. If this doesn’t work, check with your hosting provider about changing ownership of your wordpress files to the correct user so that WordPress can write to the wp-uploads directory. This may require opening a support ticket or chat with your new hosting provider.

Re-Enable Plugins

You may also need to re-enable plugins. If your plugins aren’t enabled, simple enable them from your plugins screen in your WordPress dashboard.

Check Your Site Over

We’ve covered all of the steps here but it’s impossible to know every site and how data will react to being on a new domain. Check over your entire site and try to use it as if you were on your old hosting. Fix any inconsistencies or problems that may come up.

That’s it! You should be up and running with your WordPress site on your new hosting! Check out more WordPress articles and videos.