Skip to main content

[UPDATE] How to move your wordpress site and mysql database from local XAMPP to the web server


Most web developers follow the way of "first local, then on the server" for their website's early development or setup stages in order to gain either speed or freedom in installing pluging and extensions due to servers' permissions for files and folders.

A small problem comes around when you need to move your site from your local environment ( commonly XAMPP ) to your webserver so your website can go "live". This article will let you know the steps you need to follow when it comes to Wordpress and moving if from local to yuor server.

Before we start, you will need to :

1. have the url, username and password of your hosting environment's management panel ( cPanel or Plesk e.t.c. ) and log into it.
2. in your hosting panel, you need to add FTP access to your site, you will need to jot down the IP or domain name ( depending on DNS ), a username and a password
3. you will need to go into your hosting's database management via your management panel, create a new database ( for wordpress this is mysql ), name it, add a username and a password and jot all of those down, we will need them soon.
4. go to your hosting panel's mail settings and add a mail account for your site, i.e. noreply@mysite.com and jot down the address and its password, along with its POP and SMTP mail server addresses.

Now we can start.

Step 1 - Zip your files and upload the zipped file, then de-compress on-server

You will see that if you select all the files of your website ( thus the contents of c:/xampp/htdocs/mysite/ ) to an archive, the size will decrease significantly. In such manner, we are to zip the files in our local environment, upload the file to the server and then de-compress or un-zip those over there, mainly to gain bandwidth and time. Its not that wise to wait for 100 Megabytes to be uploaded ( containing a lot of very small files which tend to stall the transfer ) when we can upload for instance 60 Megabytes of just one file. Of course, there may be a chance that our zip file is uploaded badly and we may need to re-upload, but that is rare.

To upload our files to the server, we will need an FTP application. Yes, there is an option to transfer our file via the browser's upload function through our hosting panel ( i.e. cPanel or Plesk ) but its better to do this via the FTP application so we will not have to face timeouts and small network hickups that can break our transfer. The most common application for FTP ( we will need to have FTP access credentials ) is FileZilla. One thing to note about filezilla is to never store the passwords as this can cause us very very serious problems...

Here is how to disable password saving in FileZilla ( its called Kiosk Mode ) , open Filezilla and go to Edit->Settings then follow the image below :


Ok, after you have the FTP credentials we mentioned earlier, you will need to fill them in at the top site of filezilla as you can see below :


Once you click "Quickconnect" you will see the window blow this bar, to start loading files and folders. You will need to transfer your zipped file onto your webserver, preferably in the htdocs or www or root folder and wait until this is uploaded.

Once the file is uploaded, you will need to visit your hosting panel's file manager and go to that same folder, select the file that you've just finished uploading and de-compress it.

Step 2 - Upload the database via phpmyadmin

Wordpress is accompanied by a database which is implemented in mysql. You will need to go to your http://localhost/phpmyadmin and in the list of your databases to your left, select the database that refers to your site and click "Export" as you can see in the image below :


Now, you need to visit the same tool up onto your web hosting panel, there is a phpMyAdmin there too, your hosting provider has given you the address, or you can visit phpMyAdmin on your server via going in to visit the web panel for your database, the one you created online just before we started. When you visit the panel, you will need to do the reverse step, upload the file you got from the export.

In your webserver's phpMyAdmin, you will select the database from the list to your right and then ( careful you must select your database first ) select "Import" then you will select the file ( .sql file ) you got before and upload. Then the database and the data will be restored.


Step 3 - Update your configuration file

You will need to open up your webserver's file manager and go to your site's root folder, then open and edit the file named "wp_config.php" which contains the settings for your site and how it connects to your database. You will need to change the settings here to match your webserver's settings, those you've set up just before we started.



Step 4 - Update database tables and settings

When starting with wordpress locally, all the local-specific settings are bound into the database. For instance, your site's homepage address will be http://localhost/mysite which is ok for local but will never work on your webserver. We need to change such settings via the webserver's phpMyAdmin tool and here is how.

UPDATE : before running manual commands, you can try and download a tool titled "Database Search and Replace" from interconnectit here, unzip it in your wordpress root and then after you update your wp-config file with the information of the new live database, run the url of the replace tool and it will replace everything in your database for you. Its pretty slick and working great. There are two versions, one based on AJAX and one based on simple PHP, if the first does not work for you, you can try the basic one. 

Step 5 - You are there

If things went alright, then your site is now live. Here you can make a very common mistake. To see if things are fine, either view your site via another computer or remember to stop XAMPP before you test. Why is this important? Because you may have forgotten to update the database correctly and your browser will ask data from /localhost/ instead of the live site and thus, you will be the only one to see those...
Enhanced by Zemanta

Comments

Popular posts from this blog

Enable AMD's Radeon Chill feature for all games.

Since 2014 AMD has been following the tradition of releasing new performance and usability features in their December driver, and 2016 was no exception. Among the myriad of new features and enhancements, was also one that passed almost unnoticed, called Radeon Chill.

Stemming from AMD's acquisition of HiAlgo earlier in 2016, it offers the possibility of huge power and thermal savings while gaming, by monitoring screen movement and adjusting the frame rate accordingly. There is even the claim that it could also reduce response times since the GPU is not occupied with rendering as often.

Its only issue: it's not global, and it's based on a white list of applications to function. But fear not, for we are here. Using a trick as old as operating systems themselves, you can try to make it work with every title. Let's see how to do that.
Step One: Activate Radeon Chill. Doing that is fairly easy. Right click on your desktop and select "Radeon Settings":

Then naviga…

Your first post in your Facebook Page, some simple tips

Many new pages are created on Facebook every day by brands that need to use the network for wither exposure or marketing or both. There are many small businesses that want to use Facebook and need to know about some initial tips to get started with their facebook page.

Facebook page management is no rocket science, but it can lead your brand to either a successful presence or nothing at all, if you don't pay attention to some details. You have to start with the basics. Your every-day process with your page is your posts, information you share on your page and your fans will see. First take a note that not all of your fans will see your post. Let's say you have 1000 fans, only about 10-15% of your fans are expected to actually see that post. What's important here is to make your post appealing so whoever sees it, will be able to engage with it, thus either comment, share or like it.

Take a look at our video for those tips :



Every time a Facebook user likes, share or commen…

Resident Evil 7 no stutter guide for 30 and 60 fps systems

The release of the last Resident Evil game has had us go from indifferent, to cautiously optimistic, to infatuated with one of the best releases in the series; a game on par with the couple of initial classics and the fourth instalment. Capcom decided to drop the third person over-the-shoulder perspective for this one and go with the first person camera, refreshing the whole series in the process. Make no mistake, this is one of the greats, and you owe it to yourself to at least try it out even if you aren't into horror games at all. Unlike other publishers, Capcom has been kind enough to provide a demo of the first hour of the game in Steam. Go ahead and try it.

The game itself is quite well optimized, as it is one of the initial PlayStation VR titles released and that means it has to adhere to specific latency requirements. The good news for PC gamers (sorry, no PC VR yet) is a 60fps target where most older GPUs and systems can have a proper experience. Unfortunately, the game …