Move wordpress from home web server to web server hosting account - wordpress

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.

Related

How to manually back up wordpress website

I have never used wordpress before, My boss has given me access to a site which was created using wordpress. then He asked me how I am going to make sure I don't break the site accidentally, I told him I would create a backup on my local computer so that all my changes can be restored if I mess up.
I have the wordpress dashboard up. How do I back up EVERYTHING, I hear there are two separate things I need to back up? someone please help me.
PS: I don't think he would like me to do this with out the use of additional plugins.
There are two separate things:
Your website database. Simply export all the MySQL tables from the database, which is dedicated to your site.
The site files, everything you've got under WordPress folder, /wp-includes, /wp-content, /wp-admin directories and all files.
This should do it all. You can test on your localhost to make sure it's everything that's necessary.
You can backup your WordPress either from your hosting account (preferable) or from your WP dashboard.
You need to backup two things - all the files (the root of your Wordpress installation) and the database for your WP installation.
Since you only have access to the dashboard, you have to use plugin for this.
Two of my favorite free backup plugins are:
BackupWordpress - https://wordpress.org/plugins/backupwordpress/
BackWPup - https://wordpress.org/plugins/backwpup/
They are intuitive and easy to work with, so you shouldn't have issues.
If you go to the dashboard go to "tools" in the left toolbar. Select "export". On the export page you can report that you want to export "all content". This will get you the items that you need from the server.
Then you need to install wordpress to your machine. You can download that from: https://wordpress.org/download/
Once you have that on your machine you also need a local server to run it and test it. I like WAMP, but it partially depends on your operating system. I suggest the following video to get you up to speed on how to get the localhost set up and running: https://www.youtube.com/watch?v=snFzbPm_RUE
Hope this helps!

moving WordPress over to domain, after working on it locally through MAMP

