Solved

WordPress on local PC and hosted

Posted on 2015-02-05
11
143 Views
Last Modified: 2015-02-12
I have installed WordPress locally on my PC to experiment/learn WordPress with Dreamweaver. Eventually my site will be on my hosting account.

Can someone confirm that ALL the content is on the MySQL database? So that if I export the database and import it online I will have EVERYTHING as on my local PC? (all the plugins and the theme will be the same)
0
Comment
Question by:hindersaliva
  • 4
  • 3
  • 2
  • +2
11 Comments
 
LVL 82

Assisted Solution

by:Dave Baldwin
Dave Baldwin earned 125 total points
ID: 40592562
That's not quite true.  You do also need the theme files which are not in the database.  Actually you need all the files in your Wordpress directories because your configuration files are there too.

In addition, your database files will have to be edited because they contain the domain that Wordpress is installed on/in and that will have to be changed when you move it to your hosting account.
0
 

Author Comment

by:hindersaliva
ID: 40592623
Ok. That's what I feared. So I can experiment locally, but will need to replicate manually on the hosting account?

I'd be interested to hear how the experts do it. Work solely on the hosting account?
0
 
LVL 82

Expert Comment

by:Dave Baldwin
ID: 40592685
That's the way that most web site development works except for having to adjust the info in the database.  My Wordpress installs are just for testing and experimenting so I just work on them (rarely) on my hosting account.  Although I do have a complete back up on this machine.
0
 
LVL 16

Accepted Solution

by:
Lucas Bishop earned 125 total points
ID: 40593056
It will be much easier to migrate, if you have your localhost setup to act as your main domain and your database name/user matches identically to your web host (assuming your web host has the database on the same server as the web site) and you use the same file structure.

So let's say your domain is "mydomain.com". You'll set up your local server to host this domain. You'll also setup your pc host-file to look at your localhost for this domain (instead of doing a dns lookup).  This way when you're configuring your Wordpress installation locally, all of the settings (except DB location potentially) will be an identical match to what you have on your web host.

When it comes time to migrate, you'll simply copy your db from the localhost to the web host. You'll copy the wordpress installation files/folders to the web host. You'll update your pc's host file to stop looking at the localhost for mydomain.com

If you end up running into any issues, they'd generally be confined to updating your wp-config.php file in the site root, to have correct database connection information.  The siteurl and home values in the database table "wp_options" (via phpadmin or whatever db editor your web host provides).  If you have permalinks configured, you'd need to disable on the new site and re-configure the htaccess file.
0
 
LVL 70

Assisted Solution

by:Jason C. Levine
Jason C. Levine earned 125 total points
ID: 40595033
What Lucas said, plus not attempting to use Dreamweaver :)
0
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 
LVL 82

Expert Comment

by:Dave Baldwin
ID: 40595065
Oh, I missed that part.  No Dreamweaver.  It was never made to cope with something like Wordpress.
0
 

Author Comment

by:hindersaliva
ID: 40595280
Ah I see about Dreamweaver:) What would be a good web authoring tool for tweeking WordPress?
0
 
LVL 16

Expert Comment

by:Lucas Bishop
ID: 40595283
I like to use firebug to edit css styles while viewing the live site. Once I get them exactly how I want them to look, then I copy them into the actual syle.css files.
0
 
LVL 82

Expert Comment

by:Dave Baldwin
ID: 40595308
What would be a good web authoring tool for tweeking WordPress?
Usually just a colorized code editor.  HTML-kit, Notepad++, PSPad, and several others.  The 'problem' with Wordpress and similar programs is that it takes many files to create a page.  And each file only does part of the code.  That's why it's so 'versatile' but also difficult for a "web authoring tool" to deal with.  If you allowed some of the 'automatic' features in Dreamweaver to operate, you could crash the whole site in no time.  

Many of the top PHP experts here do not use a "web authoring tool" because the automation provided often interferes with the code instead of helping it.  Just good code editors.
0
 
LVL 7

Assisted Solution

by:Alicia St Rose
Alicia St Rose earned 125 total points
ID: 40595312
I use Coda to edit any code files.
LiveReload to automatically reload my CSS edits
Nice plugin to add the necessary livereload script to your site: Live Reload Snippet Do not forget to DEACTIVATE and trash the plugin on the live remote site or it will slow it down to molasses!

I work on my local machine all of the time. I'm using Mamp to do so.

When I'm ready to migrate to remote server here are my steps:

1. FTP wp-content folder to remote server
2. Drop remote database
3. Import database from local machine
4. Go to SQL tab in phpMyAdmin
5. Slap in the following code (with your correct URL's):

UPDATE wp_options SET option_value = replace(option_value, 'http://www.oldurl', 'http://www.newurl') WHERE option_name = 'home' OR option_name = 'siteurl';

UPDATE wp_posts SET guid = replace(guid, 'http://www.oldurl','http://www.newurl');

UPDATE wp_posts SET post_content = replace(post_content, 'http://www.oldurl', 'http://www.newurl');

UPDATE wp_postmeta SET meta_value = replace(meta_value,'http://www.oldurl','http://www.newurl');

Open in new window


You will be good to go!

I third: Bag the Dreamweaver!
0
 

Author Comment

by:hindersaliva
ID: 40606333
Thanks everyone. I'm better educated now thanks to you.
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

What's this? As a volunteer Page Editor for Experts-Exchange.com, I have noticed that many authors also have blogs, and pull articles from their blogs to post at Experts-Exchange. I appreciate each author sharing their blog content with our site …
How to create your own WordPress Theme Before I begin with the theme design tutorial, I would like to give you the basics of what is required to make a WordPress Theme. The most basic WordPress theme only requires 2 files: a style.css file and an…
The purpose of this video is to demonstrate how to manually back up a WordPress Database. This will be demonstrated using a Windows 8 PC. The Host used will be IPage.com Log into your Hosting account. IPage will be used for demonstration : Locat…
The purpose of this video is to demonstrate how to reset a WordPress password if you are locked out and cannot reset the password. A typical use would be if you cannot access the email to which WordPress would send the password recovery email to…

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now