I design wordpress sites locally then when the time comes to deploy it to a hosted server I transer all the database and I edit the config table for the new url, but I dont think this is a good practice.
What are you thoughts on the best way to do this?
My question is : How do I publish a wordpress site from my computer to a live server constantly?
I take it you are referring to the site url settings. You can override these from the config file instead of manually editing the db values. This is a supported and probably safest way to do it.
http://codex.wordpress.org/Editing_wp-config.php#WordPress_address_.28URL.29
Once you have the site up and running you can save the settings from the WP interface and remove the lines from the config file.
define('WP_SITEURL', 'http://example.com/wordpress');
define('WP_HOME', 'http://example.com/wordpress');
Related
I have created a demo website for a client. I installed the site on the client's live domain name and I used the etc/host DNS trick to point the domain to my development sever. Now I want to send a live preview to client for validation but I don't want to bother her with technical details such as modifying local computer host file. The client doesn’t want to switch the domain to the new site either, until everything is ready as the site is highly active. I have tried the cpanel temporary link (mod_userdir is enabled) but it breaks everything including styles and scripts. Do you have any solution. Thanks.
Update: I have found this site if it can help nodns.io, they only need the emulated domain name and the development server IP.
You can still use the temporary URL and that is the easiest way. You just need to make a change in the WordPress database. You can go to cPanel -> phpMyAdmin, open the database and look for the _options table.
Once you find it, you need to change the home and siteurl options to the temporary URL:
https://codex.wordpress.org/Changing_The_Site_URL
You can follow the "Changing the URL directly in the database" directions.
Goodluck!
I am finding some problems uploading a WP site from my local web server to the official online web server.
The situation is the following , on my local web server:
I have installed WP website on my computer
I have configured it
I have installed custom a template
After, I have uploaded this site in a folder on my official online web server. I have took the local database export and imported in the online database using PhpMyAdmin (to export the local database on a file and then to import it on the online database)
Finally I have changed the file wp-config.php changing the MySql connection settings and putting here the settings related to the official online database.
When I try to open the website it appears to me, here you can say how: http://www.scorejava.com/wordpress/
Ok...seems good but there are two problems:
If you try to open an article it is not open the article on the online server but in the localhost server, infact open this URL: [code]http://localhost/wordpress/?p=81[/code]
If I try to open the administration panel opening this URL: [code]http://www.scorejava.com/wordpress/wp-admin/[/code] I obtain a white page
I don't know if these two problems are related together but I think that all may depend due to a problem of location path...
I think that somewhere there is some settings that specify the URL (that can't be localhost...), but (if it is so...) where is this setting? in some file or in the database?
Some one have an idea? Can you help me?
Look into this: http://codex.wordpress.org/Moving_WordPress
There's a link on there for a "Search and Replace for WordPress Databases Script" tool that's very handy (make sure to read the instructions and have a backup of the db before using it). The problem is that image URL's and other things are stored in the database and will reflect the URL of the dev location. That tool will go through and properly update all instances from the dev URL to the final location.
Normally before you move a WP site you also want to update the site URL in the General settings as well, which may be contributing to your second problem.
I have created a wordpress website on the localhost and want to migrate it to the clients server. How can i shift the content, images (media) and the theme and its widgets.
Hope i dont have to recreate all that on the website all over again :D
BackupBuddy is probably the most efficient and easiest way. Here's the URL: BackupBuddy
Plenty of documentation and the plugin basically does everything for you.
Review the Wordpress Codex on this issue for details and various Tools that can help you.
Make sure that your theme and widgets are not referencing the old domain directly. If this is a theme/plugin/widget of your own making, you should be aware that Wordpress has Various Functions that reference the URL of your Wordpress installation.
You need to do a few things:
Install WP Migrate DB http://wordpress.org/extend/plugins/wp-migrate-db/ and use it to export the DB as a gzip file
Upload all the Wordpress files to the server modifying wp-config.php to match the client's MySql server. If WP is already installed, upload only what's in wp-content
Access the client's MySql server (normally through phpMyAdmin) and import the gzip file that contains your DB
To get the server path on the client's server (WP Migrate DB will ask for it) use this php snippet from the site's / :
<?php print_r(__DIR__) ?>
That should be it.
Cheers.
I have done a blog in mamp and would like to push into hostgator. Must i recreate everything in hostgator like Installing Wordpress on Hostgator. Is there any way i could just push my stuff straight into hostgator without redoing everything in hostgator. Need some suggestion.. Thanks..
It's quite easy to deploy a local version of Wordpress to a live server. First of all, you are right, I would not bother installing a clean copy of Wordpress on your server, you'd then have to totally rebuild the site.
What you need to do is;
FTP all your files from your local machine to the server.
Transfer the whole database from local phpmyadmin to a new database on the server
Change the database connection details in wp-config.php
Make any necessary changes to your default Wordpress .htaccess. What I mean here is that your MAMP site probably isn't in the root but your live site probably will be. If you have SEO permalinks set up then you would remove the Mamp subdirectory from the rewrite rule and the base in the .htaccess. Your host might also require you to add rules here (ie specifying which version of PHP to use etc). You could always install Wordpress using their installer to see if they add any special rules themselves.
All easy so far - now comes my tip. Moving Wordpress databases from your local development environment to live can be a massive pain because Wordpress (and lots of plugin/theme developers) use serialized arrays to store data. So if you do a find-and-replace on the database to replace your old url with the new one, you will disable lots of things like config settings and widgets (text widgets specifically, but there's loads of stuff you end up having to recreate).
Download this file;
http://interconnectit.com/124/search-and-replace-for-wordpress-databases/
and upload it to the server and access it directly in your browser. Run through the quick form and perform a serialized array-friendly find and replace on your database urls. Job done. Good luck.
I've installed and tested Wordpress configurations on my home server which I use as my test server.
Is it possible to upload everything, including Wordpress, from my home web server to my hosting account so it will work instantly there?
Of course I need to change the database name, password, but that's about it.
thanks!
http://codex.wordpress.org/Moving_WordPress
Nike's link is good, but also be aware they you may need to take extra steps when moving certain plugins, like CformsII, you will have to resetup your Widgets if you use any, and be sure to check your .htaccess file for any changes that you may have to make if you are using permalinks.
For files, you should be able to upload your themes and plugins to the web host.
For the database, you can go into your local setup, Admin->Tools->Export. This will export your local WP settings, posts, pages, etc to a file.
Install WP on your host, then go to Admin->Tools->Import. Select the file from the previous step. Your hosted WP should now be the same as your local copy.