I've finished the styling changes on WordPress and I'm ready to move it from MAMP to my domain.
Will this involve any changes to the WordPress files or can I just drag it over to my new domain once I purchased it?
The main start you must make is update your wp-config.php
define('WP_HOME','http://www.mynewdomain.com');
define('WP_SITEURL','http://www.mynewdomain.com');
That way wordpress knows what domain it MUST run from.
The reason you do that is because without this you may not be able to access admin, login, etc etc.
When this is working and you have logged in, go to wp-admin and go to your permalink settings.
Make a NOTE of your settings, then change them to default (and woocommerce settings etc).
Go to your home page and a few others, and notice how messed up your urls look :)
Now go back to permalink settings and restore them (the point of this is to make sure your .htaccess file that wordpress depends upon is set correctly)
Finally, have a look at https://github.com/veloper/WordPress-Domain-Changer to change your sql etc if needed.
note this method is very handy for developers so you just update your wp-config.php for localhost or development or production (not for testing purposes, don't use your local pc. copy it all up to a subdirectory of your hosting partner e.g. http://www.mynewdomain.com/mytestarea. Make sure you use a COPY of the mysql database (never point both to the same database). You now can test on the hosting platform without disturbing the live site or your development causing issues to other people.
It's been a long while for me personally, but you'll want to change the SiteURL via the options menu in wp-admin.
Otherwise, just make sure your MySQL database is exported over, your credentials and user permissions are all setup and those work too.
If you still have problems:
https://codex.wordpress.org/Changing_The_Site_URL
https://codex.wordpress.org/Moving_WordPress
The database has to be updated. What always works for me is that I export the database from phpMyAdmin or MySQL (using mysqldump) and open the exported .sql-file with a text editor, like Sublime Text.
Now you want to find any occurence of your previous URL. Let's say on your dev machine the URL to the index of your Wordpress site is http://localhost:8080/wordpress and you want it to be on a website under https://domain.com you simply do a Find & Replace using that and replace everything with https://domain.com.
For older Wordpress versions you have to update the .htaccess files if you have custom URL's.
You have to make a search replace in your database and replace your local domain ( test.lo ) with the live domain ( test.com ).
To do this you can use the script from here: https://interconnectit.com/products/search-and-replace-for-wordpress-databases/
Add the searchreplacedb2.php file in your route folder and the access test.lo/searchreplacedb2.php and follow the steps there. This will replace your local domain with your live one everywhere in the database.
You can't make a simple search-replace because the local domain might be serialized in some fields in the database, and a simple search-replace will not replace those.

Mirroring a Wordpress *configuration* between local and remote

Ok, so I'm familiar with creating local Wordpress builds, and have been chugging along happily with the technique outlined in Smashing's MAMP-based article. My question goes a step beyond this.
The article is great for developing generic themes, but when developing sites (not necessarily blogs) based in Wordpress, for me at least, it's a little painful come launch day.
I have to go back in and reconfigure the server's Wordpress to match what I've already done locally. Settings have to be entered again, plugins need be installed again, menus recreated, and css will have to be altered to reference the unique classes/id's Wordpress generates for posts/pages/custom taxonomies…sometimes things are missed in the process. What I want to know is this:
Is there an easy way to automate cloning or mirroring the build on my local machine to the remote server?
Even if you have to just LMGTFY me, that would help. I don't exactly know what I should be searching for. Searches dealing with 'mirroring wordpress configuration' and 'cloning wordpress configuration' returns tutorials on moving content, which I know how to do.
If it helps, I'm running OSX 10.6.8 with xcode dev tools, git, ruby, node, and homebrew. All of my live servers have ssh access as well as ftp, and I build with the most current versions of Wordpress.
Here are some easy steps to follow:
Download and install the WP Migrate DB plugin.
Go to Tools > WP Migrate DB and fill-in the blank fields(New address (URL), New file path and optionally check/uncheck the other options). Click on Export Database and save the export file to your computer.
Make a .zip archive with ALL of your files(the /wp-admin, /wp-content, /wp-includes directories and all files in the root directory).
Upload that file to your production server, where you want your WordPress site to reside.
Go to your cPanel(or use the unzip command through SSH) File Manager(or any other alternative that you might have) and unzip the file that you just uploaded.
If you don't already have a Database set-up on your production server - create one through the hosting control panel(for cPanel, it would be Creating a mySQL database in cPanel, for plesk it would be Plesk 7 Tutorial: Creating a database, for anything else, just google it up, or try your hosting's FAQ). Remember/write-down your Database Name, Database User and Password.
Edit the wp-config.php file and change the values for the DB_NAME, DB_USER, DB_PASSWORD and optionally DB_HOST - but this is usually localhost - if that doesn't work try asking your web host, or if you have phpMyAdmin, log-in to it and look at the very top of the page - in this case the DB_HOST would be localhost.
After you've done all of that, log-in to your DB administration tool(most of the time this would be phpMyAdmin, but it could be something else as well) and upload the database export file that you save to your computer in step 2. Note: If your hosting hasn't provided you with a DB administration tool, I would suggest that you upload the phpMiniAdmin(click on the "Download latest version" link and save the file to your computer) script to your production server. Then go to that script(if your website is located at http://example.com/, go to http://example.com/phpminiadmin.php) and enter your DB details. On top of that page, you will see an import link. Click on it and upload your DB export file. Note 2: phpMiniAdmin doesn't support gzip-compressed files, so if you did check the Compress file with gzip option in step 2, you will have to re-do that step with this option unchecked.
Log-in to your site and go to Settings > Permalinks in order to update your permalink structure.
Check the permissions of the /wp-content/uploads and /wp-content/plugins directories - make sure that you will be able to upload images and plugins without any problems.
That's pretty much it. It might seem like a lot, but I follow this process for almost every site that I upload to production servers and it can take me as less as a bit under 10 minutes to do all of that(considering that I usually use custom MySQL commands, instead of the WP Migrate DB plugin - I should probably start using it :) ). Once you get used to the process and you don't encounter any low-quality web hostings, you should be perfectly fine with these steps.
Note: Since you used ssh as one of your tags, I assume that you usually have ssh access to the production server. If you don't I'm still assuming that you have a cPanel access(if that's not true and you can't unzip files on the server, then upload all files manually via FTP client, instead of doing steps 3 and 4).
I guess the only way is to copy the database or part of it.
What I do is to copy the relevant tables and modify manually the site URLs in table options. There are only 2. There is also a nice plugin velvet-blues-update-urls to modify all links, after the site URLs are set manually to be able to access the backend, in case posts are also copied.
Next, copy all theme directory files to the same directory in the site, assuming you are using the same theme.
Both processes can be automated with a PHP script.
I am not sure this is what you want, but hope this helps.
Not sure that this is exactly what you need, but to move a site you can use the built in Wordpress "export" and "import" options. As far as I remember there was an option when importing to change URL's and the import would change a few things for you.
Even if this does not answer your exact question, hope it helps.

How to push wordpress from mamp into hostgator

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.

Wordpress deploy pages, post and menus to live server

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');

Resources