When we move WordPress website, we all are scared for ruining things while the move. It might bring lots of repeat work as an after effect of the move. I also become worried while moving the website from one host to another one. However, it’s a necessity most of the times. We come to a situation at least once where we need to move our WordPress set up from one place to another. Whether it be a localhost to live domain, one domain to new domain, staging site to live server, live domain to staging site or anything. We can’t ignore it.
Having a step by step guide will surely help to get the task done keeping the things very much as it is. The guide also contains how to edit database to change to the new URL without editing tables directly that I have learned so far from the expert developers I have worked with.
Step By Step Guide for “How to move WordPress?”
Step1: Create Back up
Create a back-up of the live website. This is for safety purpose only. Live site is not going to be changed in whole process. However, if anything happens you will have a back up to restore.
If you want to know more on creating back up of the theme, this post will certainly help you more.
Step2: Export Database
Go to your phpmyadmin and open the database of the website. Click on the “Export”. Under “Format” section, select “SQL”. Click on “GO” button. You will have a file with sql code in it.
Step3: Export coding files and uploaded files.
Connect to FTP of the current website or go to the files through cPanel -> File Manager. If you are using cPanel, go to “public_html” folder, select all files/folders and “Compress” them by using options on right click. Download this whole folder. If you are connecting via FTP, go to “public_html” folder and download all the files and folders in a separate folder on your hard drive.
Step4: Import files.
Connect to FTP/cPanel of the new domain. If you are using FTP, extract all the files. Upload all the files downloaded at “public_html” folder, downloaded in last step. If you are using cPanel upload the zip/rar files directly at same “public_html” folder, reload the file manager and you can then extract files via right click options.
Step5: Create new database and user.
A) After logging in to cPanel, Go to your MySQL Databases. Create a new database under “Create New Database” section. Image given for this here.
Note: Steps to create database will be different as per the host. However, most of the times options are similar.
B) Now, after creating database an authenticated user is required to create who can access the database with privileges. Hence, Under the same section create a user. Once you create user, you will have an option to add the user to the database. Select the database you created just. Now, after creating user make sure the user has all privilege. Most of the times, it asks you which permission to provide. Allow all the access, as this will be required for WordPress files to connect with the database.
Step6: Edit the database for new domain.
Take a copy of the sql exported file and open by using any editor like DreamViewer or Notepad++.
Replace the previous domain name with new domain name. Make sure to keep the other things in the URL as it is. Such as “http://” or “/”. I prefer to replace only domain name without “http://” or “/” with new domain. I also prefer to do the “Replace All”. This way it replaces URLs with better accuracy.
Step7: Import database
Go to phpmyadmin. Go to “Import” tab. Click on “Choose File” button given under “File to Import” section. Upload the edited file and Click on “Go” button.
Step8: Verify website status
Open the website and make sure everything is loading properly. Make sure to clear browser cache and then load website.
Here we have covered with “How to move WordPress?”. Most of the steps remains same each time. Depending on the tools being used, option names differs from each other a bit. In any section if you feel some more information is required, let me know in comments below. I will update it further. Also, after knowing “Move WordPress in just 8 steps”, if you are looking for some more details on any possibilities and features of incredible WordPress let me know. I will try to write more on it to give ya solution for it.