WordPress Transfer

Hi Experts,

Tomorrow I need to transfer a new WordPress site from my localhost to live, and I wanted to get some feedback on the easiest way to this, including design, content and settings?

In my mind I need to

1- Install WP Live
2 - From local export the db as .sql
3 - Within .sql search and replace http://localhost with http://www.domain.com, then replace the db on live site.
4 - FTP my parent and child theme
5 - FTP my content directory
6 - Install any plugins

Am I missing anything?

Thank you,
APD TorontoSoftware DeveloperAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Julian HansenCommented:
Here is the process I use

1. Install WP CLI

2. Create a backup of your DB (we are going to modify the local version so we want to be able to restore it).
mysqldump --databases LOCALDB -u LOCALUSER -p > LOCALDB.YYYYMMDD.sql

Open in new window

Enter LOCALPASS when prompted
   LOCALDB is the name of the database on your local machine - get from wp-config.php
   LOCALUSER is the name of the user for the above database
   YYYYMMDD is the date
   LOCALPASS is the password for the above user

Open in new window

3. Run the following WP CLI COMMAND in the ROOT folder of your WordPress site (same folder as your wp-config.php file)

  - Assume you access your local version as http://localhost/yourwpsite (change to what you actually use) and
  - Assume your target domain is www.yournewdomain.com then
wp search-replace --allow-root --url=localhost/yourwpsite localhost/yourwpsite www.yournewdomain.com

Open in new window

This will update your local DB with the production URL's

4. Dump your DB again (this is the version with the modified URL's we are gong to upload to the production server)
mysqldump --databases LOCALDB -u LOCALUSER -p > PRODDB.YYYYMMDD.sql

Open in new window

Enter LOCALPASS when prompted

5. Edit the PRODDB.YYYYMMDD.sql file and remove the CREATE DATABASE line and change the USE `XXXXXX` line to your online database name (replace the XXXXX with your online db name)

6. Upload the database to the server

7. Upload the files to the server (I usually ZIP the folder and upload the ZIP then extract in the Root folder on the server)

8. Edit your .htaccess file
Replace all instances of your local path with your new path. So if your local host was running off
http://localhost/yourwpsite and your online site is in the root domain then
Replace yourwpsite with blank for all instances in your .htaccess file

9. Update your wp-config.php file.
In the WP root folder on the Production server, edit the wp-config.php file and change the Database, User and Password values to the values for your online Database

10. Update your permalinks.
  - Logon to the wp_admin page
  - Go to Settings => Permalinks
  - Click the Save button

11. Restore your local DB to what it was

mysql -h localhost -u LOCALUSER -p

Open in new window

Then at the MySQL prompt

Open in new window

  LOCALUSER to your local user account
  LOCALPASS to the password for your local user account
  LOCALDB to the name of your local database
  LOCALDB.YYYYMMDD.sql to the name you used in step 2

Open in new window

You are done.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
APD TorontoSoftware DeveloperAuthor Commented:
Thank you!
Julian HansenCommented:
You are welcome.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.