A Web.com Partner

How To Migrate Your WordPress Website From One Hosting Account To Another

Disclaimer: Any products/services mentioned or recommended below are suggestions based on our own experiences. We have no affiliation with any of the products or services mentioned and you should always thoroughly and independently research your options to decide what is best for you.

A time may come when you need to move your website from one hosting account to another, most commonly, when you’re moving a website to a new hosting provider.

We’ve put together a handy guide to step you through the process.

Step 1: Take a backup.

This step is important for 2 reasons; first to give you a recovery point in case something goes wrong along the way, and secondly, you’ll need a backup of the site to upload to your new hosting account.

To take a backup in the current cPanel hosting account, first login and then head to the “Backup Wizard” icon. You’ll be prompted to choose between backing up and restoring. For now, choose back up. Next, click the “Full Backup” option. On the next page, make sure the backup destination is your home directory and then click “Generate Backup”. And now, we wait! This process may take a few minutes depending on how big your website is. After a few minutes, press the “go back” button. You may see something along the lines of this:

backup-5.24.2019_21-21-24_yourwebsite.tar.gz (Fri May 24 21:21:24 2019) [inprogress]

If the “In Progress” label is still there at the end, give it another few minutes and then press refresh. Once the “In Progress” label is gone (or if it was never there to begin with) your backup is ready. Click on it to begin the download.

Step 2: Prepare your backup file for re-upload.

Next, you’ll need to find the compressed zip folder you just downloaded, and unzip/extract it.

For Mac users, “Archive Utility” is a built in tool that should assist you with this automatically when you double click the compressed file. For Windows users, right click on the file and choose “Extract”.

Next, you’ll need to dive into the uncompressed folder. Find the sub folder titled “homedir” and go into it. Next, locate and right click on the “public_html” folder and create a new archive/compressed file with it. On a Mac, simply choose “Compress”. On Windows select “Send to”, and then select “Compressed (zipped) folder”.

You’re now ready to upload your website to your new hosting account.

Step 3: Upload to your destination hosting account.

Begin by logging in to your new/destination cPanel hosting account. Find the “File Manager” icon and click on it.

Next, navigate to the “public_html” directory and click the “Upload” button at the top. In a finder/windows explorer window, locate your freshly compressed/zipped “public_html” folder and drag it into the upload box.

Once the process completes, click the “Go back” link down the bottom of the page. Locate your uploaded file and click on it. Then choose “Extract” from the top menu. When prompted, click “Extract File(s)”. Once the process completes, click the “Settings” button at the top-right of the window. When prompted, ensure “Web root” is the selected option. Most importantly, ensure the two check boxes at the bottom are both checked (Show Hidden Files (dotfiles) &

Disable Character Encoding Verification Dialogs).

Now, press the “Reload” button.

Once you’ve completed that, select all of the files and folders you see. We’re now going to move them one directory up so that they’re sitting in the right place, and not in the folder we uploaded them in. Once you have everything selected, click and drag it all across directly into the “public_html” folder on the left-hand navigation. Once that’s done, click on the “public_html” folder to go there. You should see all of your files now sitting in the right spot. You’ll also now have an extra, unneeded folder also titled “public_html” within this directory. It will now be empty, and should be deleted. Your files are now ready!

Step 4: Re-Upload your database.

The next step is to reupload your database. Head back to your cPanel’s home screen and select the “MySQL® Databases” icon. Next, create a brand new database, user and password. Make sure you note down the database name, username and password temporarily in a notepad/text editor file.

Next, add the user you just created to the database, and give them all permissions. You can do this by scrolling down to the bottom of the page where you’ll see the “Add User To Database” option.

Once that’s done, you’re ready to upload your database tables. Head back to your cPanel home screen and select the phpMyAdmin icon. Once loaded, click on the new database you just created on the left hand side, then select the import option up the top.

You can safely ignore the options on this page. You just need to now navigate through your downloaded backup file for your database. Start by clicking the “Choose file” button and navigating to your downloaded backup (the uncompressed version). This time, instead of looking in the “homedir” folder, we want to look in the “mysql” folder. Within this file, look for the file ending with .sql – that one is your databse. Select it and click “Go”. Your database is now ready!

Step 5: Link your database to your files.

You’re now on the home stretch with one step to go. Head back to your cPanel home screen and choose the “File Manager” icon. Click on the “public_html” directory and locate the “wp-config.php” file. Click on it and select “Edit”.

Now, find the section that looks something like this:

 

// ** MySQL settings – You can get this info from your web host ** //

/** The name of the database for WordPress */

define(‘DB_NAME’, ‘yourwebsite_db’);

 

/** MySQL database username */

define(‘DB_USER’, ‘yourwebsite_user’);

 

/** MySQL database password */

define(‘DB_PASSWORD’, ‘4hU@1^dX6d3’);

 

Replace the values with your freshly created database name, user and password. Be careful not to remove the apostrophes either side of the values. Once you’re done, press “Save Changes”.

Step 6: Adjust your DNS records.

Your website is now set up in both your old and your new hosting accounts. All you need to do now to redirect traffic to your new hosting account is adjust your DNS records to point from the old server to the new server. Your hosting provider will be able to tell you what these details should be, and also where and how to update them.

If you’re a Digital Pacific customer, simply give us a call and we’d be happy to help you with this step!

Once your DNS records have been updated, you’re all set! Your website has now been migrated and you should be good to go.

That’s it from us for this week. As always, if you have any questions about this post or our shared hostingVPSreseller or dedicated server plans, simply call us on  1300 MY HOST (694 678) during business hours, or submit a ticket through our Support Portal and one of the crew will be in touch!

WordPress Hosting

Get tips & insights
direct to your inbox.

Sign up to our newsletter to get the most from your website hosting with insider tips, tools and guides plus 10% off your first invoice!

Have more questions
on Hosting?

Simply call us on 1300 MY HOST (694 678) during business hours, or submit a ticket through OnePanel and one of the crew will be in touch!

Get in touch
Top
Chat